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/ServiceSubtaskMapper.xml |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
index 9c943e6..0742f40 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -211,6 +211,7 @@
 
         <include refid="selectServiceSubtaskVo"/>
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
             AND del_flag=0
             <if test="taskid != null ">and taskid = #{taskid}</if>
@@ -230,6 +231,7 @@
             resultMap="ServiceSubtaskResult">
         <include refid="selectServiceSubtaskVo"/>
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
             AND del_flag=0
             <if test="taskid != null ">and taskid = #{taskid}</if>
@@ -246,6 +248,7 @@
             resultMap="ServiceSubtaskResult">
         <include refid="selectServiceSubtaskVo"/>
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
             AND del_flag=0
             <if test="sendname != null  and sendname != ''">and sendname like concat('%', #{sendname}, '%')</if>
@@ -279,8 +282,8 @@
             <if test="type != null  and type != ''">and type = #{type}</if>
             <if test="taskid != null ">and taskid = #{taskid}</if>
             <if test="templateid != null  and templateid != ''">and templateid = #{templateid}</if>
-            <if test="templatename != null  and templatename != ''">and templatename like concat('%', #{templatename},
-                AND '%')
+            <if test="templatename != null  and templatename != ''">
+                and templatename like concat('%', #{templatename},'%')
             </if>
             <if test="startOutHospTime != null">
                 AND date_format(endtime,'%y%m%d') &gt;= date_format(#{startOutHospTime},'%y%m%d')
@@ -415,6 +418,7 @@
             resultMap="ServiceSubtaskResult">
         <include refid="selectServiceSubtaskVo"/>
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
             AND del_flag=0
             <if test="visitTime != null">
@@ -430,6 +434,7 @@
             resultMap="ServiceSubtaskResult">
         <include refid="selectServiceSubtaskVo"/>
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
             and del_flag=0
             <if test="createStartTime != null  and createEndTime != null">
             and create_time BETWEEN #{createStartTime} AND #{createEndTime}
@@ -454,6 +459,7 @@
             resultMap="ServiceSubtaskResult">
         <include refid="selectServiceSubtaskVo"/>
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
             AND del_flag=0
             and upid is not null
             and visit_count > 1
@@ -510,6 +516,7 @@
         from service_task a
         JOIN service_subtask b on a.taskid = b.taskid and a.pat_cycle = 0 and b.del_flag = 0
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 AND b.taskid = #{taskid}
             and b.patid = #{patid}
             <if test="createTime != null and createTime != ''">
@@ -552,6 +559,7 @@
             resultMap="ServiceSubtaskResult">
         <include refid="selectServiceSubtaskVo"/>
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
             AND id in (
             AND SELECT id FROM
@@ -960,6 +968,7 @@
             <if test="isabnormal != null">isabnormal=#{isabnormal},</if>
         </trim>
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
             <if test="patid != null ">and patid = #{patid}</if>
             <if test="taskid != null ">and taskid = #{taskid}</if>
@@ -1169,6 +1178,7 @@
             resultMap="ServiceSubtaskResult">
         <include refid="selectServiceSubtaskVo"/>
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
             AND del_flag=0
             <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
@@ -1210,6 +1220,7 @@
         FROM service_subtask_detail a
         WHERE sub_id IN(SELECT id FROM service_subtask t
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
             AND del_flag=0
             <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
@@ -1253,6 +1264,7 @@
         SELECT targetname joyName,
         (select COUNT(sub_id) FROM service_subtask_detail WHERE sub_id IN(SELECT id FROM service_subtask t
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
             AND del_flag=0
             <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
@@ -1284,6 +1296,7 @@
         ) AND targetid=a.id) joyCount , (SELECT COUNT(*) from (select sub_id FROM service_subtask_detail
         WHERE sub_id IN(SELECT id FROM service_subtask t
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
             AND del_flag=0
             <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">AND
@@ -1331,6 +1344,7 @@
         FROM service_subtask_detail a
         INNER JOIN service_subtask t ON a.sub_id = t.id
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
             AND a.del_flag=0
             AND t.del_flag=0
@@ -1457,6 +1471,7 @@
         service_subtask_detail ssd
         INNER JOIN service_subtask ss ON ssd.sub_id = ss.id
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
             AND ss.del_flag=0
             AND IFNULL(ssd.matchedtext,ssd.asrtext) IS NOT NULL
@@ -1851,6 +1866,7 @@
         SUM(CASE WHEN excep IS NOT NULL AND excep != '0' THEN 1 ELSE 0 END) AS yc
         FROM service_subtask
         WHERE 1=1
+            <if test="orgid != null and orgid != ''"> and orgid = #{orgid}</if>
 
             AND del_flag = 0
             <if test="sendname != null and sendname != ''">

--
Gitblit v1.9.3