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

---
 smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml |   28 ++++++++++++++++++++--------
 1 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
index 3f8270b..74fd713 100644
--- a/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
@@ -215,6 +215,7 @@
         LEFT JOIN
         pat_archivetag c ON c.patid = a.id AND (c.del_flag = 0 OR c.del_flag IS NULL)
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
             AND a.del_flag = 0
             AND b.del_flag = 0
@@ -231,12 +232,12 @@
             <if test="endInHospTime != null ">and date_format(b.starttime,'%y%m%d') &lt;=
                 AND date_format(#{endInHospTime},'%y%m%d')
             </if>
-            <if test="hospitalname != null  and hospitalname != ''">and hospitalname like concat('%', #{hospitalname},
-                AND '%')
+            <if test="hospitalname != null  and hospitalname != ''">
+                and hospitalname like concat('%', #{hospitalname},'%')
             </if>
             <if test="patname != null  and patname != ''">and patname like concat('%', #{patname}, '%')</if>
-            <if test="hospitaldistrictname != null  and hospitaldistrictname != ''">and hospitaldistrictname like
-                AND concat('%', #{hospitaldistrictname}, '%')
+            <if test="hospitaldistrictname != null  and hospitaldistrictname != ''">
+                and hospitaldistrictname like concat('%', #{hospitaldistrictname}, '%')
             </if>
             <if test="endtime != null ">and b.endtime = #{endtime}</if>
             <if test="managementDoctor != null ">and b.management_doctor = #{managementDoctor}</if>
@@ -373,6 +374,7 @@
         pat_med_inhosp b
 
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
             <if test="serialnum != null ">and b.serialnum = #{serialnum}</if>
 
@@ -451,19 +453,20 @@
         pat_med_inhosp b,
         pat_archive a
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
             AND a.del_flag=0
             and b.del_flag=0
             and a.id = b.patid
             AND a.idcardno != ''
-            <if test="hospitalname != null  and hospitalname != ''">and hospitalname like concat('%', #{hospitalname},
-                AND '%')
+            <if test="hospitalname != null  and hospitalname != ''">
+                and hospitalname like concat('%', #{hospitalname},'%')
             </if>
             <if test="managementDoctor != null ">and b.management_doctor = #{managementDoctor}</if>
             <if test="managementDoctorCode != null ">and b.management_doctor_code = #{managementDoctorCode}</if>
             <if test="patname != null  and patname != ''">and patname like concat('%', #{patname}, '%')</if>
-            <if test="hospitaldistrictname != null  and hospitaldistrictname != ''">and hospitaldistrictname like
-                AND concat('%', #{hospitaldistrictname}, '%')
+            <if test="hospitaldistrictname != null  and hospitaldistrictname != ''">
+                and hospitaldistrictname like concat('%', #{hospitaldistrictname}, '%')
             </if>
             <if test="endtime != null ">and b.endtime = #{endtime}</if>
             <if test="serialnum != null ">and b.serialnum = #{serialnum}</if>
@@ -861,6 +864,7 @@
             SELECT deptname
             FROM pat_med_outhosp
             WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
                 AND del_flag=0
                 <if test="deptcodeList != null   and deptcodeList.size() > 0">
@@ -878,6 +882,7 @@
             SELECT deptname
             FROM pat_med_inhosp
             WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
                 AND del_flag=0
                 and inhospstate=0
@@ -894,6 +899,7 @@
             SELECT deptname
             FROM pat_med_inhosp
             WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
                 AND del_flag=0
                 and inhospstate=1
@@ -910,6 +916,7 @@
             SELECT deptname
             FROM pat_med_inhosp
             WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
                 AND del_flag=0
                 and inhospstate=1
@@ -942,6 +949,7 @@
         FROM
         pat_med_inhosp
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
             AND del_flag=0
             <if test="orgid != null">
@@ -981,6 +989,7 @@
         FROM
         service_subtask
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
             AND del_flag = 0
             and service_type=2
@@ -1011,6 +1020,7 @@
         FROM
         service_subtask
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
             AND del_flag = 0
             and service_type=2
@@ -1042,6 +1052,7 @@
         FROM
         service_subtask
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
             AND del_flag = 0
             and service_type=2
@@ -1073,6 +1084,7 @@
         FROM
         service_subtask
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
             AND del_flag = 0
             and service_type=13

--
Gitblit v1.9.3