From 7913a655b4f017eea4e8f95e34232143f92ecaaf Mon Sep 17 00:00:00 2001 From: liusheng <337615773@qq.com> Date: 星期五, 21 三月 2025 18:22:08 +0800 Subject: [PATCH] 代码提交 --- smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml | 56 +++++++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 41 insertions(+), 15 deletions(-) diff --git a/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml index c114008..9a114e5 100644 --- a/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml +++ b/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml @@ -59,11 +59,14 @@ <result property="guid" column="guid"/> <result property="operator" column="operator"/> <result property="operatorId" column="operator_id"/> + <result property="remark" column="remark"/> + <result property="tagname" column="tagname"/> </resultMap> <sql id="selectPatMedInhospVo"> select inhospid, patname, + remark, guid, operator, operator_id, @@ -120,9 +123,6 @@ select CONCAT( a.age, a.age_unit ) AS age, a.telcode as telcode, a.sex, - b.guid, - b.operator, - b.operator_id, b.inhospid, b.nurse_id, b.nurse_name, @@ -171,27 +171,36 @@ b.leaveldeptid, b.long_task_reason, b.schemetime + -- COALESCE ( + -- ( + -- SELECT GROUP_CONCAT(d.tagname, ', ') + -- FROM pat_archivetag d + -- WHERE d.patid = a.id + -- AND d.del_flag = 0 + -- ), '') AS tagname FROM - pat_med_inhosp b, - pat_archive a + pat_med_inhosp b + JOIN + pat_archive a ON a.id = b.patid + LEFT JOIN + pat_archivetag c ON c.patid = a.id AND (C.del_flag = 0 OR C.del_flag IS NULL) <where> - a.del_flag=0 - and b.del_flag=0 - and a.id = b.patid - AND a.idcardno != '' + a.del_flag = 0 + AND b.del_flag = 0 + AND a.idcardno IS NOT NULL <if test="startOutHospTime != null"> - AND date_format(b.endtime,'%y%m%d') >= date_format(#{startOutHospTime},'%y%m%d') + AND TO_DATE(b.endtime,'YYYY-MM-DD') >= TO_DATE(#{startOutHospTime},'YYYY-MM-DD') </if> <if test="endOutHospTime != null"> - AND date_format(b.endtime,'%y%m%d') <= date_format(#{endOutHospTime},'%y%m%d') + AND TO_DATE(b.endtime,'YYYY-MM-DD') <= TO_DATE(#{endOutHospTime},'YYYY-MM-DD') </if> - + <if test="tagname != null and tagname != ''">and c.tagname like concat('%', #{tagname}, '%')</if> <if test="startInHospTime != null"> - AND date_format(b.starttime,'%y%m%d') >= date_format(#{startInHospTime},'%y%m%d') + AND TO_DATE(b.starttime, 'YYYY-MM-DD') >= TO_DATE(#{startInHospTime}, 'YYYY-MM-DD') </if> <if test="endInHospTime != null"> - AND date_format(b.starttime,'%y%m%d') <= date_format(#{endInHospTime},'%y%m%d') + AND TO_DATE(b.starttime, 'YYYY-MM-DD') <= TO_DATE(#{startInHospTime}, 'YYYY-MM-DD') </if> <if test="hospitalname != null and hospitalname != ''">and hospitalname like concat('%', #{hospitalname}, '%') @@ -242,9 +251,15 @@ </foreach> </if> </where> + GROUP BY + b.inhospid, + a.age, + a.age_unit, + a.telcode, + a.id, + a.sex order by b.inhospid desc </select> - <select id="selectPatMedInhospListByCondition" parameterType="com.smartor.domain.PatMedInhospVO" resultMap="PatMedInhospResult"> select CONCAT( a.age, a.age_unit ) AS age, @@ -253,6 +268,7 @@ b.patname, b.operator_id, b.operator, + b.remark, b.out_way_id, b.out_way_name, b.nurse_id, @@ -341,6 +357,13 @@ </if> </where> order by b.inhospid desc + </select> + + <select id="getTagnameBypatid" parameterType="Long" resultType="string"> + SELECT GROUP_CONCAT(d.tagname, ', ') + FROM pat_archivetag d + WHERE d.patid = #{patid} + AND d.del_flag = 0 </select> @@ -403,6 +426,7 @@ <if test="operator != null ">operator,</if> <if test="operatorId != null ">operator_id,</if> <if test="inhospno != null ">inhospno,</if> + <if test="remark != null ">remark,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="serialnum != null">#{serialnum},</if> @@ -455,6 +479,7 @@ <if test="operator != null ">#{operator},</if> <if test="operatorId != null ">#{operatorId},</if> <if test="inhospno != null ">#{inhospno},</if> + <if test="remark != null ">#{remark},</if> </trim> </insert> @@ -510,6 +535,7 @@ <if test="guid != null ">guid = #{guid},</if> <if test="operator != null ">operator = #{operator},</if> <if test="operatorId != null ">operator_id = #{operatorId},</if> + <if test="remark != null ">remark = #{remark},</if> </trim> where inhospid = #{inhospid} </update> -- Gitblit v1.9.3