From a408612ed9bb08aefec80b001bc53f686491c33c Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期五, 30 十月 2026 14:02:31 +0800
Subject: [PATCH] 【丽水】/smartor/serviceSubtask/getSfStatisticsHyperlink 和 /smartor/serviceSubtask/getSfStatistics 统计的时候,对于 service_subtask.current_preachForm 为空的数据 当成 service_subtask.preachform 字符串的第一个执行方式

---
 smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
index 53aefec..33fef15 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -1655,6 +1655,22 @@
         where patid = #{patid} and taskid = #{taskid}
     </update>
 
+    <!-- 浜哄伐闅忚锛氳蒋鍒犻櫎鎮h�呭嚭闄㈣褰曞搴旂殑鏈畬鎴愰殢璁夸换鍔� -->
+    <update id="deleteUnfinishedServiceSubtaskByInhospids">
+        update service_subtask
+        set del_flag = 1
+        where del_flag = 0
+          and patid = #{patid}
+          and sendstate in
+          <foreach collection="sendstates" item="sendstate" open="(" separator="," close=")">
+              #{sendstate}
+          </foreach>
+          and inhospid in
+          <foreach collection="inhospids" item="inhospid" open="(" separator="," close=")">
+              #{inhospid}
+          </foreach>
+    </update>
+
     <select id="getSfStatistics" parameterType="com.smartor.domain.ServiceSubtaskCountReq"
             resultMap="ServiceSubtaskResult">
         select id,
@@ -1672,7 +1688,7 @@
         deptname,
         sendstate,
         preachform,
-        current_preachform,
+        <include refid="effectiveCurrentPreachformExpr"/> AS current_preachform,
         excep,
         nurse_id,
         nurse_name,
@@ -1961,7 +1977,7 @@
         deptname,
         sendstate,
         preachform,
-        current_preachform,
+        <include refid="effectiveCurrentPreachformExpr"/> AS current_preachform,
         excep,
         nurse_id,
         nurse_name,
@@ -2062,7 +2078,7 @@
             </foreach>
         </if>
         <if test="currentPreachform != null">
-            AND current_preachform = #{currentPreachform}
+            AND <include refid="effectiveCurrentPreachformExpr"/> = #{currentPreachform}
             <if test="followUpCountStyle != null and followUpCountStyle = '1'">
                 AND sendstate != 4
             </if>

--
Gitblit v1.9.3