From 664a2be2c744123181f9dda3a21f026bcb9f5692 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期三, 22 四月 2026 09:47:11 +0800
Subject: [PATCH] 【丽水】获取随访及时率 增加serviceType

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

diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
index c831868..1c33426 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -344,8 +344,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=")">
@@ -355,14 +356,15 @@
             <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>
         <if test="deptOrDistrict==3">
+            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=")">
@@ -370,17 +372,19 @@
                 </foreach>
             </if>
             <if test=" visitDeptCodes != null and visitDeptCodes.size()>0">
-                and visit_dept_code IN
+                AND visit_dept_code IN
                 <foreach collection="visitDeptCodes" item="visitDeptCode" open="(" separator=","
-                         close="))">
+                         close=")">
                     #{visitDeptCode}
                 </foreach>
             </if>
+            )
         </if>
 
         <if test="deptOrDistrict==4">
+            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=")">
@@ -390,10 +394,11 @@
             <if test=" visitDeptCodes != null and visitDeptCodes.size()>0">
                 OR visit_dept_code IN
                 <foreach collection="visitDeptCodes" item="visitDeptCode" open="(" separator=","
-                         close="))">
+                         close=")">
                     #{visitDeptCode}
                 </foreach>
             </if>
+            )
         </if>
 
         <if test="visitTime != null">
@@ -641,6 +646,8 @@
             AND date_format(visit_time,'%y%m%d') &lt;= date_format(#{endtime},'%y%m%d')
         </if>
         <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
+        <if test="serviceType != null and serviceType != ''">and service_type = #{serviceType}</if>
+        <if test="serviceTypes != null and serviceTypes != ''">and service_type IN (#{serviceTypes})</if>
         <if test="deptcode != null  and deptcode != ''">and deptcode = #{deptcode}</if>
         <if test="deptname != null  and deptname != ''">and deptname = #{deptname}</if>
         <if test="isabnormal != null">and isabnormal = #{isabnormal}</if>
@@ -720,6 +727,8 @@
             AND date_format(visit_time,'%y%m%d') &lt;= date_format(#{endtime},'%y%m%d')
         </if>
         <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
+        <if test="serviceType != null and serviceType != ''">and service_type = #{serviceType}</if>
+        <if test="serviceTypes != null and serviceTypes != ''">and service_type IN (#{serviceTypes})</if>
         <if test="isabnormal != null ">and isabnormal = #{isabnormal}</if>
         <if test="deptcode != null  and deptcode != ''">and deptcode = #{deptcode}</if>
         <if test="deptname != null  and deptname != ''">and deptname = #{deptname}</if>

--
Gitblit v1.9.3