<?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.gk.hotwork.doublePrevention.repository.PreventDangerRectifyRepository">
|
|
<resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventDangerRectify">
|
<id property="id" column="id"/>
|
<result property="uuid" column="uuid"/>
|
<result property="deleteStatus" column="delete_status"/>
|
<result property="rectifyType" column="rectify_type"/>
|
<result property="rectifyTime" column="rectify_time"/>
|
<result property="checkAcceptTime" column="check_accept_time"/>
|
<result property="gmtCreate" column="gmt_create"/>
|
<result property="gmtModitify" column="gmt_moditify"/>
|
<result property="dangerCode" column="danger_code"/>
|
<result property="liablePersonId" column="liable_person_id"/>
|
<result property="checkAcceptPersonId" column="check_accept_person_id"/>
|
<result property="enterpriseId" column="enterprise_id"/>
|
<result property="enterpriseUuid" column="enterprise_uuid"/>
|
<result property="createByUserName" column="create_by_user_name"/>
|
<result property="lastEditUserName" column="last_edit_user_name"/>
|
<result property="liablePerson" column="liable_person"/>
|
<result property="checkAcceptPerson" column="check_accept_person"/>
|
<result property="rectifyDepId" column="rectify_dep_id"/>
|
<result property="rectifyDesc" column="rectify_desc"/>
|
<result property="checkAcceptDesc" column="check_accept_desc"/>
|
<result property="dangerManagerId" column="danger_manager_id"/>
|
<result property="dangerManagerUuid" column="danger_manager_uuid"/>
|
<result column="report_status" property="reportStatus"/>
|
<result column="report_time" property="reportTime"/>
|
<result column="update_report_data_time" property="updateReportDataTime"/>
|
<result column="cost" property="cost"/>
|
<result column="apply_time" property="applyTime"/>
|
<result column="time_out_desc" property="timeOutDesc"/>
|
<result column="rectify_info" property="rectifyInfo"/>
|
</resultMap>
|
|
<resultMap id="ResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventDangerRectify">
|
<id property="id" column="id"/>
|
<result property="uuid" column="uuid"/>
|
<result property="deleteStatus" column="delete_status"/>
|
<result property="rectifyType" column="rectify_type"/>
|
<result property="rectifyTime" column="rectify_time"/>
|
<result property="checkAcceptTime" column="check_accept_time"/>
|
<result property="gmtCreate" column="gmt_create"/>
|
<result property="gmtModitify" column="gmt_moditify"/>
|
<result property="dangerCode" column="danger_code"/>
|
<result property="liablePersonId" column="liable_person_id"/>
|
<result property="checkAcceptPersonId" column="check_accept_person_id"/>
|
<result property="enterpriseId" column="enterprise_id"/>
|
<result property="enterpriseUuid" column="enterprise_uuid"/>
|
<result property="createByUserName" column="create_by_user_name"/>
|
<result property="lastEditUserName" column="last_edit_user_name"/>
|
<result property="liablePerson" column="liable_person"/>
|
<result property="checkAcceptPerson" column="check_accept_person"/>
|
<result property="rectifyDepId" column="rectify_dep_id"/>
|
<result property="rectifyDesc" column="rectify_desc"/>
|
<result property="checkAcceptDesc" column="check_accept_desc"/>
|
<result property="dangerManagerId" column="danger_manager_id"/>
|
<result property="dangerManagerUuid" column="danger_manager_uuid"/>
|
<result column="report_status" property="reportStatus"/>
|
<result column="report_time" property="reportTime"/>
|
<result column="update_report_data_time" property="updateReportDataTime"/>
|
<result column="cost" property="cost"/>
|
<result column="apply_time" property="applyTime"/>
|
<result column="time_out_desc" property="timeOutDesc"/>
|
<result column="rectify_info" property="rectifyInfo"/>
|
<association property="preventDangerManage" javaType="com.gk.hotwork.doublePrevention.entity.PreventDangerManage">
|
<result column="danger_status" property="dangerStatus"></result>
|
<result column="serial_code" property="serialCode"></result>
|
</association>
|
</resultMap>
|
|
|
<!--IPage<PreventDangerManage> getDangerRectifyPage(page, rectifyQueryReqDTO);-->
|
<select id="getDangerRectifyPage" resultMap="ResultMap">
|
select t1.* , t2.id as managerId, t2.danger_status, t2.serial_code from prevent_danger_rectify t1
|
left join prevent_danger_manage t2
|
on t1.danger_manager_id = t2.id
|
<where>
|
t1.delete_status = 0
|
<if test="rectifyQueryReqDTO.rectifyType != null">
|
and t1.rectify_type = #{rectifyQueryReqDTO.rectifyType}
|
</if>
|
<if test="rectifyQueryReqDTO.rectifyDepId != null">
|
and t1.rectify_dep_id = #{rectifyQueryReqDTO.rectifyDepId}
|
</if>
|
<if test="rectifyQueryReqDTO.dangerStatus != null">
|
and t2.danger_status = #{rectifyQueryReqDTO.dangerStatus}
|
</if>
|
<if test="rectifyQueryReqDTO.serialCode != null">
|
and t2.serial_code = #{rectifyQueryReqDTO.serialCode}
|
</if>
|
<if test="rectifyQueryReqDTO.startTime != null">
|
and t1.gmt_create >= #{rectifyQueryReqDTO.startTime} and #{rectifyQueryReqDTO.endTime} >= t1.gmt_create
|
</if>
|
</where>
|
order by t1.gmt_create desc,t2.danger_status ASC
|
</select>
|
|
<!--IPage<PreventDangerRectify> getRectifyOverPage(Page<Object> objectPage, PreventRectifyOverQueryReqDTO rectifyOverQueryReqDTO);-->
|
<select id="getRectifyOverPage" resultMap="BaseResultMap">
|
select *
|
from prevent_danger_rectify
|
<where>
|
delete_status = 0
|
<if test="rectifyOverQueryReqDTO.checkAcceptPersonid != null">
|
and check_accept_person_id = #{rectifyOverQueryReqDTO.checkAcceptPersonid}
|
</if>
|
</where>
|
</select>
|
|
<!--PreventDangerRectifyService getRectifyByCode(String dangerCode);-->
|
<select id="getRectifyByCode" resultType="com.gk.hotwork.doublePrevention.entity.PreventDangerRectify">
|
select
|
id,
|
uuid
|
from prevent_danger_rectify
|
where delete_status = 0 and danger_code= #{dangerCode}
|
</select>
|
|
<!--IPage<PreventDangerRectify> getDangerRectifyPageToOverRectify(Page<Object> objectPage, PreventRectifyOverQueryReqDTO rectifyOverQueryReqDTO);-->
|
<select id="getDangerRectifyPageToOverRectify" resultMap="ResultMap">
|
select t1.* , t2.id managerId, t2.danger_status from prevent_danger_rectify t1
|
left join prevent_danger_manage t2
|
on t1.danger_manager_id = t2.id
|
<where>
|
t1.delete_status = 0
|
<if test="rectifyOverQueryReqDTO.rectifyType != null">
|
and t1.rectify_type = #{rectifyOverQueryReqDTO.rectifyType}
|
</if>
|
<if test="rectifyOverQueryReqDTO.checkAcceptPersonid != null">
|
and t1.check_accept_person_id = #{rectifyOverQueryReqDTO.checkAcceptPersonid}
|
</if>
|
<if test="rectifyOverQueryReqDTO.dangerStatus != null">
|
and t2.danger_status = #{rectifyOverQueryReqDTO.dangerStatus}
|
</if>
|
<if test="rectifyOverQueryReqDTO.status != null">
|
and (t2.danger_status = 1 or t2.danger_status = 9)
|
</if>
|
<if test="rectifyOverQueryReqDTO.depId != null">
|
and t2.dep_id = #{rectifyOverQueryReqDTO.depId}
|
</if>
|
</where>
|
order by t2.danger_status ASC,t1.gmt_create desc
|
</select>
|
|
|
<!--PreventDangerRectify getRectifyById(Long id);-->
|
<select id="getRectifyById" resultType="com.gk.hotwork.doublePrevention.entity.PreventDangerRectify">
|
select
|
id,
|
uuid,
|
rectify_time,
|
check_accept_person_id,
|
liable_person_id,
|
danger_manager_id
|
from prevent_danger_rectify
|
where delete_status = 0 and id= #{id}
|
</select>
|
|
<!-- PreventDangerRectify getRectifyByManageId(Long manageId);-->
|
<select id="getRectifyByManageId" resultType="com.gk.hotwork.doublePrevention.entity.PreventDangerRectify">
|
select * from prevent_danger_rectify
|
where delete_status = 0 and danger_manager_id= #{manageId}
|
</select>
|
|
<!--PreventDangerRectify getRectifyByManageIdForReport(Long manageId);-->
|
<select id="getRectifyByManageIdForReport" resultType="com.gk.hotwork.doublePrevention.entity.PreventDangerRectify">
|
select * from prevent_danger_rectify
|
where danger_manager_id = #{manageId}
|
</select>
|
|
<!--int updateRectifyReportStatus(Long id, byte code);-->
|
<update id="updateRectifyReportStatus">
|
update prevent_danger_rectify set
|
report_status = #{reportStatus},
|
report_time = #{reportTime}
|
where danger_manager_id = #{id}
|
</update>
|
|
|
<!--int updateRectifyTime(PreventDangerRectifyUpdateParams updateParams);-->
|
<update id="updateRectifyTime">
|
update prevent_danger_rectify set
|
rectify_time = #{rectifyTime},
|
update_report_data_time = #{updateReportDataTime},
|
report_status = #{reportStatus},
|
gmt_moditify = #{gmtModitify},
|
last_edit_user_name = #{lastEditUserName},
|
time_out_desc = #{timeOutDesc}
|
where delete_status = 0 and id =#{id}
|
</update>
|
|
<!--int updateDangerRectify(PreventDangerRectifyUpdateParams updateParams);-->
|
<update id="updateDangerRectify" >
|
update prevent_danger_rectify set
|
rectify_type = #{rectifyType},
|
rectify_time = #{rectifyTime},
|
cost = #{cost},
|
rectify_desc = #{rectifyDesc},
|
rectify_dep_id = #{rectifyDepId},
|
liable_person_id = #{liablePersonId},
|
liable_person = #{liablePerson},
|
update_report_data_time = #{updateReportDataTime},
|
gmt_moditify = #{gmtModitify},
|
last_edit_user_name = #{lastEditUserName},
|
report_status = #{reportStatus}
|
where delete_status = 0 and id =#{id}
|
</update>
|
|
<!--int reportRectify(PreventDangerReportRectifyUpdayeParams reportParams);-->
|
<update id="applyReport" >
|
update prevent_danger_rectify set
|
apply_time = #{applyTime},
|
update_report_data_time = #{updateReportDataTime},
|
gmt_moditify = #{gmtModitify},
|
last_edit_user_name = #{lastEditUserName},
|
rectify_info = #{rectifyInfo}
|
where delete_status = 0 and id =#{id}
|
</update>
|
|
<!--int closeDanger(CloseDangerParams closeDangerParams);-->
|
<update id="closeDanger">
|
update prevent_danger_rectify set
|
danger_review = #{dangerReview},
|
gmt_moditify = #{gmtModitify},
|
last_edit_user_name = #{lastEditUserName}
|
where delete_status = 0 and danger_manager_id = #{id}
|
</update>
|
|
|
<!--int reportRectify(PreventDangerReportRectifyUpdayeParams reportParams);-->
|
<update id="reportRectify" >
|
update prevent_danger_rectify set
|
check_accept_time = #{checkAcceptTime},
|
check_accept_desc = #{checkAcceptDesc},
|
update_report_data_time = #{updateReportDataTime},
|
report_status = #{reportStatus}
|
where delete_status = 0 and id =#{id}
|
</update>
|
|
<!--int deleteDangerRectify(PreventDeleteParams deleteParams);-->
|
<update id="deleteDangerRectify" >
|
update prevent_danger_rectify set
|
gmt_moditify = #{gmtModitify},
|
last_edit_user_name = #{gmtModitify},
|
update_report_data_time = #{updateReportDataTime},
|
delete_status = 1
|
where delete_status = 0 and id =#{id}
|
</update>
|
</mapper>
|