PostDischargePatientManage/postdischarge-manage/src/main/resources/mapper/manage/scriptInfo/ScriptInfoMapper.xml

270 lines
9.7 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xinelu.manage.mapper.scriptInfo.ScriptInfoMapper">
<resultMap type="ScriptInfo" id="ScriptInfoResult">
<result property="id" column="id"/>
<result property="departmentId" column="department_id"/>
<result property="departmentName" column="department_name"/>
<result property="diseaseTypeId" column="disease_type_id"/>
<result property="diseaseTypeName" column="disease_type_name"/>
<result property="commonScriptName" column="common_script_name"/>
<result property="scriptName" column="script_name"/>
<result property="scriptId" column="script_id"/>
<result property="platformId" column="platform_id"/>
<result property="scriptStatus" column="script_status"/>
<result property="scriptIntroduction" column="script_introduction"/>
<result property="scriptSort" column="script_sort"/>
<result property="scriptRemark" column="script_remark"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectScriptInfoVo">
select id,
department_id,
department_name,
disease_type_id,
disease_type_name,
common_script_name,
script_name,
script_id,
platform_id,
script_status,
script_introduction,
script_sort,
script_remark,
create_by,
create_time,
update_by,
update_time
from script_info
</sql>
<select id="selectScriptInfoList" parameterType="ScriptInfo" resultMap="ScriptInfoResult">
<include refid="selectScriptInfoVo"/>
<where>
<if test="departmentId != null ">
and department_id =
#{departmentId}
</if>
<if test="departmentName != null and departmentName != ''">
and department_name like concat('%',
#{departmentName},
'%'
)
</if>
<if test="diseaseTypeId != null ">
and disease_type_id =
#{diseaseTypeId}
</if>
<if test="diseaseTypeName != null and diseaseTypeName != ''">
and disease_type_name like concat('%',
#{diseaseTypeName},
'%'
)
</if>
<if test="commonScriptName != null and commonScriptName != ''">
and common_script_name like concat('%',
#{commonScriptName},
'%'
)
</if>
<if test="scriptName != null and scriptName != ''">
and script_name like concat('%',
#{scriptName},
'%'
)
</if>
<if test="scriptId != null and scriptId != ''">
and script_id =
#{scriptId}
</if>
<if test="platformId != null and platformId != ''">
and platform_id =
#{platformId}
</if>
<if test="scriptStatus != null and scriptStatus != ''">
and script_status =
#{scriptStatus}
</if>
<if test="scriptIntroduction != null and scriptIntroduction != ''">
and script_introduction =
#{scriptIntroduction}
</if>
<if test="scriptSort != null ">
and script_sort =
#{scriptSort}
</if>
<if test="scriptRemark != null and scriptRemark != ''">
and script_remark =
#{scriptRemark}
</if>
</where>
</select>
<select id="selectScriptInfoById" parameterType="Long"
resultMap="ScriptInfoResult">
<include refid="selectScriptInfoVo"/>
where id = #{id}
</select>
<select id="countByScriptInfo" resultType="java.lang.Integer"
parameterType="com.xinelu.manage.domain.scriptInfo.ScriptInfo">
select count(*)
from script_info
<where>
department_id = #{departmentId}
and common_script_name = #{commonScriptName}
<if test="diseaseTypeId != null ">
and disease_type_id =
#{diseaseTypeId}
</if>
</where>
</select>
<insert id="insertScriptInfo" parameterType="ScriptInfo" useGeneratedKeys="true"
keyProperty="id">
insert into script_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="departmentId != null">department_id,
</if>
<if test="departmentName != null">department_name,
</if>
<if test="diseaseTypeId != null">disease_type_id,
</if>
<if test="diseaseTypeName != null">disease_type_name,
</if>
<if test="commonScriptName != null">common_script_name,
</if>
<if test="scriptName != null">script_name,
</if>
<if test="scriptId != null">script_id,
</if>
<if test="platformId != null">platform_id,
</if>
<if test="scriptStatus != null">script_status,
</if>
<if test="scriptIntroduction != null">script_introduction,
</if>
<if test="scriptSort != null">script_sort,
</if>
<if test="scriptRemark != null">script_remark,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="departmentId != null">#{departmentId},
</if>
<if test="departmentName != null">#{departmentName},
</if>
<if test="diseaseTypeId != null">#{diseaseTypeId},
</if>
<if test="diseaseTypeName != null">#{diseaseTypeName},
</if>
<if test="commonScriptName != null">#{commonScriptName},
</if>
<if test="scriptName != null">#{scriptName},
</if>
<if test="scriptId != null">#{scriptId},
</if>
<if test="platformId != null">#{platformId},
</if>
<if test="scriptStatus != null">#{scriptStatus},
</if>
<if test="scriptIntroduction != null">#{scriptIntroduction},
</if>
<if test="scriptSort != null">#{scriptSort},
</if>
<if test="scriptRemark != null">#{scriptRemark},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
</trim>
</insert>
<update id="updateScriptInfo" parameterType="ScriptInfo">
update script_info
<trim prefix="SET" suffixOverrides=",">
<if test="departmentId != null">department_id =
#{departmentId},
</if>
<if test="departmentName != null">department_name =
#{departmentName},
</if>
<if test="diseaseTypeId != null">disease_type_id =
#{diseaseTypeId},
</if>
<if test="diseaseTypeName != null">disease_type_name =
#{diseaseTypeName},
</if>
<if test="commonScriptName != null">common_script_name =
#{commonScriptName},
</if>
<if test="scriptName != null">script_name =
#{scriptName},
</if>
<if test="scriptId != null">script_id =
#{scriptId},
</if>
<if test="platformId != null">platform_id =
#{platformId},
</if>
<if test="scriptStatus != null">script_status =
#{scriptStatus},
</if>
<if test="scriptIntroduction != null">script_introduction =
#{scriptIntroduction},
</if>
<if test="scriptSort != null">script_sort =
#{scriptSort},
</if>
<if test="scriptRemark != null">script_remark =
#{scriptRemark},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteScriptInfoById" parameterType="Long">
delete
from script_info
where id = #{id}
</delete>
<delete id="deleteScriptInfoByIds" parameterType="String">
delete from script_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>