From 29069b790469cb7136cadba7ddcd63a83bc4ac70 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期一, 23 三月 2026 15:20:20 +0800
Subject: [PATCH] 门急诊分表代码(增、改、查)提交

---
 smartor/src/main/resources/mapper/smartor/PatArchiveOutMapper.xml |  113 +++++++++++++++++++++++++++-----------------------------
 1 files changed, 55 insertions(+), 58 deletions(-)

diff --git a/smartor/src/main/resources/mapper/smartor/PatArchiveOutMapper.xml b/smartor/src/main/resources/mapper/smartor/PatArchiveOutMapper.xml
index 45e43b7..ed9d355 100644
--- a/smartor/src/main/resources/mapper/smartor/PatArchiveOutMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatArchiveOutMapper.xml
@@ -77,33 +77,33 @@
             resultMap="PatArchiveOutResult">
         <include refid="selectPatArchiveOutVo"/>
         where 1=1
-            <if test="patientno != null  and patientno != ''">and patientno = #{patientno}</if>
-            <if test="pattype != null  and pattype != ''">and pattype = #{pattype}</if>
-            <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
-            <if test="sex != null ">and sex = #{sex}</if>
-            <if test="nation != null  and nation != ''">and nation = #{nation}</if>
-            <if test="nativePlace != null  and nativePlace != ''">and native_place = #{nativePlace}</if>
-            <if test="placeOfResidence != null  and placeOfResidence != ''">and place_of_residence =
-                #{placeOfResidence}
-            </if>
-            <if test="birthplace != null  and birthplace != ''">and birthplace = #{birthplace}</if>
-            <if test="idcardno != null  and idcardno != ''">and idcardno = #{idcardno}</if>
-            <if test="birthdate != null ">and birthdate = #{birthdate}</if>
-            <if test="age != null ">and age = #{age}</if>
-            <if test="archivetime != null ">and archivetime = #{archivetime}</if>
-            <if test="archiveby != null  and archiveby != ''">and archiveby = #{archiveby}</if>
-            <if test="telcode != null  and telcode != ''">and telcode = #{telcode}</if>
-            <if test="relativetelcode != null  and relativetelcode != ''">and relativetelcode = #{relativetelcode}</if>
-            <if test="idcardtype != null  and idcardtype != ''">and idcardtype = #{idcardtype}</if>
-            <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
-            <if test="openid != null  and openid != ''">and openid = #{openid}</if>
-            <if test="dduserid != null  and dduserid != ''">and dduserid = #{dduserid}</if>
-            <if test="source != null ">and source = #{source}</if>
-            <if test="isupload != null ">and isupload = #{isupload}</if>
-            <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
-            <if test="pid != null ">and pid = #{pid}</if>
-            <if test="guid != null  and guid != ''">and guid = #{guid}</if>
-            <if test="membertype != null  and membertype != ''">and membertype = #{membertype}</if>
+        <if test="patientno != null  and patientno != ''">and patientno = #{patientno}</if>
+        <if test="pattype != null  and pattype != ''">and pattype = #{pattype}</if>
+        <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
+        <if test="sex != null ">and sex = #{sex}</if>
+        <if test="nation != null  and nation != ''">and nation = #{nation}</if>
+        <if test="nativePlace != null  and nativePlace != ''">and native_place = #{nativePlace}</if>
+        <if test="placeOfResidence != null  and placeOfResidence != ''">and place_of_residence =
+            #{placeOfResidence}
+        </if>
+        <if test="birthplace != null  and birthplace != ''">and birthplace = #{birthplace}</if>
+        <if test="idcardno != null  and idcardno != ''">and idcardno = #{idcardno}</if>
+        <if test="birthdate != null ">and birthdate = #{birthdate}</if>
+        <if test="age != null ">and age = #{age}</if>
+        <if test="archivetime != null ">and archivetime = #{archivetime}</if>
+        <if test="archiveby != null  and archiveby != ''">and archiveby = #{archiveby}</if>
+        <if test="telcode != null  and telcode != ''">and telcode = #{telcode}</if>
+        <if test="relativetelcode != null  and relativetelcode != ''">and relativetelcode = #{relativetelcode}</if>
+        <if test="idcardtype != null  and idcardtype != ''">and idcardtype = #{idcardtype}</if>
+        <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
+        <if test="openid != null  and openid != ''">and openid = #{openid}</if>
+        <if test="dduserid != null  and dduserid != ''">and dduserid = #{dduserid}</if>
+        <if test="source != null ">and source = #{source}</if>
+        <if test="isupload != null ">and isupload = #{isupload}</if>
+        <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
+        <if test="pid != null ">and pid = #{pid}</if>
+        <if test="guid != null  and guid != ''">and guid = #{guid}</if>
+        <if test="membertype != null  and membertype != ''">and membertype = #{membertype}</if>
     </select>
 
     <select id="selectPatArchiveOutByPatid" parameterType="Long" resultMap="PatArchiveOutResult">
@@ -116,40 +116,37 @@
         from (
         SELECT "浣忛櫌" as name1, count(1) as count FROM `pat_med_inhosp`
         where 1=1
-            and del_flag = 0 and endtime = null
-            <if test="orgid != null and orgid != ''">
-                AND orgid = #{orgid}
-            </if>
-            <if test="deptIds != null ">and deptId in
-                <foreach collection="deptIds" item="deptId" open="(" separator="," close=")">
-                    #{deptId}
-                </foreach>
-            </if>
-            <if test="drCodes != null ">and drcode in
-                <foreach collection="drCodes" item="drCode" open="(" separator="," close=")">
-                    #{drCode}
-                </foreach>
-            </if>
+        and del_flag = 0 and endtime = null
+        <if test="orgid != null and orgid != ''">
+            AND orgid = #{orgid}
+        </if>
+        <if test="deptcodes != null ">and deptcode in
+            <foreach collection="deptcodes" item="deptcode" open="(" separator="," close=")">
+                #{deptcode}
+            </foreach>
+        </if>
+        <if test="drCodes != null ">and drcode in
+            <foreach collection="drCodes" item="drCode" open="(" separator="," close=")">
+                #{drCode}
+            </foreach>
+        </if>
         union
         select "鍑洪櫌" name1, count(1) as count FROM `pat_med_inhosp`
         where 1=1
-            and del_flag = 0 and endtime != null
-            <if test="orgid != null and orgid != ''">
-                AND orgid = #{orgid}
-            </if>
-            <if test="deptIds != null ">and deptId in
-                <foreach collection="deptIds" item="deptId" open="(" separator="," close=")">
-                    #{deptId}
-                </foreach>
-            </if>
-            <if test="drCodes != null ">and drcode in
-                <foreach collection="drCodes" item="drCode" open="(" separator="," close=")">
-                    #{drCode}
-                </foreach>
-            </if>
-        union
-        select "闂ㄨ瘖" name1, count(1) as count FROM `pat_med_outhosp`
-        where del_flag=0
+        and del_flag = 0 and endtime != null
+        <if test="orgid != null and orgid != ''">
+            AND orgid = #{orgid}
+        </if>
+        <if test="deptcodes != null ">and leaveldeptcode in
+            <foreach collection="deptcodes" item="deptcode" open="(" separator="," close=")">
+                #{deptcode}
+            </foreach>
+        </if>
+        <if test="drCodes != null ">and drcode in
+            <foreach collection="drCodes" item="drCode" open="(" separator="," close=")">
+                #{drCode}
+            </foreach>
+        </if>
         ) aa
 
     </select>

--
Gitblit v1.9.3