From 57e98ac3f59e9ca12d3fdbc6f89c9c0b1f86be4d Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期四, 05 二月 2026 00:49:10 +0800
Subject: [PATCH] feat:增加发票申请

---
 ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml |   49 ++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 44 insertions(+), 5 deletions(-)

diff --git a/ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml
index 6fb4112..99faf07 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml
@@ -35,7 +35,6 @@
         <result property="assigneeName"     column="assignee_name"     />
         <result property="deptName"         column="dept_name"         />
         <result property="vehicleNo"        column="vehicle_no"        />
-        <result property="isHeadPush"       column="is_head_push"      />
         <collection property="assignedVehicles" ofType="SysTaskVehicle">
             <result property="id"            column="tv_id"             />
             <result property="taskId"        column="tv_task_id"        />
@@ -58,7 +57,6 @@
                t.planned_start_time, t.planned_end_time,
                t.actual_start_time, t.actual_end_time, t.creator_id, t.assignee_id, t.dept_id,
                t.create_time, t.update_time, t.create_by, t.update_by, t.remark, t.del_flag, t.legacy_synced,
-               t.is_head_push,
                u1.nick_name as creator_name, u2.nick_name as assignee_name, d.dept_name,
                (
                    select v2.vehicle_no 
@@ -88,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)">
@@ -236,7 +239,6 @@
             <if test="creatorId != null">creator_id,</if>
             <if test="assigneeId != null">assignee_id,</if>
             <if test="deptId != null">dept_id,</if>
-            <if test="isHeadPush != null">is_head_push,</if>
             <if test="createTime != null">create_time,</if>
             update_time,
             <if test="createBy != null">create_by,</if>
@@ -263,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>
@@ -294,7 +295,6 @@
             <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="isHeadPush != null">is_head_push = #{isHeadPush},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="remark != null">remark = #{remark},</if>
@@ -344,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 &lt;= #{endTime} and t.actual_end_time &gt;= #{startTime})
+              or
+              <!-- 瀹為檯寮�濮嬫椂闂存湁鍊间絾鏈粨鏉熸椂锛屼娇鐢ㄥ綋鍓嶆椂闂翠綔涓虹粨鏉熸椂闂� -->
+              (t.actual_start_time is not null and t.actual_end_time is null 
+               and t.actual_start_time &lt;= #{endTime})
+              or
+              <!-- 瀹為檯鏃堕棿閮戒负绌烘椂锛屼娇鐢ㄨ鍒掓椂闂村垽鏂噸鍙� -->
+              (t.actual_start_time is null and t.actual_end_time is null
+               and t.planned_start_time &lt;= #{endTime} and t.planned_end_time &gt;= #{startTime})
+          )
+        order by t.actual_start_time, t.planned_start_time
+    </select>
 </mapper>

--
Gitblit v1.9.1