From f3434f830cfee5838211e58a3a361c73f7166342 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期三, 22 七月 2026 10:30:48 +0800
Subject: [PATCH] 【丽水】外链测试接口

---
 smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml b/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
index b51c18d..f117ef1 100644
--- a/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
@@ -932,10 +932,9 @@
         d.leavehospitaldistrictcode AS leavehospitaldistrictcode
         FROM
         pat_med_inhosp d
-        JOIN pat_archive a ON a.id = d.patid
+        LEFT JOIN pat_archive a ON a.id = d.patid
         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>
             <if test="idcardno != null  and idcardno != ''">and a.idcardno = #{idcardno}</if>
@@ -1005,7 +1004,7 @@
             </if>
 
             <if test="pids != null">
-                AND a.id NOT IN
+                AND d.patid NOT IN
                 <foreach collection="pids" item="pid" open="(" separator="," close=")">
                     #{pid}
                 </foreach>
@@ -1201,12 +1200,10 @@
 
     <!-- 浣忛櫌鎮h�呮�绘暟缁熻锛堝幓閲嶏級 -->
     <select id="countPatArchiveInfoByInhospQC" parameterType="com.smartor.domain.PatArchiveReq" resultType="long">
-        SELECT COUNT(DISTINCT a.id)
+        SELECT COUNT(DISTINCT d.patid)
         FROM pat_med_inhosp d
-        JOIN pat_archive a ON a.id = d.patid
         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>
             <if test="idcardno != null  and idcardno != ''">AND a.idcardno = #{idcardno}</if>
@@ -1250,7 +1247,7 @@
                 </foreach>
             </if>
             <if test="pids != null">
-                AND a.id NOT IN
+                AND d.patid NOT IN
                 <foreach collection="pids" item="pid" open="(" separator="," close=")">
                     #{pid}
                 </foreach>

--
Gitblit v1.9.3