2026-03-10 08:29:37 +08:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
|
|
|
|
|
<mapper namespace="com.zcloud.eightwork.persistence.mapper.TaskLogMapper">
|
2026-04-02 17:37:23 +08:00
|
|
|
<select id="listPage" resultType="com.zcloud.eightwork.persistence.dataobject.TaskLogDO">
|
|
|
|
|
select task_log.*
|
|
|
|
|
from task_log
|
|
|
|
|
left join eightwork_info on task_log.work_id = eightwork_info.work_id
|
|
|
|
|
where eightwork_info.delete_enum = 'FALSE'
|
|
|
|
|
<if test="params.eqWorkType != null">
|
|
|
|
|
and task_log.work_type = #{params.eqWorkType}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="params.eqStatus != null">
|
|
|
|
|
and task_log.status = #{params.eqStatus}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="params.eqStepId != null">
|
|
|
|
|
and task_log.step_id = #{params.eqStepId}
|
|
|
|
|
</if>
|
|
|
|
|
and (task_log.act_user = #{params.userId}
|
|
|
|
|
or (task_log.act_user_department = #{params.departmentId}
|
|
|
|
|
and task_log.act_user is null))
|
|
|
|
|
order by task_log.create_time desc
|
|
|
|
|
</select>
|
2026-03-10 08:29:37 +08:00
|
|
|
|
|
|
|
|
<select id="getTodoCount" resultType="com.zcloud.eightwork.domain.model.TodoCountE">
|
2026-03-25 14:28:21 +08:00
|
|
|
select task_log.work_type,
|
2026-03-10 08:29:37 +08:00
|
|
|
count(1) as todoCount
|
2026-03-18 11:25:55 +08:00
|
|
|
from task_log
|
2026-03-25 14:28:21 +08:00
|
|
|
left join eightwork_info on task_log.work_id = eightwork_info.work_id
|
|
|
|
|
where task_log.status = 0
|
|
|
|
|
and eightwork_info.status != 0
|
2026-04-02 17:37:23 +08:00
|
|
|
and eightwork_info.delete_enum = 'FALSE'
|
|
|
|
|
and (task_log.act_user = #{userId}
|
|
|
|
|
or (task_log.act_user_department = #{orgId}
|
|
|
|
|
and task_log.act_user is null))
|
2026-03-25 14:28:21 +08:00
|
|
|
group by task_log.work_type
|
2026-03-10 08:29:37 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getTodoCountForWork" resultType="com.zcloud.eightwork.domain.model.TodoCountE">
|
2026-03-25 14:28:21 +08:00
|
|
|
select task_log.work_type,
|
|
|
|
|
task_log.step_id,
|
2026-03-10 08:29:37 +08:00
|
|
|
count(1) as todoCount
|
2026-03-18 11:25:55 +08:00
|
|
|
from task_log
|
2026-03-27 13:43:53 +08:00
|
|
|
left join eightwork_info on task_log.work_id = eightwork_info.work_id
|
2026-03-25 14:28:21 +08:00
|
|
|
where task_log.status = 0
|
|
|
|
|
and task_log.work_type = #{workType}
|
|
|
|
|
and eightwork_info.status != 0
|
2026-04-02 17:37:23 +08:00
|
|
|
and eightwork_info.delete_enum = 'FALSE'
|
2026-03-25 14:28:21 +08:00
|
|
|
and (task_log.act_user = #{userId}
|
2026-03-27 13:43:53 +08:00
|
|
|
or (task_log.act_user_department = #{orgId}
|
|
|
|
|
and task_log.act_user is null))
|
2026-03-25 14:28:21 +08:00
|
|
|
group by task_log.step_id
|
2026-03-10 08:29:37 +08:00
|
|
|
</select>
|
2026-03-13 08:29:06 +08:00
|
|
|
|
|
|
|
|
<select id="getByWorkIdAndStepId" resultType="com.zcloud.eightwork.persistence.dataobject.TaskLogDO">
|
|
|
|
|
select *
|
2026-03-18 11:25:55 +08:00
|
|
|
from task_log
|
2026-03-13 08:29:06 +08:00
|
|
|
where work_id = #{workId}
|
|
|
|
|
and step_id = #{stepId}
|
|
|
|
|
limit 1
|
|
|
|
|
</select>
|
2026-03-27 13:43:53 +08:00
|
|
|
|
|
|
|
|
<delete id="physicalDeleteByWorkId">
|
|
|
|
|
DELETE FROM task_log WHERE work_id = #{workId}
|
|
|
|
|
</delete>
|
2026-04-09 09:47:13 +08:00
|
|
|
|
|
|
|
|
<delete id="physicalDeleteByIds">
|
|
|
|
|
DELETE FROM task_log WHERE id IN
|
|
|
|
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
2026-03-10 08:29:37 +08:00
|
|
|
</mapper>
|
|
|
|
|
|