wlzboy
2025-11-29 364adbc9a93a396b74e154f910c2a0a72bfb1a0f
ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml
@@ -124,7 +124,7 @@
    <select id="selectMaxTaskCodeByDatePrefix" parameterType="String" resultType="String">
        select max(task_code) 
        from sys_task 
        where task_code like concat(#{datePrefix}, '%') and del_flag = '0'
        where task_code like concat(#{datePrefix}, '%')
    </select>
    <select id="selectOverdueTasks" resultMap="SysTaskResult">
@@ -268,6 +268,19 @@
        where task_id = #{taskId}
    </update>
    <select id="selectActiveTasksByVehicleId" parameterType="Long" resultMap="SysTaskResult">
        select t.task_id, t.task_code, t.task_type, t.task_status, t.task_description,
               t.departure_address, t.destination_address,
               t.planned_start_time, t.actual_start_time,
               t.create_time, t.update_time
        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 ('PENDING', 'COMPLETED', 'CANCELLED')
        order by t.create_time desc
    </select>
    <delete id="deleteSysTaskByTaskId" parameterType="Long">
        update sys_task set del_flag = '2', update_time = now() where task_id = #{taskId}
    </delete>