From ae478a3d5dab28dd598d39f27429e4a544b15ad2 Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期四, 25 十二月 2025 22:48:06 +0800
Subject: [PATCH] feat:已完成时,检查附件是否上传

---
 ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml
index 1b5cfbb..4fe1ac6 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml
@@ -86,6 +86,11 @@
             <if test="taskCode != null  and taskCode != ''"> and t.task_code like concat('%', #{taskCode}, '%')</if>
             <if test="taskType != null  and taskType != ''"> and t.task_type = #{taskType}</if>
             <if test="taskStatus != null  and taskStatus != ''"> and t.task_status = #{taskStatus}</if>
+            <if test="taskStatusList != null and taskStatusList != ''"> and t.task_status in 
+                <foreach collection="taskStatusList.split(',')" item="status" open="(" separator="," close=")">
+                    #{status}
+                </foreach>
+            </if>
             <if test="vehicleNo != null  and vehicleNo != ''"> and v.vehicle_no like concat('%', #{vehicleNo}, '%')</if>
             <!-- 缁煎悎鏌ヨ锛氬綋鍓嶇敤鎴锋墍鍦ㄦ満鏋� OR 褰撳墠鐢ㄦ埛鍒涘缓 OR 鍒嗛厤缁欏綋鍓嶇敤鎴� -->
             <if test="(creatorId != null and creatorId != 0) or (assigneeId != null and assigneeId != 0) or (deptId != null and deptId != 0) or (deptIds != null and deptIds.size() > 0)">
@@ -188,14 +193,13 @@
 
     <select id="selectTaskByVehicleIdAndDate" resultMap="SysTaskResult">
         select tv.task_id, t.actual_start_time,
-        IFNULL(t.actual_end_time, NOW()) as t.actual_end_time
+        IFNULL(t.actual_end_time, NOW()) as actual_end_time
         from sys_task_vehicle tv
         inner join sys_task t on tv.task_id = t.task_id
         where tv.vehicle_id = #{vehicleId}
         and t.del_flag = '0'
         and (
-        (t.actual_end_time is not null and t.actual_start_time > #{startTime} and t.actual_end_time &lt; #{endTime} )
-        or (t.actual_end_time is null and t.actual_start_time > ${endTime} )
+        (t.actual_start_time &lt;= #{endTime} and (t.actual_end_time is null or t.actual_end_time &gt;= #{startTime}))
         )
         order by t.actual_start_time
     </select>
@@ -290,7 +294,6 @@
             <if test="actualEndTime != null">actual_end_time = #{actualEndTime},</if>
             <if test="creatorId != null">creator_id = #{creatorId},</if>
             <if test="assigneeId != null">assignee_id = #{assigneeId},</if>
-
             <if test="deptId != null">dept_id = #{deptId},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
@@ -341,4 +344,14 @@
             #{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>
 </mapper>

--
Gitblit v1.9.1