From 44f9b71dc492f1e60f33d18bc8d3c619da44618e Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期二, 24 十一月 2026 17:19:26 +0800
Subject: [PATCH] Merge branch 'smartor_ls_merge' into 20261118市一随访
---
ruoyi-task/src/main/resources/mapper/task/ServiceSubtaskMapper.xml | 209 +++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 183 insertions(+), 26 deletions(-)
diff --git a/ruoyi-task/src/main/resources/mapper/task/ServiceSubtaskMapper.xml b/ruoyi-task/src/main/resources/mapper/task/ServiceSubtaskMapper.xml
index 5a56e4d..fbf683c 100644
--- a/ruoyi-task/src/main/resources/mapper/task/ServiceSubtaskMapper.xml
+++ b/ruoyi-task/src/main/resources/mapper/task/ServiceSubtaskMapper.xml
@@ -111,6 +111,8 @@
<result property="diagType" column="diag_type"/>
<!-- 2026-11锛氶噸瑕佹�ф爣璁扮紪鐮侊紙鏃ラ棿鎵嬫湳/鏃ラ棿璇婄枟/鏃犫�︼級锛屽缓浠诲姟鏃跺彇鑷� pat_med_inhosp -->
<result property="importanceFlagCode" column="importance_flag_code"/>
+ <!-- 2026-11锛氱偣浣嶇紪鐮侊紝寤哄瓙浠诲姟鏃跺師鏍锋嫹鑷� service_task.point_location -->
+ <result property="pointLocation" column="point_location"/>
</resultMap>
<resultMap type="com.ruoyi.task.domain.ServiceSubtaskCount" id="ServiceSubtaskResult2">
@@ -247,6 +249,7 @@
deptcode,
deptname,
importance_flag_code,
+ point_location,
stop_state,
leavehospitaldistrictcode,
leavehospitaldistrictname,
@@ -283,21 +286,44 @@
鍏朵綑锛堝惈 delay 涓� 0 鎴� NULL銆佹垨宸茶秴鍑哄欢鏈熺獥鍙o級 -> 3 瓒呮椂瀹屾垚
finishtime 涓虹┖鏃剁敤 NOW() 鍏滃簳锛屼繚璇佸畬鎴愭椂涓�瀹氬啓鍏ョ姸鎬侊紱
base 涓虹┖锛坋ndtime / schedule / day_offset 缂哄け锛夋椂淇濇寔鍘熷�间笉瑕嗙洊銆� -->
+ <!-- 2026-11-16 淇锛�
+ MySQL 鐨� JOIN ... ON 鍙兘寮曠敤褰撳墠 JOIN 閲屽嚭鐜拌繃鐨勮〃锛屼笉鑳藉紩鐢ㄥ灞� UPDATE 鐨�
+ service_subtask锛涘師鍐欐硶 ON st.taskid = service_subtask.taskid 浼氭姤
+ Unknown column 'service_subtask.taskid' in 'on clause'銆�
+ 鐩稿叧鏍囬噺瀛愭煡璇㈢殑 WHERE 鍙互姝e父寮曠敤澶栧眰 UPDATE 琛岋紝鎵�浠ユ妸涓夊紶鍏宠仈琛ㄦ敼鎴�
+ 鏍囬噺瀛愭煡璇紱鍏宠仈涓嶅埌鏃惰繑鍥� NULL锛屼笌鍘熷厛 LEFT JOIN 鏈懡涓殑缁撴灉涓�鑷淬��
+ LIMIT 1 浠呯敤浜庡吋瀹� taskid / schedule_id 鐞嗚涓婁笉鍞竴鐨勫巻鍙叉暟鎹�� -->
<sql id="finishDeadlineExpr">
DATE_ADD(
CASE
- WHEN COALESCE(st.appltype, '') = '5' THEN
+ WHEN COALESCE((SELECT st.appltype
+ FROM service_task st
+ WHERE st.taskid = service_subtask.taskid
+ LIMIT 1), '') = '5' THEN
DATE_ADD(
- CASE sts.schedule_benchmark
+ CASE (SELECT sts.schedule_benchmark
+ FROM service_task_schedule sts
+ WHERE sts.id = service_subtask.schedule_id
+ LIMIT 1)
WHEN 1 THEN service_subtask.starttime
WHEN 2 THEN service_subtask.endtime
WHEN 3 THEN service_subtask.admindate
WHEN 4 THEN service_subtask.create_time
- ELSE sts.schedule_benchmark_custom_time
+ ELSE (SELECT sts.schedule_benchmark_custom_time
+ FROM service_task_schedule sts
+ WHERE sts.id = service_subtask.schedule_id
+ LIMIT 1)
END,
- INTERVAL std.day_offset DAY)
+ INTERVAL (SELECT std.day_offset
+ FROM service_task_schedule_detail std
+ WHERE std.id = service_subtask.schedule_detail_id
+ LIMIT 1) DAY)
ELSE
- DATE_ADD(service_subtask.endtime, INTERVAL COALESCE(st.send_day, 1) DAY)
+ DATE_ADD(service_subtask.endtime,
+ INTERVAL COALESCE((SELECT st.send_day
+ FROM service_task st
+ WHERE st.taskid = service_subtask.taskid
+ LIMIT 1), 1) DAY)
END,
INTERVAL (COALESCE((SELECT SUM(CAST(COALESCE(NULLIF(TRIM(pf.compensate_time), ''), '0') AS SIGNED))
FROM service_subtask_preachform pf
@@ -305,31 +331,42 @@
</sql>
<sql id="finishStateExpr">
- COALESCE((
- SELECT
+ COALESCE(
CASE
WHEN <include refid="finishDeadlineExpr"/> IS NULL THEN NULL
WHEN COALESCE(#{finishtime,jdbcType=TIMESTAMP}, service_subtask.finishtime, NOW())
<= <include refid="finishDeadlineExpr"/>
THEN 1
- WHEN COALESCE(st.delay_finish_days, 0) > 0
+ WHEN COALESCE((SELECT st.delay_finish_days
+ FROM service_task st
+ WHERE st.taskid = service_subtask.taskid
+ LIMIT 1), 0) > 0
AND COALESCE(#{finishtime,jdbcType=TIMESTAMP}, service_subtask.finishtime, NOW())
<= DATE_ADD(<include refid="finishDeadlineExpr"/>,
- INTERVAL COALESCE(st.delay_finish_days, 0) DAY)
+ INTERVAL COALESCE((SELECT st.delay_finish_days
+ FROM service_task st
+ WHERE st.taskid = service_subtask.taskid
+ LIMIT 1), 0) DAY)
THEN 2
ELSE 3
END
- FROM (SELECT 1) dummy
- LEFT JOIN service_task st ON st.taskid = service_subtask.taskid
- LEFT JOIN service_task_schedule sts ON sts.id = service_subtask.schedule_id
- LEFT JOIN service_task_schedule_detail std ON std.id = service_subtask.schedule_detail_id
- LIMIT 1
- ), finish_state)
+ , finish_state)
</sql>
<!-- 褰撳墠鎵ц鏂瑰紡锛氶娆¢殢璁� current_preachform 涓虹┖鏃讹紝鍙� preachform 鐨勭涓�涓墽琛屾柟寮忓厹搴� -->
<sql id="effectiveCurrentPreachformExpr">
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"
@@ -725,22 +762,37 @@
<if test="hospType != null and hospType != ''">and hosp_type = #{hospType}</if>
<!--
2026-11锛氶噸瑕佹�ф爣璁扮瓫閫夛紙瀵瑰簲 service_subtask.importance_flag_code锛屽缓浠诲姟鏃跺彇鑷�
- pat_med_inhosp.importance_flag_code锛夈�備袱绉嶅啓娉曪細
- 鈶� 绮剧‘鍗曞�� importanceFlagCode = 'FH0165.01'锛堟垨鎻忚堪鍙e緞 '鏃ラ棿鎵嬫湳'锛�
- 鈶� 绮剧‘澶氬�� importanceFlagCodes = ['FH0165.01','FH0165.02']
+ pat_med_inhosp.importance_flag_code锛夈��
+ 鈶� 妯$硦锛�/patItem 鐢ㄨ繖涓級 importanceFlagCode 鈫� LIKE '%鍊�%'
+ 浼犮�屾棩闂淬�嶅嵆鍙懡涓�屾棩闂存墜鏈�嶃�屾棩闂磋瘖鐤椼�嶃�屾棤,鏃ラ棿鎵嬫湳銆嶅鍊艰锛�
+ 浼犲畬鏁村�硷紙銆屾棩闂存墜鏈��/銆孎H0165.01銆嶏級閫�鍖栦负绮剧‘鍖归厤銆�
+ 鈶� 绮剧‘澶氬�� importanceFlagCodes 鈫� IN
璇ュ垪閲囬泦鏃跺氨琚嫾鎴�**鎻忚堪涓�**锛圛mportFlagEnum 鐨� desc锛夛紝澶氬�肩敤鑻辨枃閫楀彿鎷兼帴锛�
- 濡� '鏃�,鏃ラ棿鎵嬫湳'锛堣 ServiceSLTDHealthcareRecordServiceImpl#hospitalizedApply锛夆�斺��
- 绛夊��/IN 鍙懡涓崟鍊艰锛涘鍊艰锛堢幇鍦轰粎 7 鏉★紝閮藉湪鍑洪櫌璁板綍涓婏級瑕佺瓫鍏ㄩ渶鑷鍐�
- find_in_set銆備袱绉嶅彛寰勫苟瀛橈紙鏈夊簱瀛樻灇涓剧紪鐮併�佹湁搴撳瓨涓枃鎻忚堪锛夛紝浼犱粈涔堟寜浠�涔堢簿纭瘮锛�
+ 鎵�浠ャ�屾棩闂淬�嶈繖绫昏法鍙栧�兼煡璇㈠彧鑳介潬妯$硦锛涙弿杩颁笌 FH0165.xx 缂栫爜涓ょ鍙e緞閮芥寜鍘熷�兼瘮锛�
涓嶅仛鍊煎煙褰掍竴銆�
+ 鈿狅笍 鍚屼竴鏉′欢蹇呴』鍚屾鍔犲埌 countByCondition锛堝垪琛� total / 鍚勭姸鎬佺粺璁¤蛋閭f潯 SQL锛夛紝
+ 鍚﹀垯浼氬嚭鐜般�屽垪琛ㄧ瓫鍑� N 琛屻�佹�绘暟杩樻槸鍏ㄩ噺銆嶇殑閿欓厤銆�
-->
<if test="importanceFlagCode != null and importanceFlagCode != ''">
- and importance_flag_code = #{importanceFlagCode}
+ and importance_flag_code like concat('%', #{importanceFlagCode}, '%')
</if>
<if test="importanceFlagCodes != null and importanceFlagCodes.size() > 0">
AND importance_flag_code IN
<foreach collection="importanceFlagCodes" item="impFlagItem" open="(" separator="," close=")">
#{impFlagItem}
+ </foreach>
+ </if>
+ <!--
+ 2026-11锛氱偣浣嶇瓫閫夛紙瀵瑰簲 service_subtask.point_location锛屽缓瀛愪换鍔℃椂浠� service_task 蹇収杩囨潵锛夈��
+ 鍙湁涓�鏉� IN 鏉′欢锛氬崟閫�/澶氶�夐兘鍦� ServiceSubtaskEntity#getPointLocations() 閲屽綊涓�
+ 锛堝彧浼� pointLocation 浼氳嚜鍔ㄥ寘鎴愬崟鍏冪礌闆嗗悎锛夛紝鎵�浠ヤ笉鍐嶅啓绛夊�煎垎鏀��
+ 鈿狅笍 鍚屼竴鏉′欢蹇呴』鍚屾鍔犲埌 countByCondition锛堝垪琛� total / 鍚勭姸鎬佺粺璁¤蛋閭f潯 SQL锛夛紝
+ 鍚﹀垯浼氬嚭鐜般�屽垪琛ㄧ瓫鍑� N 琛屻�佹�绘暟杩樻槸鍏ㄩ噺銆嶇殑閿欓厤銆�
+ -->
+ <if test="pointLocations != null and pointLocations.size() > 0">
+ AND point_location IN
+ <foreach collection="pointLocations" item="pointLocItem" open="(" separator="," close=")">
+ #{pointLocItem}
</foreach>
</if>
<if test="libtemplateid != null ">and libtemplateid = #{libtemplateid}</if>
@@ -1216,6 +1268,8 @@
<if test="deptname != null and deptname != ''">deptname,</if>
<!-- 2026-11锛氶噸瑕佹�ф爣璁扮紪鐮侊紙鏃ラ棿鎵嬫湳/鏃ラ棿璇婄枟鈥︼級锛屽缓浠诲姟鏃朵粠 pat_med_inhosp 鍚屾 -->
<if test="importanceFlagCode != null and importanceFlagCode != ''">importance_flag_code,</if>
+ <!-- 2026-11锛氱偣浣嶇紪鐮侊紝寤哄瓙浠诲姟鏃朵粠 service_task.point_location 鍚屾 -->
+ <if test="pointLocation != null and pointLocation != ''">point_location,</if>
<if test="labelstatus != null">labelstatus,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
@@ -1326,6 +1380,7 @@
<if test="deptcode != null and deptcode != ''">#{deptcode},</if>
<if test="deptname != null and deptname != ''">#{deptname},</if>
<if test="importanceFlagCode != null and importanceFlagCode != ''">#{importanceFlagCode},</if>
+ <if test="pointLocation != null and pointLocation != ''">#{pointLocation},</if>
<if test="labelstatus != null">#{labelstatus},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
@@ -1473,6 +1528,11 @@
<if test="openid != null ">openid = #{openid},</if>
<if test="longSendTime != null ">long_send_time = #{longSendTime},</if>
<if test="sendstate != null ">sendstate = #{sendstate},</if>
+ <!-- 瀹屾垚鏃堕棿涓嶅彉閲忥紙2026-11锛夛細鐘舵�佷竴鏃︿笉鏄�"瀹屾垚(6)"锛屽氨鏄惧紡娓呯┖瀹屾垚鏃堕棿涓庡畬鎴愭椂鐘舵�併��
+ 涓婇潰 finishtime 閭d竴娈垫槸 if(finishtime != null)锛屼紶 null 浼氳鏁存璺宠繃锛�
+ 鎵�浠�"娓呯┖"蹇呴』鍦ㄨ繖閲岀敤 SQL 鐨� NULL 鍐欏嚭鏉ワ紱鍚﹀垯 3 宸插彂閫� / 5 鍙戦�佸け璐� / 7 瓒呮椂
+ 鐨勮浼氫竴鐩村甫鐫�鍘嗗彶瀹屾垚鏃堕棿锛�"瓒呮椂鍗存湁瀹屾垚鏃堕棿銆佸強鏃剁巼铏氶珮"灏辨槸杩欎箞鏉ョ殑锛夈�� -->
+ <if test="sendstate != null and sendstate != 6">finishtime = NULL, finish_state = NULL,</if>
<if test="sendstate != null and sendstate == 6">finish_state = <include refid="finishStateExpr"/>,</if>
<if test="serviceType != null ">service_type = #{serviceType},</if>
<if test="score != null ">score = #{score},</if>
@@ -1519,6 +1579,8 @@
<if test="scheduleSeq != null ">schedule_seq = #{scheduleSeq},</if>
<if test="loopCount != null ">loop_count = #{loopCount},</if>
<if test="isManuallyCalled != null ">is_manually_called = #{isManuallyCalled},</if>
+ <!-- 2026-11锛氱偣浣嶇紪鐮侊紙寤哄瓙浠诲姟鏃剁殑蹇収锛涗换鍔′笂鏀圭偣浣嶄笉浼氳嚜鍔ㄥ洖鍐欙級 -->
+ <if test="pointLocation != null and pointLocation != ''">point_location = #{pointLocation},</if>
</trim>
where id = #{id}
</update>
@@ -1598,6 +1660,11 @@
<if test="openid != null ">openid = #{openid},</if>
<if test="longSendTime != null ">long_send_time = #{longSendTime},</if>
<if test="sendstate != null ">sendstate = #{sendstate},</if>
+ <!-- 瀹屾垚鏃堕棿涓嶅彉閲忥紙2026-11锛夛細鐘舵�佷竴鏃︿笉鏄�"瀹屾垚(6)"锛屽氨鏄惧紡娓呯┖瀹屾垚鏃堕棿涓庡畬鎴愭椂鐘舵�併��
+ 涓婇潰 finishtime 閭d竴娈垫槸 if(finishtime != null)锛屼紶 null 浼氳鏁存璺宠繃锛�
+ 鎵�浠�"娓呯┖"蹇呴』鍦ㄨ繖閲岀敤 SQL 鐨� NULL 鍐欏嚭鏉ワ紱鍚﹀垯 3 宸插彂閫� / 5 鍙戦�佸け璐� / 7 瓒呮椂
+ 鐨勮浼氫竴鐩村甫鐫�鍘嗗彶瀹屾垚鏃堕棿锛�"瓒呮椂鍗存湁瀹屾垚鏃堕棿銆佸強鏃剁巼铏氶珮"灏辨槸杩欎箞鏉ョ殑锛夈�� -->
+ <if test="sendstate != null and sendstate != 6">finishtime = NULL, finish_state = NULL,</if>
<if test="sendstate != null and sendstate == 6">finish_state = <include refid="finishStateExpr"/>,</if>
<if test="serviceType != null ">service_type = #{serviceType},</if>
<if test="score != null ">score = #{score},</if>
@@ -1656,6 +1723,11 @@
<if test="sex != null">sex = #{sex},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="sendstate != null ">sendstate = #{sendstate},</if>
+ <!-- 瀹屾垚鏃堕棿涓嶅彉閲忥紙2026-11锛夛細鐘舵�佷竴鏃︿笉鏄�"瀹屾垚(6)"锛屽氨鏄惧紡娓呯┖瀹屾垚鏃堕棿涓庡畬鎴愭椂鐘舵�併��
+ 涓婇潰 finishtime 閭d竴娈垫槸 if(finishtime != null)锛屼紶 null 浼氳鏁存璺宠繃锛�
+ 鎵�浠�"娓呯┖"蹇呴』鍦ㄨ繖閲岀敤 SQL 鐨� NULL 鍐欏嚭鏉ワ紱鍚﹀垯 3 宸插彂閫� / 5 鍙戦�佸け璐� / 7 瓒呮椂
+ 鐨勮浼氫竴鐩村甫鐫�鍘嗗彶瀹屾垚鏃堕棿锛�"瓒呮椂鍗存湁瀹屾垚鏃堕棿銆佸強鏃剁巼铏氶珮"灏辨槸杩欎箞鏉ョ殑锛夈�� -->
+ <if test="sendstate != null and sendstate != 6">finishtime = NULL, finish_state = NULL,</if>
<if test="sendstate != null and sendstate == 6">finish_state = <include refid="finishStateExpr"/>,</if>
<if test="age != null">age = #{age},</if>
<if test="sfzh != null">sfzh = #{sfzh},</if>
@@ -1769,6 +1841,11 @@
<if test="phone != null">phone = #{phone},</if>
<if test="sex != null">sex = #{sex},</if>
<if test="sendstate != null ">sendstate = #{sendstate},</if>
+ <!-- 瀹屾垚鏃堕棿涓嶅彉閲忥紙2026-11锛夛細鐘舵�佷竴鏃︿笉鏄�"瀹屾垚(6)"锛屽氨鏄惧紡娓呯┖瀹屾垚鏃堕棿涓庡畬鎴愭椂鐘舵�併��
+ 涓婇潰 finishtime 閭d竴娈垫槸 if(finishtime != null)锛屼紶 null 浼氳鏁存璺宠繃锛�
+ 鎵�浠�"娓呯┖"蹇呴』鍦ㄨ繖閲岀敤 SQL 鐨� NULL 鍐欏嚭鏉ワ紱鍚﹀垯 3 宸插彂閫� / 5 鍙戦�佸け璐� / 7 瓒呮椂
+ 鐨勮浼氫竴鐩村甫鐫�鍘嗗彶瀹屾垚鏃堕棿锛�"瓒呮椂鍗存湁瀹屾垚鏃堕棿銆佸強鏃剁巼铏氶珮"灏辨槸杩欎箞鏉ョ殑锛夈�� -->
+ <if test="sendstate != null and sendstate != 6">finishtime = NULL, finish_state = NULL,</if>
<if test="sendstate != null and sendstate == 6">finish_state = <include refid="finishStateExpr"/>,</if>
<if test="age != null">age = #{age},</if>
<if test="sfzh != null">sfzh = #{sfzh},</if>
@@ -2064,10 +2141,28 @@
where 1=1
and a.del_flag = '0'
and b.del_flag = '0'
- and a.appltype = '3'
+ <!-- 涓撶梾缁熻锛氬崟鐥呯浠诲姟(appltype=3) + 涓撶梾浠诲姟缁�(appltype=5) -->
+ and (
+ a.appltype = '3'
+ or (
+ a.appltype = '5'
+ and (
+ a.hosp_type = '3'
+ or (a.diag_type is not null and a.diag_type <> '')
+ or exists (
+ select 1
+ from service_task_schedule s
+ where s.taskid = a.taskid
+ and s.del_flag = '0'
+ and s.icd10_codes is not null
+ and s.icd10_codes <> ''
+ )
+ )
+ )
+ )
<if test="orgid != null and orgid != ''">and a.orgid = #{orgid}</if>
<if test="campusid != null and campusid != ''">and b.campusid = #{campusid}</if>
- <if test="taskId != null">and a.task_id = #{taskId}</if>
+ <if test="taskId != null">and a.taskid = #{taskId}</if>
<if test="taskName != null and taskName != ''">
and a.task_name like concat('%', #{taskName}, '%')
</if>
@@ -2075,7 +2170,7 @@
and a.diag_type = #{diagType}
</if>
<if test="taskIds != null and taskIds.size() > 0">
- AND a.task_id IN
+ AND a.taskid IN
<foreach collection="taskIds" item="taskIdItem" open="(" separator=","
close=")">
#{taskIdItem}
@@ -2807,8 +2902,51 @@
</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 != ''">
@@ -3711,6 +3849,25 @@
<if test="sendname != null and sendname != ''">
AND sendname LIKE CONCAT('%', #{sendname}, '%')
</if>
+ <!--
+ 2026-11锛氶噸瑕佹�ф爣璁版ā绯婄瓫閫� 鈥斺�� 蹇呴』涓� serviceSubtaskWhere 閲岀殑鍚屽悕鏉′欢銆愬畬鍏ㄤ竴鑷淬�戯紝
+ 鍚﹀垯 /patItem 鐨勫垪琛ㄤ笌 total/鍚勭姸鎬佺粺璁′細閿欓厤锛堝垪琛ㄧ瓫浜嗐�佹�绘暟娌$瓫锛夈��
+ 鍙e緞瑙� serviceSubtaskWhere 澶勭殑娉ㄩ噴銆�
+ -->
+ <if test="importanceFlagCode != null and importanceFlagCode != ''">
+ AND importance_flag_code LIKE CONCAT('%', #{importanceFlagCode}, '%')
+ </if>
+ <!--
+ 2026-11锛氱偣浣嶇瓫閫� 鈥斺�� 蹇呴』涓� serviceSubtaskWhere 閲岀殑鍚屽悕鏉′欢銆愬畬鍏ㄤ竴鑷淬�戯紝
+ 鍚﹀垯 /patItem 鐨勫垪琛ㄤ笌 total/鍚勭姸鎬佺粺璁′細閿欓厤锛堝垪琛ㄧ瓫浜嗐�佹�绘暟娌$瓫锛夈��
+ 鍗曢��/澶氶�夊綊涓�鍦� ServiceSubtaskEntity#getPointLocations()锛岃繖閲屽彧鏈変竴鏉� IN銆�
+ -->
+ <if test="pointLocations != null and pointLocations.size() > 0">
+ AND point_location IN
+ <foreach collection="pointLocations" item="pointLocItem" open="(" separator="," close=")">
+ #{pointLocItem}
+ </foreach>
+ </if>
<if test="phone != null and phone != ''">
AND phone = #{phone}
</if>
--
Gitblit v1.9.3