<?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.Mapper.InspectionHiddenDangerMapper" >
|
<update id="delByInspectionItemId">
|
update inspection_hidden_danger set valid_flag = 0 , update_time = #{inspectionHiddenDanger.updateTime},update_by = #{inspectionHiddenDanger.updateBy}
|
</update>
|
|
<update id="delByIds">
|
update inspection_hidden_danger
|
set valid_flag = 0
|
where
|
id in
|
<foreach collection="idList" item="id" close=")" open="(" separator=",">
|
#{id}
|
</foreach>
|
|
</update>
|
|
<select id="selectPages" resultType="com.gk.hotwork.Domain.SafetySelfInspection">
|
SELECT
|
s.*
|
FROM
|
safety_self_inspection s
|
LEFT JOIN inspection_hidden_danger h ON s.id = h.self_inspection_id
|
left join company as co on s.checked_company_id = co.id
|
WHERE
|
s.valid_flag = 1
|
AND h.valid_flag = 1
|
AND h.id IS NOT NULL
|
<if test="params.inspectionName != null and params.inspectionName != ''">
|
and s.inspection_name like concat("%",#{params.inspectionName},"%")
|
</if>
|
<if test="params.checkedCompanyId != null and params.checkedCompanyId != ''">
|
and s.checked_company_id like concat("%",#{params.checkedCompanyId},"%")
|
</if>
|
<if test="params.checkedCompanyName != null and params.checkedCompanyName != ''">
|
and s.checked_company_name like concat("%",#{params.checkedCompanyName},"%")
|
</if>
|
<if test="params.flag != null and params.flag != '' ">
|
and s.flag = #{params.flag}
|
</if>
|
<if test="params.inspectionStartTime != null and params.inspectionStartTime != ''" >
|
and s.inspection_time <![CDATA[ >= ]]> #{params.inspectionStartTime}
|
</if>
|
<if test="params.inspectionEndTime != null and params.inspectionEndTime != ''" >
|
and s.inspection_time <![CDATA[ <= ]]> #{params.inspectionEndTime}
|
</if>
|
<if test="params.province != null and params.province != ''" >
|
and co.province = #{params.province}
|
</if>
|
<if test="params.city != null and params.city != ''" >
|
and co.city = #{params.city}
|
</if>
|
<if test="params.area != null and params.area != ''" >
|
and co.area = #{params.area}
|
</if>
|
GROUP BY
|
s.id
|
ORDER BY s.create_time
|
</select>
|
<select id="inspectionHdangerlist" resultType="com.gk.hotwork.Domain.InspectionHiddenDanger">
|
SELECT
|
h.*,
|
i.element_a,
|
a.`name` as elementAname,
|
i.element_b,
|
b.`name` as elementBname,
|
i.element_c ,
|
c.`name` as elementCname,
|
i.standardization_requirements,
|
i.enterprise_standard,
|
i.review_method,
|
i.veto
|
FROM
|
inspection_hidden_danger h
|
LEFT JOIN safety_self_inspection_item s ON h.self_inspection_item_id = s.id
|
LEFT JOIN safety_inspection_item i ON s.safety_inspection_item_id = i.id
|
left join element_management a on a.id = i.element_a
|
left join element_management b on b.id = i.element_b
|
left join element_management c on c.id = i.element_c
|
where h.valid_flag = 1
|
and h.self_inspection_id = #{selfInspectionId}
|
</select>
|
|
|
</mapper>
|