From 0ffdf00009b0bede0859fa33deddefb55c075a7b Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期日, 01 二月 2026 16:42:36 +0800
Subject: [PATCH] feat:优化增加任务同步接口,允许前端手动控制同步
---
ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml | 40 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 39 insertions(+), 1 deletions(-)
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml
index dd017b9..99faf07 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml
@@ -265,7 +265,6 @@
<if test="creatorId != null">#{creatorId},</if>
<if test="assigneeId != null">#{assigneeId},</if>
<if test="deptId != null">#{deptId},</if>
- <if test="isHeadPush != null">#{isHeadPush},</if>
<if test="createTime != null">#{createTime},</if>
now(),
<if test="createBy != null">#{createBy},</if>
@@ -345,4 +344,43 @@
#{taskId}
</foreach>
</delete>
+
+ <!-- 鏍规嵁鑱旂郴浜虹數璇濆拰鍒涘缓鏃ユ湡鏌ヨ浠诲姟鏁伴噺 -->
+ <select id="countTaskByPhoneAndDate" resultType="int">
+ select count(1)
+ from sys_task t
+ inner join sys_task_emergency e on t.task_id = e.task_id
+ where t.del_flag = '0'
+ and e.patient_phone = #{phone}
+ and DATE(t.create_time) = #{createDate}
+ </select>
+
+ <!-- 鏌ヨ杞﹁締鍦ㄦ寚瀹氭椂闂磋寖鍥村唴鐨勪换鍔″垪琛� -->
+ <select id="selectVehicleTasksInTimeRange" parameterType="map" resultMap="SysTaskResult">
+ select t.task_id, t.task_code, t.task_type, t.task_status,
+ t.departure_address, t.destination_address,
+ t.actual_start_time, t.actual_end_time,
+ t.planned_start_time, t.planned_end_time,
+ t.estimated_distance,
+ tv.vehicle_id
+ from sys_task t
+ inner join sys_task_vehicle tv on t.task_id = tv.task_id
+ where tv.vehicle_id = #{vehicleId}
+ and t.del_flag = '0'
+ and t.task_status not in ('CANCELLED')
+ and (
+ <!-- 瀹為檯鏃堕棿鏈夊�兼椂锛屼娇鐢ㄥ疄闄呮椂闂村垽鏂噸鍙� -->
+ (t.actual_start_time is not null and t.actual_end_time is not null
+ and t.actual_start_time <= #{endTime} and t.actual_end_time >= #{startTime})
+ or
+ <!-- 瀹為檯寮�濮嬫椂闂存湁鍊间絾鏈粨鏉熸椂锛屼娇鐢ㄥ綋鍓嶆椂闂翠綔涓虹粨鏉熸椂闂� -->
+ (t.actual_start_time is not null and t.actual_end_time is null
+ and t.actual_start_time <= #{endTime})
+ or
+ <!-- 瀹為檯鏃堕棿閮戒负绌烘椂锛屼娇鐢ㄨ鍒掓椂闂村垽鏂噸鍙� -->
+ (t.actual_start_time is null and t.actual_end_time is null
+ and t.planned_start_time <= #{endTime} and t.planned_end_time >= #{startTime})
+ )
+ order by t.actual_start_time, t.planned_start_time
+ </select>
</mapper>
--
Gitblit v1.9.1