From c0a1079e3a3fa41898e7d181007d89d2d3874926 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期二, 24 十一月 2026 16:23:04 +0800
Subject: [PATCH] 【丽水】规则配置了按首要次要,只要有第一个成功维度就停止了,现在全部生成
---
ruoyi-task/src/main/resources/mapper/task/ServiceSubtaskMapper.xml | 77 +++++++++++++++++++++++++++++---------
1 files changed, 59 insertions(+), 18 deletions(-)
diff --git a/ruoyi-task/src/main/resources/mapper/task/ServiceSubtaskMapper.xml b/ruoyi-task/src/main/resources/mapper/task/ServiceSubtaskMapper.xml
index 8d9ff97..d8a00c4 100644
--- a/ruoyi-task/src/main/resources/mapper/task/ServiceSubtaskMapper.xml
+++ b/ruoyi-task/src/main/resources/mapper/task/ServiceSubtaskMapper.xml
@@ -286,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
@@ -308,26 +331,26 @@
</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 鐨勭涓�涓墽琛屾柟寮忓厹搴� -->
@@ -2107,10 +2130,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>
@@ -2118,7 +2159,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}
--
Gitblit v1.9.3