From ec23ec3d3dc4ec1ba7d79ba4f46ae2c31d5a16a9 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期三, 07 一月 2026 10:49:10 +0800
Subject: [PATCH] 【市一】调整mapper获取ordid

---
 smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml |   81 ++++++++++++++++++++++------------------
 1 files changed, 45 insertions(+), 36 deletions(-)

diff --git a/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml b/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
index d10139b..4d78dc0 100644
--- a/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
@@ -180,8 +180,9 @@
 
     <select id="selectPatArchiveList" parameterType="com.smartor.domain.PatArchive" resultMap="PatArchiveResult">
         <include refid="selectPatArchiveVo"/>
-        <where>
-            del_flag=0
+        WHERE 1=1
+
+            AND del_flag=0
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
             <if test="idcardno != null  and idcardno != ''">and idcardno = #{idcardno}</if>
             <if test="sourcefrom != null ">and sourcefrom = #{sourcefrom}</if>
@@ -212,7 +213,7 @@
             <if test="filterDrname != null ">and filter_drname = #{filterDrname}</if>
             <if test="filterDrcode != null ">and filter_drcode = #{filterDrcode}</if>
             <if test="campusid != null ">and campusid = #{campusid}</if>
-        </where>
+        
     </select>
 
 
@@ -250,9 +251,10 @@
         a.filter_drcode,
         a.case_person_age
         from pat_archive a,pat_archivetag b ,base_tag c
-        <where>
-            a.del_flag=0 and
-            a.id = b.patid and b.tagid = c.tagid
+        WHERE 1=1
+
+            AND a.del_flag=0 and
+            AND a.id = b.patid and b.tagid = c.tagid
             <if test="filterDrname != null ">and filter_drname = #{filterDrname}</if>
             <if test="filterDrcode != null ">and filter_drcode = #{filterDrcode}</if>
             <if test="name != null  and name != ''">and a.name like concat('%', #{name}, '%')</if>
@@ -264,7 +266,7 @@
                     #{tagId}
                 </foreach>
             </if>
-        </where>
+        
     </select>
 
     <select id="selectPatArchiveByPatid" parameterType="Long" resultMap="PatArchiveResult">
@@ -513,8 +515,9 @@
         FROM
         pat_archive a
         LEFT JOIN pat_archivetag b ON a.id = b.patid AND b.del_flag = 0
-        <where>
-            a.del_flag = 0
+        WHERE 1=1
+
+            AND a.del_flag = 0
             and a.orgid = #{orgid}
             <if test="name != null  and name != ''">and a.name like concat('%', #{name}, '%')</if>
             <if test="idcardno != null  and idcardno != ''">and a.idcardno = #{idcardno}</if>
@@ -528,7 +531,7 @@
                     #{tagId}
                 </foreach>
             </if>
-        </where>
+        
         order by a.update_time desc
         <if test="pn != null  and ps != null">limit ${pn},${ps}</if>
 
@@ -596,8 +599,9 @@
         LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid
         ) t ON t.patid =
         d.patid
-        <where>
-            d.del_flag != 1
+        WHERE 1=1
+
+            AND d.del_flag != 1
             AND a.del_flag != 1
             and d.orgid = #{orgid}
             <if test="name != null  and name != ''">and a.name like concat('%', #{name}, '%')</if>
@@ -637,14 +641,14 @@
             <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size()>0">
                 AND d.leavehospitaldistrictcode IN
                 <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
-                         close=")">
+                         AND close=")">
                     #{leavehospitaldistrictcode}
                 </foreach>
             </if>
             <if test="leaveldeptcodes != null and leaveldeptcodes.size() > 0">
                 AND d.leaveldeptcode IN
                 <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
-                         close=")">
+                         AND close=")">
                     #{leaveldeptcode}
                 </foreach>
             </if>
@@ -652,14 +656,14 @@
             <if test="hospitaldistrictcodes != null and hospitaldistrictcodes.size()>0">
                 AND d.hospitaldistrictcode IN
                 <foreach collection="hospitaldistrictcodes" item="hospitaldistrictcode" open="(" separator=","
-                         close=")">
+                         AND close=")">
                     #{hospitaldistrictcode}
                 </foreach>
             </if>
             <if test="deptcodes != null and deptcodes.size() > 0">
                 AND d.deptcode IN
                 <foreach collection="deptcodes" item="deptcode" open="(" separator=","
-                         close=")">
+                         AND close=")">
                     #{deptcode}
                 </foreach>
             </if>
@@ -672,7 +676,7 @@
             <if test="isFilter == true">
                 AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid)
             </if>
-        </where>
+        
         -- order by a.update_time desc
         <if test="pageSize != null  and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if>
 
@@ -728,8 +732,9 @@
         LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid
         ) t ON t.patid =
         d.patid
