<?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.PreventDangerCheckTaskUnitRepository">
|
|
<resultMap id="BaseResultMap" type="com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTaskUnit">
|
<id property="id" column="id"/>
|
<result property="uuid" column="uuid"/>
|
<result property="deleteStatus" column="delete_status"/>
|
<result property="gmtCreate" column="gmt_create"/>
|
<result property="gmtModitify" column="gmt_moditify"/>
|
<result property="enterpriseUuid" column="enterprise_uuid"/>
|
<result property="enterpriseUuid" column="enterprise_uuid"/>
|
<result property="taskUnitName" column="task_unit_name"/>
|
<result property="createByUserName" column="create_by_user_name"/>
|
<result property="lastEditUserName" column="last_edit_user_name"/>
|
<result property="note" column="note"/>
|
</resultMap>
|
|
<!-- IPage<PreventDangerCheckTaskUnit> getTaskUnitPage-->
|
<select id="getTaskUnitPage" resultMap="BaseResultMap">
|
select
|
id,
|
task_unit_name,
|
gmt_create,
|
gmt_moditify,
|
create_by_user_name,
|
last_edit_user_name,
|
note
|
from prevent_danger_check_task_unit
|
<where>
|
delete_status = 0
|
<if test="taskUnitQueryReqDTO.taskUnitId != null">
|
and task_unit_id = #{taskUnitQueryReqDTO.taskUnitId}
|
</if>
|
<if test="taskUnitQueryReqDTO.taskUnitName != null">
|
and task_unit_name like '%' #{taskUnitQueryReqDTO.taskUnitName} '%'
|
</if>
|
</where>
|
order by gmt_create desc
|
</select>
|
|
<!--PreventDangerCheckTaskUnit getTaskUnitByName(String taskUnitName);-->
|
<select id="getTaskUnitByName" resultType="com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTaskUnit">
|
select
|
id,
|
uuid,
|
task_unit_name
|
from prevent_danger_check_task_unit
|
where delete_status = 0 and task_unit_name = #{taskUnitName}
|
</select>
|
|
<!--Long getTaskUnitByWorkId(Long workId);-->
|
<select id="getTaskUnitByWorkId" resultType="com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTaskUnit">
|
select
|
id,
|
task_unit_name
|
from prevent_danger_check_task_unit
|
where delete_status = 0 and check_work_id = #{workId}
|
</select>
|
|
<!-- PreventDangerCheckTaskUnit getTaskUnitById(Long id)-->
|
<select id="getTaskUnitById" resultType="com.gk.hotwork.doublePrevention.entity.PreventDangerCheckTaskUnit">
|
select
|
id,
|
uuid,
|
task_unit_name
|
from prevent_danger_check_task_unit
|
where delete_status = 0 and id = #{id}
|
</select>
|
|
<!--List<PreventDangerCheckTaskUnit> listTaskUnit();-->
|
<select id="listTaskUnit" resultMap="BaseResultMap">
|
select
|
id,
|
uuid,
|
task_unit_name
|
from prevent_danger_check_task_unit
|
where delete_status = 0
|
</select>
|
|
<!--int deleteWorkIdByUnitName(String taskUnitName);-->
|
<update id="deleteWorkIdByUnitName">
|
update prevent_danger_check_task_unit set
|
check_work_id = null
|
where delete_status = 0 and task_unit_name = #{taskUnitName}
|
</update>
|
|
<!--int updateTaskUnit(PreventDangerCheckTaskUnitUpdateParams updateParams);-->
|
<update id="updateTaskUnit">
|
update prevent_danger_check_task_unit set
|
task_unit_name = #{taskUnitName},
|
note = #{note},
|
gmt_moditify = #{gmtModitify},
|
last_edit_user_name = #{lastEditUserName}
|
where delete_status = 0 and id = #{id}
|
</update>
|
|
<!--int updateWorkIdByUnitId(String taskUnitId, long checkWorkId);-->
|
<update id="updateWorkIdByUnitId">
|
update prevent_danger_check_task_unit set
|
check_work_id = #{checkWorkId},
|
check_work_uuid = #{checkWorkUuid}
|
where delete_status = 0 and id = #{taskUnitId}
|
</update>
|
|
<!--int deleteByWorkId(Long workId);-->
|
<update id="deleteByWorkId">
|
update prevent_danger_check_task_unit set
|
check_work_id = null,
|
check_work_uuid = null
|
where delete_status = 0 and check_work_id = #{workId}
|
</update>
|
|
<!--PreventDangerCheckTaskUnit updateWorkIdByUnitName(String taskUnitName, Long checkWorkId);-->
|
<update id="updateWorkIdByUnitName">
|
update prevent_danger_check_task_unit set
|
check_work_id = #{checkWorkId}
|
where delete_status = 0 and task_unit_name = #{taskUnitName}
|
</update>
|
|
<!--int updateTaskIdByUnitName(String taskUnitName, long taskId);-->
|
<update id="updateTaskIdByUnitName">
|
update prevent_danger_check_task_unit set
|
check_task_id = #{taskId}
|
where delete_status = 0 and task_unit_name = #{taskUnitName}
|
</update>
|
|
<!-- int deleteTaskUnit(PreventDangerCheckTaskUnitDeleteParams deleteParams);-->
|
<update id="deleteTaskUnit" >
|
update prevent_danger_check_task_unit set
|
delete_status = 1,
|
gmt_moditify = #{gmtModitify},
|
last_edit_user_name = #{lastEditUserName}
|
where delete_status = 0 and id = #{id}
|
</update>
|
|
</mapper>
|