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/PatMedOuthospMapper.xml |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml
index 2034557..27aedda 100644
--- a/smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatMedOuthospMapper.xml
@@ -122,6 +122,7 @@
         pmo.mainsuit
         from pat_med_outhosp pmo
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
             AND pmo.del_flag=0
             <if test="orgid != null ">and pmo.orgid = #{orgid}</if>
@@ -129,12 +130,11 @@
             <if test="serverState != null ">and pmo.server_state = #{serverState}</if>
             <if test="hospitalname != null  and hospitalname != ''">and pmo.hospitalname like concat('%',
                 #{hospitalname},
-                AND '%')
+               '%')
             </if>
             <if test="deptcodes != null and deptcodes.size()>0">
                 AND pmo.deptcode IN
-                <foreach collection="deptcodes" item="deptcode" open="(" separator=","
-                         AND close=")">
+                <foreach collection="deptcodes" item="deptcode" open="(" separator="," close=")">
                     #{deptcode}
                 </foreach>
             </if>
@@ -462,6 +462,7 @@
         FROM
         pat_med_outhosp
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
             AND del_flag=0
             <if test="orgid != null">
@@ -483,6 +484,7 @@
         FROM
         service_subtask
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
             AND del_flag = 0
             and service_type=3
@@ -509,6 +511,7 @@
         SELECT deptname, COUNT(1) AS rc
         FROM pat_med_outhosp
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
             AND del_flag=0
             <if test="inhospstate != null">

--
Gitblit v1.9.3