<?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.PreventDangerCheckWorkRepository">
|
|
<resultMap id="BaseResultMap" type="com.gkhy.safePlatform.doublePrevention.entity.PreventDangerCheckWork">
|
<id property="id" column="id"/>
|
<result property="uuid" column="uuid"/>
|
<result property="deleteStatus" column="delete_status"/>
|
<result property="checkWorkType" column="check_work_type"/>
|
<result property="checkWorkStatus" column="check_work_status"/>
|
<result property="checkCycle" column="check_cycle"/>
|
<result property="noticeTime" column="notice_time"/>
|
<result property="validTime" column="valid_time"/>
|
<result property="checkCycleUnit" column="check_cycle_unit"/>
|
<result property="validTimeUnit" column="valid_time_unit"/>
|
<result property="noticeTimeUnit" column="notice_time_unit"/>
|
<result property="gmtCreate" column="gmt_create"/>
|
<result property="gmtModitify" column="gmt_moditify"/>
|
<result property="firstStartTime" column="first_start_time"/>
|
<result property="lastCheckTime" column="last_check_time"/>
|
<result property="nextCheckTime" column="next_check_time"/>
|
<result property="execDepId" column="exec_dep_id"/>
|
<result property="enterpriseId" column="enterprise_id"/>
|
<result property="execDepUuid" column="exec_dep_uuid"/>
|
<result property="enterpriseUuid" column="enterprise_uuid"/>
|
<result property="checkWorkName" column="check_work_name"/>
|
<result property="execDep" column="exec_dep"/>
|
<result property="createByUserName" column="create_by_user_name"/>
|
<result property="lastEditUserName" column="last_edit_user_name"/>
|
<result property="taskUnitId" column="task_unit_id"/>
|
<result property="taskUnitUuid" column="task_unit_uuid"/>
|
<result property="reportStatus" column="report_status"/>
|
<result property="reportTime" column="report_time"/>
|
<result property="updateReportDataTime" column="update_report_data_time"/>
|
<result property="reportSwitch" column="report_switch"/>
|
</resultMap>
|
|
<!-- IPage<PreventDangerCheckWork> getCheckWorkPage(page,workQueryReqDTO);-->
|
<select id="getCheckWorkPage" resultMap="BaseResultMap">
|
select *
|
from prevent_danger_check_work
|
<where>
|
delete_status = 0
|
<if test="workQueryReqDTO.checkWorkType != null">
|
and check_work_type = #{workQueryReqDTO.checkWorkType}
|
</if>
|
<if test="workQueryReqDTO.checkWorkStatus != null">
|
and check_work_status = #{workQueryReqDTO.checkWorkStatus}
|
</if>
|
<if test="workQueryReqDTO.checkWorkId != null">
|
and id = #{workQueryReqDTO.checkWorkId}
|
</if>
|
<if test="workQueryReqDTO.checkWorkName != null">
|
and check_work_name = #{workQueryReqDTO.checkWorkName}
|
</if>
|
</where>
|
order by gmt_create desc
|
</select>
|
|
<!--PreventDangerCheckWork getWorkByName(String checkWorkName);-->
|
<select id="getWorkByName" resultType="com.gkhy.safePlatform.doublePrevention.entity.PreventDangerCheckWork">
|
select id ,uuid
|
from prevent_danger_check_work
|
where check_work_name = #{checkWorkName}
|
</select>
|
|
<!--List<PreventDangerCheckWork> listCheckWork();-->
|
<select id="listCheckWork" resultMap="BaseResultMap">
|
select *
|
from prevent_danger_check_work
|
where delete_status = 0 and check_work_status = 1
|
</select>
|
|
<!--PreventDangerCheckWork getWorkByTaskUnitId(Long taskUnitId);-->
|
<select id="getWorkByTaskUnitId" resultType="com.gkhy.safePlatform.doublePrevention.entity.PreventDangerCheckWork">
|
select
|
id,
|
uuid,
|
check_work_name
|
from prevent_danger_check_work
|
where delete_status = 0 and task_unit_id = #{taskUnitId}
|
</select>
|
|
<!-- PreventDangerCheckWork getWorkById(Long workId);-->
|
<select id="getWorkById" resultType="com.gkhy.safePlatform.doublePrevention.entity.PreventDangerCheckWork">
|
select *
|
from prevent_danger_check_work
|
where delete_status = 0 and id = #{workId}
|
</select>
|
|
<!--List<PreventDangerCheckWork> listScheduleCheckWork();-->
|
<select id="listScheduleCheckWork" resultMap="BaseResultMap">
|
select *
|
from prevent_danger_check_work
|
where delete_status = 0 and check_work_status = 1 and task_unit_id is not null
|
</select>
|
|
<!--int updateCheckWorkReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO);-->
|
<update id="updateCheckWorkReport">
|
update prevent_danger_check_work set
|
report_switch = #{reportSwitch}
|
where id = #{id}
|
</update>
|
|
<!--int updateCheckWorkLastTimeAndNextTime(CheckWorkAutoUpdateParams updateParams)-->
|
<update id="updateCheckWorkLastTimeAndNextTime">
|
update prevent_danger_check_work set
|
last_check_time = #{lastCheckTime},
|
next_check_time = #{nextCheckTime},
|
check_work_status = #{checkWorkStatus}
|
where delete_status = 0 and id = #{id}
|
</update>
|
|
<!--void updateCheckWorkStatus(CheckWorkAutoUpdateParams updateParams);-->
|
<update id="updateCheckWorkStatus">
|
update prevent_danger_check_work set
|
check_work_status = #{checkWorkStatus}
|
where delete_status = 0 and id = #{id}
|
</update>
|
|
<!--int resetWorkStatus(Long workId);-->
|
<update id="resetWorkStatus">
|
update prevent_danger_check_work set
|
check_work_status = 1
|
where delete_status = 0 and id = #{workId}
|
</update>
|
|
|
|
<!--int updateCheckWork(PreventDangerCheckWorkUpdateParams updateParams);-->
|
<update id="updateCheckWork">
|
update prevent_danger_check_work set
|
check_work_type = #{checkWorkType},
|
check_work_status = #{checkWorkStatus},
|
check_cycle_unit = #{checkCycleUnit},
|
valid_time_unit = #{checkCycleUnit},
|
notice_time_unit = #{noticeTimeUnit},
|
notice_time = #{noticeTime},
|
valid_time = #{validTime},
|
check_cycle = #{checkCycle},
|
check_work_name = #{checkWorkName},
|
exec_dep_id = #{execDepId},
|
exec_dep = #{execDep},
|
gmt_moditify = #{gmtModitify},
|
last_edit_user_name = #{lastEditUserName},
|
first_start_time = #{firstStartTime},
|
next_check_time = #{nextCheckTime},
|
task_unit_id = #{taskUnitId},
|
task_unit_uuid = #{taskUnitUuid},
|
update_report_data_time = #{updateReportDataTime},
|
report_status = #{reportStatus},
|
report_switch = #{reportSwitch}
|
where delete_status = 0 and id = #{id}
|
</update>
|
|
<!-- int deleteCheckWork(PreventDangerCheckWorkDeleteParams deleteParams);-->
|
<update id="deleteCheckWork">
|
update prevent_danger_check_work set
|
delete_status = 1,
|
gmt_moditify = #{gmtModitify},
|
update_report_data_time = #{updateReportDataTime},
|
last_edit_user_name = #{lastEditUserName}
|
where delete_status = 0 and id = #{id}
|
</update>
|
|
<!--int updateWorkReportStatus(Long id, byte code);-->
|
<update id="updateWorkReportStatus">
|
update prevent_danger_check_work set
|
report_status = #{reportStatus},
|
report_time = #{reportTime}
|
where id = #{id}
|
</update>
|
|
<!--List<PreventDangerCheckWork> listReportWork();-->
|
<select id="listReportWork" resultMap="BaseResultMap">
|
select * from prevent_danger_check_work
|
where report_switch = 1 and (update_report_data_time > report_time or report_time is null)
|
</select>
|
</mapper>
|