From 38955eba4ef0e86bac6b1993b6b03abbbec2a929 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期三, 25 十一月 2026 17:55:06 +0800
Subject: [PATCH] Merge branch '20261118市一随访' into smartor_ls_merge
---
ruoyi-task/src/main/resources/mapper/task/ServiceSubtaskMapper.xml | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 55 insertions(+), 1 deletions(-)
diff --git a/ruoyi-task/src/main/resources/mapper/task/ServiceSubtaskMapper.xml b/ruoyi-task/src/main/resources/mapper/task/ServiceSubtaskMapper.xml
index ffc858d..b152872 100644
--- a/ruoyi-task/src/main/resources/mapper/task/ServiceSubtaskMapper.xml
+++ b/ruoyi-task/src/main/resources/mapper/task/ServiceSubtaskMapper.xml
@@ -358,6 +358,17 @@
COALESCE(NULLIF(TRIM(current_preachform), ''), TRIM(SUBSTRING_INDEX(preachform, ',', 1)))
</sql>
+ <!-- 绱鍙戦�佹柟寮忕粺璁$敤锛氬綊涓�鍖� preachform 椤哄簭锛堝幓绌烘牸銆佺粺涓�涓枃閫楀彿锛� -->
+ <sql id="normalizedPreachformExpr">
+ REPLACE(REPLACE(IFNULL(preachform, ''), ' ', ''), '锛�', ',')
+ </sql>
+
+ <!-- 绱鍙戦�佹柟寮忕粺璁$敤锛氬綊涓�鍖栧悗鐨勬湁鏁� current_preachform锛堜负绌烘椂鍙� preachform 绗竴涓級 -->
+ <sql id="normalizedEffectiveCurrentPreachformExpr">
+ COALESCE(NULLIF(TRIM(current_preachform), ''),
+ TRIM(SUBSTRING_INDEX(<include refid="normalizedPreachformExpr"/>, ',', 1)))
+ </sql>
+
<select id="selectServiceSubtaskBySendstate" parameterType="com.ruoyi.task.domain.entity.ServiceSubtaskEntity"
resultMap="ServiceSubtaskResult">
<include refid="selectServiceSubtaskVo"/>
@@ -2895,9 +2906,52 @@
</if>
<if test="currentPreachform != null and currentPreachform != '' ">
AND <include refid="effectiveCurrentPreachformExpr"/> = #{currentPreachform}
- <if test="followUpCountStyle != null and followUpCountStyle = '1'">
+ <!-- 娉ㄦ剰锛歄GNL 閲屽崟寮曞彿 '1' 鏄� Character锛孲tring 涓庝箣鐢� = 姣旇緝浼氬緱鍒伴潪 0 鏁板瓧锛堟亽鐪燂級锛屽繀椤荤敤 =="1" -->
+ <if test='followUpCountStyle != null and followUpCountStyle == "1"'>
AND sendstate != 4
</if>
+ <if test='followUpCountStyle != null and followUpCountStyle == "3"'>
+ AND sendstate = 6
+ </if>
+ </if>
+ <!--
+ 绱鍙戦�佹柟寮忎笅閽伙細
+ preachform 鏄墽琛岄『搴忥紙濡� 3,5,4,1锛夛紝current_preachform 鏄綋鍓嶆墽琛屽埌鐨勪綅缃��
+ 鑻ヨ鍦ㄢ�滆闊斥�濅笅閽伙紝鍒� current 浣嶄簬璇煶鍙婁箣鍚庣殑鎵�鏈夎閮借杩斿洖銆�
+ 浠ヤ笅鏉′欢涓� ServiceSubtaskServiceImpl#applyFirstCumulativePreachformStatistics 鍙e緞涓�鑷达細
+ current 涓虹┖ -> 鎸� preachform 绗竴涓柟寮�
+ current = -1 -> 鎸夋渶鍚庝竴涓綅缃紙鍏ㄩ儴鏂瑰紡閮借繘鍏ヨ繃锛�
+ current 涓嶅湪椤哄簭涓� -> 鍙仛绮剧‘鍖归厤鍏滃簳
+ -->
+ <if test="cumulativePreachform != null and cumulativePreachform != ''">
+ AND (
+ CASE
+ WHEN <include refid="normalizedPreachformExpr"/> = '' THEN
+ <include refid="normalizedEffectiveCurrentPreachformExpr"/> = #{cumulativePreachform}
+
+ WHEN <include refid="normalizedEffectiveCurrentPreachformExpr"/> = '-1' THEN
+ FIND_IN_SET(#{cumulativePreachform},
+ <include refid="normalizedPreachformExpr"/>) > 0
+
+ WHEN FIND_IN_SET(<include refid="normalizedEffectiveCurrentPreachformExpr"/>,
+ <include refid="normalizedPreachformExpr"/>) = 0 THEN
+ <include refid="normalizedEffectiveCurrentPreachformExpr"/> = #{cumulativePreachform}
+
+ ELSE
+ FIND_IN_SET(#{cumulativePreachform},
+ <include refid="normalizedPreachformExpr"/>) > 0
+ AND FIND_IN_SET(#{cumulativePreachform},
+ <include refid="normalizedPreachformExpr"/>)
+ <= FIND_IN_SET(<include refid="normalizedEffectiveCurrentPreachformExpr"/>,
+ <include refid="normalizedPreachformExpr"/>)
+ END
+ )
+ <if test='followUpCountStyle != null and followUpCountStyle == "1"'>
+ AND sendstate != 4
+ </if>
+ <if test='followUpCountStyle != null and followUpCountStyle == "3"'>
+ AND sendstate = 6
+ </if>
</if>
<if test="excep != null and excep != ''">
AND excep = #{excep}
--
Gitblit v1.9.3