新增待办过期和历史归档任务

This commit is contained in:
jsowell
2026-07-17 18:06:21 +08:00
parent 09d98eb18d
commit b6b052b9df
9 changed files with 229 additions and 0 deletions

View File

@@ -287,4 +287,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and del_flag = '0'
</update>
<update id="expireDueTasks">
update sys_todo_task
set task_status = 'EXPIRED',
completed_time = #{now},
active_idempotent_key = null,
update_by = #{updateBy},
update_time = #{now}
where task_status in ('PENDING', 'PROCESSING')
and due_time is not null
and due_time &lt;= #{now}
and del_flag = '0'
</update>
<update id="archiveTerminalTasks">
update sys_todo_task
set del_flag = '2',
active_idempotent_key = null,
update_by = #{updateBy},
update_time = sysdate()
where task_status in ('COMPLETED', 'CANCELLED', 'EXPIRED')
and coalesce(completed_time, update_time, create_time) &lt; #{archiveBefore}
and del_flag = '0'
</update>
</mapper>