2024-03-11 17:50:27 +08:00
|
|
|
<?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.labelfieldcontent.LabelFieldContentMapper">
|
|
|
|
|
|
|
|
|
|
<resultMap type="LabelFieldContent" id="LabelFieldContentResult">
|
|
|
|
|
<result property="id" column="id"/>
|
|
|
|
|
<result property="fieldId" column="field_id"/>
|
|
|
|
|
<result property="fieldName" column="field_name"/>
|
2024-06-20 13:46:21 +08:00
|
|
|
<result property="fieldCode" column="field_code"/>
|
|
|
|
|
<result property="fieldValue" column="field_value"/>
|
|
|
|
|
<result property="portraitSn" column="portrait_sn"/>
|
|
|
|
|
<result property="patientId" column="patient_id"/>
|
|
|
|
|
<result property="portraitStatus" column="portrait_status"/>
|
2024-03-11 17:50:27 +08:00
|
|
|
<result property="contentSort" column="content_sort"/>
|
|
|
|
|
<result property="contentRemark" column="content_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="selectLabelFieldContentVo">
|
|
|
|
|
select id,
|
|
|
|
|
field_id,
|
|
|
|
|
field_name,
|
2024-06-20 13:46:21 +08:00
|
|
|
field_code,
|
|
|
|
|
field_value,
|
|
|
|
|
portrait_sn,
|
|
|
|
|
patient_id,
|
|
|
|
|
portrait_status,
|
2024-03-11 17:50:27 +08:00
|
|
|
content_sort,
|
|
|
|
|
content_remark,
|
|
|
|
|
create_by,
|
|
|
|
|
create_time,
|
|
|
|
|
update_by,
|
|
|
|
|
update_time
|
|
|
|
|
from label_field_content
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectLabelFieldContentList" parameterType="LabelFieldContent" resultMap="LabelFieldContentResult">
|
|
|
|
|
<include refid="selectLabelFieldContentVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="fieldId != null ">
|
2024-06-20 13:46:21 +08:00
|
|
|
and field_id = #{fieldId}
|
2024-03-11 17:50:27 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="fieldName != null and fieldName != ''">
|
2024-06-20 13:46:21 +08:00
|
|
|
and field_name like concat('%', #{fieldName}, '%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="fieldCode != null and fieldCode != ''">
|
|
|
|
|
and field_code = #{fieldCode}
|
2024-03-11 17:50:27 +08:00
|
|
|
</if>
|
2024-06-20 13:46:21 +08:00
|
|
|
<if test="fieldValue != null and fieldValue != ''">
|
|
|
|
|
and field_value = #{fieldValue}
|
2024-03-11 17:50:27 +08:00
|
|
|
</if>
|
2024-06-20 13:46:21 +08:00
|
|
|
<if test="portraitSn != null and portraitSn != ''">
|
|
|
|
|
and portrait_sn = #{portraitSn}
|
2024-03-11 17:50:27 +08:00
|
|
|
</if>
|
2024-06-20 13:46:21 +08:00
|
|
|
<if test="patientId != null ">
|
|
|
|
|
and patient_id = #{patientId}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="portraitStatus != null and portraitStatus != ''">
|
|
|
|
|
and portrait_status = #{portraitStatus}
|
2024-03-11 17:50:27 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="contentSort != null ">
|
2024-06-20 13:46:21 +08:00
|
|
|
and content_sort = #{contentSort}
|
2024-03-11 17:50:27 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="contentRemark != null and contentRemark != ''">
|
2024-06-20 13:46:21 +08:00
|
|
|
and content_remark = #{contentRemark}
|
2024-03-11 17:50:27 +08:00
|
|
|
</if>
|
|
|
|
|
</where>
|
2024-04-18 14:52:39 +08:00
|
|
|
order by content_sort, create_time DESC
|
2024-03-11 17:50:27 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectLabelFieldContentById" parameterType="Long"
|
|
|
|
|
resultMap="LabelFieldContentResult">
|
|
|
|
|
<include refid="selectLabelFieldContentVo"/>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="existCountByFieldIdAndContentName" resultType="java.lang.Integer">
|
|
|
|
|
select count(1)
|
|
|
|
|
from label_field_content
|
|
|
|
|
where field_id = #{fieldId}
|
|
|
|
|
and content_name = #{contentName}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="existCountByContentNameExcludingId" resultType="java.lang.Integer">
|
|
|
|
|
select count(1)
|
|
|
|
|
from label_field_content
|
|
|
|
|
where content_name = #{contentName}
|
|
|
|
|
and field_id = #{fieldId}
|
|
|
|
|
and id != #{id}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertLabelFieldContent" parameterType="LabelFieldContent" useGeneratedKeys="true"
|
|
|
|
|
keyProperty="id">
|
|
|
|
|
insert into label_field_content
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="fieldId != null">field_id,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="fieldName != null">field_name,
|
|
|
|
|
</if>
|
2024-06-20 13:46:21 +08:00
|
|
|
<if test="fieldCode != null">field_code,
|
2024-03-11 17:50:27 +08:00
|
|
|
</if>
|
2024-06-20 13:46:21 +08:00
|
|
|
<if test="fieldValue != null">field_value,
|
2024-03-11 17:50:27 +08:00
|
|
|
</if>
|
2024-06-20 13:46:21 +08:00
|
|
|
<if test="portraitSn != null">portrait_sn,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="patientId != null">patient_id,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="portraitStatus != null">portrait_status,
|
2024-03-11 17:50:27 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="contentSort != null">content_sort,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="contentRemark != null">content_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="fieldId != null">#{fieldId},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="fieldName != null">#{fieldName},
|
|
|
|
|
</if>
|
2024-06-20 13:46:21 +08:00
|
|
|
<if test="fieldCode != null">#{fieldCode},
|
2024-03-11 17:50:27 +08:00
|
|
|
</if>
|
2024-06-20 13:46:21 +08:00
|
|
|
<if test="fieldValue != null">#{fieldValue},
|
2024-03-11 17:50:27 +08:00
|
|
|
</if>
|
2024-06-20 13:46:21 +08:00
|
|
|
<if test="portraitSn != null">#{portraitSn},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="patientId != null">#{patientId},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="portraitStatus != null">#{portraitStatus},
|
2024-03-11 17:50:27 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="contentSort != null">#{contentSort},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="contentRemark != null">#{contentRemark},
|
|
|
|
|
</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="updateLabelFieldContent" parameterType="LabelFieldContent">
|
|
|
|
|
update label_field_content
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="fieldId != null">field_id =
|
2024-04-18 14:52:39 +08:00
|
|
|
#{fieldId},
|
2024-03-11 17:50:27 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="fieldName != null">field_name =
|
2024-04-18 14:52:39 +08:00
|
|
|
#{fieldName},
|
2024-03-11 17:50:27 +08:00
|
|
|
</if>
|
2024-06-20 13:46:21 +08:00
|
|
|
<if test="fieldCode != null">field_code =
|
|
|
|
|
#{fieldCode},
|
2024-03-11 17:50:27 +08:00
|
|
|
</if>
|
2024-06-20 13:46:21 +08:00
|
|
|
<if test="fieldValue != null">field_value =
|
|
|
|
|
#{fieldValue},
|
2024-03-11 17:50:27 +08:00
|
|
|
</if>
|
2024-06-20 13:46:21 +08:00
|
|
|
<if test="portraitSn != null">portrait_sn =
|
|
|
|
|
#{portraitSn},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="patientId != null">patient_id =
|
|
|
|
|
#{patientId},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="portraitStatus != null">portrait_status =
|
|
|
|
|
#{portraitStatus},
|
2024-03-11 17:50:27 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="contentSort != null">content_sort =
|
2024-04-18 14:52:39 +08:00
|
|
|
#{contentSort},
|
2024-03-11 17:50:27 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="contentRemark != null">content_remark =
|
2024-04-18 14:52:39 +08:00
|
|
|
#{contentRemark},
|
2024-03-11 17:50:27 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="createBy != null">create_by =
|
2024-04-18 14:52:39 +08:00
|
|
|
#{createBy},
|
2024-03-11 17:50:27 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="createTime != null">create_time =
|
2024-04-18 14:52:39 +08:00
|
|
|
#{createTime},
|
2024-03-11 17:50:27 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="updateBy != null">update_by =
|
2024-04-18 14:52:39 +08:00
|
|
|
#{updateBy},
|
2024-03-11 17:50:27 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="updateTime != null">update_time =
|
2024-04-18 14:52:39 +08:00
|
|
|
#{updateTime},
|
2024-03-11 17:50:27 +08:00
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteLabelFieldContentById" parameterType="Long">
|
|
|
|
|
delete
|
|
|
|
|
from label_field_content
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteLabelFieldContentByIds" parameterType="String">
|
|
|
|
|
delete from label_field_content where id in
|
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
2024-04-01 17:13:42 +08:00
|
|
|
|
|
|
|
|
<select id="selectLabelFieldContent"
|
|
|
|
|
resultType="com.xinelu.manage.vo.labelfieldcontent.LabelFieldContentVO">
|
|
|
|
|
select id LabelFieldContentId,
|
|
|
|
|
field_id,
|
|
|
|
|
field_name,
|
|
|
|
|
content_sort,
|
2024-06-20 13:46:21 +08:00
|
|
|
content_remark
|
2024-04-01 17:13:42 +08:00
|
|
|
from label_field_content
|
|
|
|
|
<where>
|
|
|
|
|
<if test="labelFieldIds != null and labelFieldIds.size() > 0">
|
|
|
|
|
field_id in
|
|
|
|
|
<foreach item="labelFieldIds" collection="labelFieldIds" open="(" separator="," close=")">
|
|
|
|
|
#{labelFieldIds}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
2024-06-25 17:41:41 +08:00
|
|
|
|
|
|
|
|
<select id="selectByPatientId" resultType="com.xinelu.manage.vo.labelfieldcontent.LabelFieldInfoContentVo">
|
|
|
|
|
select
|
|
|
|
|
content.field_code,
|
|
|
|
|
info.task_partition_dict_id,
|
|
|
|
|
content.field_value,
|
|
|
|
|
content.portrait_sn
|
|
|
|
|
from label_field_content content left join label_field_info info on content.field_id = info.id
|
|
|
|
|
where content.patient_id = #{patientId} and content.portrait_status='INUSE'
|
|
|
|
|
</select>
|
2024-03-11 17:50:27 +08:00
|
|
|
</mapper>
|