From 27df1079c1d230fab29f565f5209f2a02e0def8a Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期一, 20 七月 2026 16:56:51 +0800
Subject: [PATCH] 省立同德的功能

---
 smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml |   60 +++++++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 37 insertions(+), 23 deletions(-)

diff --git a/smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml
index 8d227ba..ef03c5f 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml
@@ -389,20 +389,34 @@
         <if test="leavehospitaldistrictname != null  ">and service_task.leavehospitaldistrictname =
             #{leavehospitaldistrictname}
         </if>
-        <if test="leavehospitaldistrictcodes!=null and leavehospitaldistrictcodes.size()>0">
-            AND service_task.leavehospitaldistrictcode IN
-            <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
-                     close=")">
-                #{leavehospitaldistrictcode}
-            </foreach>
-        </if>
-        <if test="leaveldeptcodes!=null and leaveldeptcodes.size()>0">
-            AND service_task.deptcode IN
-            <foreach collection="leaveldeptcodes" item="deptcode" open="(" separator=","
-                     close=")">
-                #{deptcode}
-            </foreach>
-        </if>
+        <choose>
+            <when test="(leavehospitaldistrictcodes!=null and leavehospitaldistrictcodes.size()>0) and (leaveldeptcodes!=null and leaveldeptcodes.size()>0)">
+                AND (
+                    service_task.leavehospitaldistrictcode IN
+                    <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," close=")">
+                        #{leavehospitaldistrictcode}
+                    </foreach>
+                    OR service_task.deptcode IN
+                    <foreach collection="leaveldeptcodes" item="deptcode" open="(" separator="," close=")">
+                        #{deptcode}
+                    </foreach>
+                )
+            </when>
+            <otherwise>
+                <if test="leavehospitaldistrictcodes!=null and leavehospitaldistrictcodes.size()>0">
+                    AND service_task.leavehospitaldistrictcode IN
+                    <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," close=")">
+                        #{leavehospitaldistrictcode}
+                    </foreach>
+                </if>
+                <if test="leaveldeptcodes!=null and leaveldeptcodes.size()>0">
+                    AND service_task.deptcode IN
+                    <foreach collection="leaveldeptcodes" item="deptcode" open="(" separator="," close=")">
+                        #{deptcode}
+                    </foreach>
+                </if>
+            </otherwise>
+        </choose>
         <if test="leavehospitaldistrictcode != null  ">and service_task.leavehospitaldistrictcode =
             #{leavehospitaldistrictcode}
         </if>
@@ -531,21 +545,21 @@
     <update id="updateServiceTask" parameterType="com.smartor.domain.ServiceTask">
         update service_task
         <trim prefix="SET" suffixOverrides=",">
-            <if test="taskName != null">task_name = #{taskName},</if>
+            <if test="taskName != null and taskName != ''">task_name = #{taskName},</if>
             <if test="templateid != null">templateid = #{templateid},</if>
-            <if test="templatename != null">templatename = #{templatename},</if>
+            <if test="templatename != null and templatename != ''">templatename = #{templatename},</if>
             <if test="labelinfo != null">labelinfo = #{labelinfo},</if>
             <if test="count != null">count = #{count},</if>
             <if test="executed != null">executed = #{executed},</if>
             <if test="unexecuted != null">unexecuted = #{unexecuted},</if>
             <if test="fail != null">fail = #{fail},</if>
             <if test="checkuserid != null">checkuserid = #{checkuserid},</if>
-            <if test="checkusername != null">checkusername = #{checkusername},</if>
+            <if test="checkusername != null and checkusername != ''">checkusername = #{checkusername},</if>
             <if test="checktime != null">checktime = #{checktime},</if>
             <if test="type != null">type = #{type},</if>
             <if test="typename != null">typename = #{typename},</if>
-            <if test="deptcode != null">deptcode = #{deptcode},</if>
-            <if test="deptname != null">deptname = #{deptname},</if>
+            <if test="deptcode != null and deptcode != ''">deptcode = #{deptcode},</if>
+            <if test="deptname != null  and deptname != ''">deptname = #{deptname},</if>
             <if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
@@ -556,11 +570,11 @@
             <if test="orgid != null">orgid = #{orgid},</if>
             <if test="nexttaskflag != null">nexttaskflag = #{nexttaskflag},</if>
             <if test="nexttaskid != null">nexttaskid = #{nexttaskid},</if>
-            <if test="nexttaskname != null">nexttaskname = #{nexttaskname},</if>
+            <if test="nexttaskname != null and nexttaskname!=''">nexttaskname = #{nexttaskname},</if>
             <if test="pid != null">pid = #{pid},</if>
             <if test="guid != null">guid = #{guid},</if>
             <if test="preachform != null">preachform = #{preachform},</if>
-            <if test="preachformDesc != null">preachform_desc = #{preachformDesc},</if>
+            <if test="preachformDesc != null and preachformDesc!=''">preachform_desc = #{preachformDesc},</if>
             <if test="sendType != null">send_type = #{sendType},</if>
             <if test="sendState != null">send_state = #{sendState},</if>
             <if test="hospType != null  and hospType != ''">hosp_type = #{hospType},</if>
@@ -578,9 +592,9 @@
             <if test="longTask != null  and longTask != ''">long_task = #{longTask},</if>
             <if test="kcb != null  and kcb != ''">kcb = #{kcb},</if>
             <if test="jsy != null  and jsy != ''">jsy = #{jsy},</if>
-            <if test="leavehospitaldistrictname != null  ">leavehospitaldistrictname = #{leavehospitaldistrictname},
+            <if test="leavehospitaldistrictname != null  and leavehospitaldistrictname != ''">leavehospitaldistrictname = #{leavehospitaldistrictname},
             </if>
-            <if test="leavehospitaldistrictcode != null  ">leavehospitaldistrictcode = #{leavehospitaldistrictcode},
+            <if test="leavehospitaldistrictcode != null  and leavehospitaldistrictcode != ''">leavehospitaldistrictcode = #{leavehospitaldistrictcode},
             </if>
             <if test="compensateDate != null  and compensateDate != ''">compensate_date = #{compensateDate},</if>
             <if test="sendDay != null  ">send_day = #{sendDay},</if>

--
Gitblit v1.9.3