-        <where>
-            d.del_flag != 1
+        WHERE 1=1
+
+            AND d.del_flag != 1
             AND a.del_flag != 1
             and d.orgid = #{orgid}
             <if test="pid != null  and pid != ''">and a.id = #{pid}</if>
@@ -766,7 +771,7 @@
             <if test="isFilter == true">
                 AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid)
             </if>
-        </where>
+        
         -- order by a.update_time desc
         <if test="pageSize != null  and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if>
     </select>
@@ -822,8 +827,9 @@
         LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid
         ) t ON t.patid =
         d.patid
-        <where>
-            d.del_flag != 1
+        WHERE 1=1
+
+            AND d.del_flag != 1
             AND a.del_flag != 1
             and d.orgid = #{orgid}
             <if test="pid != null  and pid != ''">and a.id = #{pid}</if>
@@ -861,7 +867,7 @@
             <if test="isFilter == true">
                 AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid)
             </if>
-        </where>
+        
         -- order by a.update_time desc
         <if test="pageSize != null  and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if>
     </select>
@@ -930,8 +936,9 @@
         LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid
         ) t ON t.patid =
         d.patid
-        <where>
-            d.del_flag != 1
+        WHERE 1=1
+
+            AND d.del_flag != 1
             AND a.del_flag != 1
             and d.orgid = #{orgid}
             <if test="name != null  and name != ''">and a.name like concat('%', #{name}, '%')</if>
@@ -975,28 +982,28 @@
             <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size()>0">
                 AND d.leavehospitaldistrictcode IN
                 <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
-                         close=")">
+                         AND close=")">
                     #{leavehospitaldistrictcode}
                 </foreach>
             </if>
             <if test="leaveldeptcodes != null and leaveldeptcodes.size() > 0">
                 AND d.leaveldeptcode IN
                 <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
-                         close=")">
+                         AND close=")">
                     #{leaveldeptcode}
                 </foreach>
             </if>
             <if test="hospitaldistrictcodes != null and hospitaldistrictcodes.size()>0">
                 AND d.hospitaldistrictcode IN
                 <foreach collection="hospitaldistrictcodes" item="hospitaldistrictcode" open="(" separator=","
-                         close=")">
+                         AND close=")">
                     #{hospitaldistrictcode}
                 </foreach>
             </if>
             <if test="deptcodes != null and deptcodes.size() > 0">
                 AND d.deptcode IN
                 <foreach collection="deptcodes" item="deptcode" open="(" separator=","
-                         close=")">
+                         AND close=")">
                     #{deptcode}
                 </foreach>
             </if>
@@ -1010,7 +1017,7 @@
             <if test="isFilter == true">
                 AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid)
             </if>
-        </where>
+        
         <if test="pageSize != null  and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if>
         ) as tmp
     </select>
@@ -1066,8 +1073,9 @@
         LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid
         ) t ON t.patid =
         d.patid
-        <where>
-            d.del_flag != 1
+        WHERE 1=1
+
+            AND d.del_flag != 1
             AND a.del_flag != 1
             and d.orgid = #{orgid}
             <if test="pid != null  and pid != ''">and a.id = #{pid}</if>
@@ -1107,7 +1115,7 @@
             <if test="isFilter == true">
                 AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid)
             </if>
-        </where>
+        
         <if test="pageSize != null  and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if>
     </select>
 
@@ -1162,8 +1170,9 @@
         LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid
         ) t ON t.patid =
         d.patid
-        <where>
-            d.del_flag != 1
+        WHERE 1=1
+
+            AND d.del_flag != 1
             AND a.del_flag != 1
             and d.orgid = #{orgid}
             <if test="pid != null  and pid != ''">and a.id = #{pid}</if>
@@ -1201,7 +1210,7 @@
             <if test="isFilter == true">
                 AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid)
             </if>
-        </where>
+        
         -- order by a.update_time desc
         <if test="pageSize != null  and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if>
     </select>

--
Gitblit v1.9.3