<?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.gkhy.safePlatform.doublePrevention.repository.PreventDangerCheckTaskRepository">
|
|
<resultMap id="BaseResultMap" type="com.gkhy.safePlatform.doublePrevention.entity.PreventDangerCheckTask">
|
<id property="id" column="id"/>
|
<result property="uuid" column="uuid"/>
|
<result property="deleteStatus" column="delete_status"/>
|
<result property="result" column="result"/>
|
<result property="taskStatus" column="task_status"/>
|
<result property="taskBelong" column="task_belong"/>
|
<result property="taskType" column="task_type"/>
|
<result property="startTime" column="start_time"/>
|
<result property="validTime" column="valid_time"/>
|
<result property="noticeTime" column="notice_time"/>
|
<result property="gmtCreate" column="gmt_create"/>
|
<result property="gmtModitify" column="gmt_moditify"/>
|
<result property="checkWorkId" column="check_work_id"/>
|
<result property="checkTaskUnitId" column="check_task_unit_id"/>
|
<result property="execUserId" column="exec_user_id"/>
|
<result property="enterpriseId" column="enterprise_id"/>
|
<result property="checkTaskUnitUuid" column="check_task_unit_uuid"/>
|
<result property="checkWorkUuid" column="check_work_uuid"/>
|
<result property="enterpriseUuid" column="enterprise_uuid"/>
|
<result property="taskCode" column="task_code"/>
|
<result property="execUserName" column="exec_user_name"/>
|
<result property="createUserName" column="create_user_name"/>
|
<result property="lastEditUserName" column="last_edit_user_name"/>
|
<result property="execDepId" column="exec_dep_id"/>
|
<result property="execDepUuid" column="exec_dep_uuid"/>
|
<result property="desc" column="desc"/>
|
<result column="report_status" property="reportStatus"/>
|
<result column="report_time" property="reportTime"/>
|
<result column="update_report_data_time" property="updateReportDataTime"/>
|
<result column="report_switch" property="reportSwitch"/>
|
</resultMap>
|
|
<!--IPage<PreventDangerCheckTask> getTaskPage(Page<Object> page, PreventDangerCheckTaskQueryReqDTO taskQueryReqDTO);-->
|
<select id="getTaskPage" resultMap="BaseResultMap">
|
select *
|
from prevent_danger_check_task
|
<where>
|
delete_status = 0
|
<if test="taskQueryReqDTO.result != null">
|
and result = #{taskQueryReqDTO.result}
|
</if>
|
<if test="taskQueryReqDTO.taskStatus != null">
|
and task_status = #{taskQueryReqDTO.taskStatus}
|
</if>
|
<if test="taskQueryReqDTO.taskType != null">
|
and task_type = #{taskQueryReqDTO.taskType}
|
</if>
|
</where>
|
order by gmt_create desc
|
</select>
|
|
<!--PreventDangerCheckTask getTaskById(Long checkTaskId);-->
|
<select id="getTaskById" resultType="com.gkhy.safePlatform.doublePrevention.entity.PreventDangerCheckTask">
|
select *
|
from prevent_danger_check_task
|
where delete_status = 0 and id = #{checkTaskId}
|
</select>
|
|
<!--PreventDangerCheckTask getTaskByCode(Long taskCode);-->
|
<select id="getTaskByCode" resultType="com.gkhy.safePlatform.doublePrevention.entity.PreventDangerCheckTask">
|
select
|
id,
|
uuid
|
from prevent_danger_check_task
|
where delete_status = 0 and task_code = #{taskCode}
|
</select>
|
|
<!--int updateCheckTaskReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO);-->
|
<update id="updateCheckTaskReport">
|
update prevent_danger_check_task set
|
report_switch = #{reportSwitch}
|
where id = #{id}
|
</update>
|
|
|
<!--PreventDangerCheckTask getTaskByCheckWorkId(Long checkWorkId)-->
|
<select id="getTaskByCheckWorkId" resultMap="BaseResultMap">
|
select id, uuid, check_work_id, task_status,valid_time
|
from prevent_danger_check_task where delete_status = 0 and (task_status = 1 or task_status = 4)
|
</select>
|
|
<!--PreventDangerCheckTask getTaskByCheckWorkIdAndStartTime(Long workId, Date checkTime);-->
|
<select id="getTaskByCheckWorkIdAndStartTime" resultMap="BaseResultMap">
|
select id,start_time
|
from prevent_danger_check_task
|
where delete_status = 0 and check_work_id = #{workId} and start_time = #{checkTime}
|
</select>
|
|
<!--boolean updateTaskStatus(Long taskId, Byte taskStatus);-->
|
<update id="updateTaskStatus">
|
update prevent_danger_check_task set
|
task_status = #{taskStatus}
|
where delete_status = 0 and task_status = 1 and id = #{taskId}
|
</update>
|
|
<!--int resetTaskStatus(Long taskId);-->
|
<update id="resetTaskStatus">
|
update prevent_danger_check_task set
|
task_status = 3,
|
result = 3
|
where delete_status = 0 and task_status = 4 and id = #{taskId}
|
</update>
|
|
|
<!--int updateTaskUnitIdById(PreventDangerCheckTaskUpdateParams updateParams);-->
|
<update id="updateTask">
|
update prevent_danger_check_task set
|
result = #{result},
|
gmt_moditify = #{gmtModitify},
|
last_edit_user_name = #{lastEditUserName},
|
task_status = #{taskStatus}
|
where delete_status = 0 and id = #{id}
|
</update>
|
|
<!--int deleteTask(PreventDeleteParams deleteParams);-->
|
<update id="deleteTask">
|
update prevent_danger_check_task set
|
gmt_moditify = #{gmtModitify},
|
last_edit_user_name = #{lastEditUserName},
|
update_report_data_time = #{updateReportDataTime},
|
delete_status = 1
|
where delete_status = 0 and id = #{id}
|
</update>
|
|
<!--int taskToUser(PreventTaskToUserParams taskToUserParams);-->
|
<update id="taskToUser">
|
update prevent_danger_check_task set
|
gmt_moditify = #{gmtModitify},
|
last_edit_user_name = #{lastEditUserName},
|
exec_user_id= #{execUserId},
|
exec_user_name= #{execUserName},
|
task_belong = #{taskBelong}
|
where delete_status = 0 and id = #{id}
|
</update>
|
|
|
|
<!--int updateTaskReportStatus(Long id, byte code);-->
|
<update id="updateTaskReportStatus">
|
update prevent_danger_check_task set
|
report_status = #{reportStatus},
|
report_time = #{reportTime}
|
where id = #{id}
|
</update>
|
|
<!--List<PreventDangerCheckTask> listReportTask();-->
|
<select id="listReportTask" resultMap="BaseResultMap">
|
select * from prevent_danger_check_task
|
where report_switch = 1 and task_belong = 2 and (update_report_data_time > report_time or report_time is null)
|
</select>
|
</mapper>
|