From 0a164b25c99e3779c64b61ba248b1e809bd15014 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期三, 19 八月 2026 16:33:12 +0800
Subject: [PATCH] 【丽水】patItem 传离院病区+随访科室报错

---
 smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
index eb75f99..0ecb913 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -506,10 +506,10 @@
         <if test="isVisitAgain != null">and is_visit_again = #{isVisitAgain}</if>
         <if test="visitCount != null and visitCount > 1 and visitDeptCodes != null and visitDeptCodes.size() > 0">
             AND visit_dept_code IN
-            <foreach collection="visitDeptCodes" item="visitDeptCodes" open="("
+            <foreach collection="visitDeptCodes" item="visitDeptCode" open="("
                      separator=","
                      close=")">
-                #{visitDeptCodes}
+                #{visitDeptCode}
             </foreach>
         </if>
         <if test="sort != null  and sort==0">order by endtime asc</if>
@@ -2559,8 +2559,9 @@
             </if>
         </if>
         <if test="deptOrDistrict==2">
+            AND (1=1
             <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
-                AND (leavehospitaldistrictcode IN
+                AND leavehospitaldistrictcode IN
                 <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="("
                          separator=","
                          close=")">
@@ -2570,17 +2571,18 @@
             <if test=" leaveldeptcodes != null and leaveldeptcodes.size()>0">
                 OR deptcode IN
                 <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
-                         close="))">
+                         close=")">
                     #{leaveldeptcode}
                 </foreach>
             </if>
+            )
         </if>
         <if test="visitCount != null and visitCount > 1 and visitDeptCodes != null and visitDeptCodes.size() > 0">
             AND visit_dept_code IN
-            <foreach collection="visitDeptCodes" item="visitDeptCodes" open="("
+            <foreach collection="visitDeptCodes" item="visitDeptCode" open="("
                      separator=","
                      close=")">
-                #{visitDeptCodes}
+                #{visitDeptCode}
             </foreach>
         </if>
         <if test="leavehospitaldistrictname != null and leavehospitaldistrictname != ''">

--
Gitblit v1.9.3