<?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.ruoyi.project.tr.hiddenDangerCheck.mapper.HiddenDangerCheckMapper">
|
|
<resultMap type="HiddenDangerCheck" id="HiddenDangerCheckResult">
|
<result property="checkId" column="check_id" />
|
<result property="createBy" column="create_by" />
|
<result property="createTime" column="create_time" />
|
<result property="updateBy" column="update_by" />
|
<result property="updateTime" column="update_time" />
|
<result property="remark" column="remark" />
|
<result property="planCreateUserId" column="plan_create_user_id" />
|
<result property="planName" column="plan_name" />
|
<result property="troubleshootTypeId" column="troubleshoot_type_id" />
|
<result property="troubleshootTypeName" column="troubleshoot_type_name" />
|
<result property="organizationDeptId" column="organization_dept_id" />
|
<result property="organizationDeptName" column="organization_dept_name" />
|
<result property="riskType" column="risk_type" />
|
<result property="riskId" column="risk_id" />
|
<result property="riskName" column="risk_name" />
|
<result property="checkUserId" column="check_user_id" />
|
<result property="checkUserName" column="check_user_name" />
|
<result property="beCheckedDeptId" column="be_checked_dept_id" />
|
<result property="beCheckedDeptName" column="be_checked_dept_name" />
|
<result property="checkBeginTime" column="check_begin_time" />
|
<result property="checkEndTime" column="check_end_time" />
|
<result property="planFormulateStatus" column="plan_formulate_status" />
|
<result property="planExecuteStatus" column="plan_execute_status" />
|
<result property="checkStatus" column="check_status" />
|
<result property="dangerDeptId" column="danger_dept_id" />
|
<result property="dangerDeptName" column="danger_dept_name" />
|
<result property="dangerPlaceId" column="danger_place_id" />
|
<result property="dangerPlaceName" column="danger_place_name" />
|
<result property="checkTime" column="check_time" />
|
<result property="examineUserId" column="examine_user_id" />
|
<result property="examineUserName" column="examine_user_name" />
|
<result property="stage" column="stage" />
|
|
|
|
<result property="scheduleCreateUserId" column="schedule_create_user_id" />
|
<result property="scheduleCreateUserName" column="schedule_create_user_name" />
|
<result property="scheduleCheckUserId" column="schedule_check_user_id" />
|
<result property="scheduleCheckUserName" column="schedule_check_user_name" />
|
<result property="scheduleCheckStatus" column="schedule_check_status" />
|
<result property="jobId" column="job_id" />
|
<result property="jobName" column="job_name" />
|
<result property="jobGroup" column="job_group" />
|
<result property="invokeTarget" column="invoke_target" />
|
<result property="jobMessage" column="job_message" />
|
<result property="status" column="status" />
|
<result property="exceptionInfo" column="exception_info" />
|
|
<result property="troubleshootTypeCycleNum" column="type_cycle_num" />
|
<result property="troubleshootTypeCycleType" column="type_cycle_type" />
|
|
|
<result property="checkType" column="check_type" />
|
|
|
</resultMap>
|
|
<sql id="selectHiddenDangerCheckVo">
|
select a.check_id, a.create_by, a.create_time, a.update_by, a.update_time, a.plan_create_user_id, a.remark,
|
a.plan_name, a.troubleshoot_type_id,
|
a.troubleshoot_type_name, a.organization_dept_id,
|
a.organization_dept_name, a.risk_id, a.risk_name, a.check_user_id, a.check_user_name,
|
a.be_checked_dept_id, a.be_checked_dept_name, a.check_begin_time, a.check_end_time,
|
a.plan_formulate_status, a.plan_execute_status, a.check_status,
|
a.danger_place_id,a.danger_place_name, a.check_time,
|
a.examine_user_id,a.examine_user_name,
|
a.stage,
|
a.danger_dept_id,a.danger_dept_name,
|
a.risk_type,
|
a.schedule_create_user_id, a.schedule_create_user_name,
|
a.schedule_check_user_id, a.schedule_check_user_name, a.schedule_check_status,
|
a.job_id, a.job_name, a.job_group, a.invoke_target, a.job_message, a.status, a.exception_info,
|
|
a.check_type,
|
b.type_cycle_num,b.type_cycle_type
|
from tr_hidden_danger_check a left join tr_troubleshoot_type b on a.troubleshoot_type_id = b.type_id
|
</sql>
|
|
<select id="selectHiddenDangerCheckList" parameterType="HiddenDangerCheck" resultMap="HiddenDangerCheckResult">
|
<include refid="selectHiddenDangerCheckVo"/>
|
<where>
|
<if test="checkId != null and checkId != ''"> and a.check_id = #{checkId}</if>
|
<if test="planCreateUserId != null and planCreateUserId != ''"> and a.plan_create_user_id = #{planCreateUserId}</if>
|
<if test="planName != null and planName != ''"> and a.plan_name like concat('%', #{planName}, '%')</if>
|
<if test="troubleshootTypeId != null "> and a.troubleshoot_type_id = #{troubleshootTypeId}</if>
|
<if test="troubleshootTypeName != null and troubleshootTypeName != ''"> and a.troubleshoot_type_name like concat('%', #{troubleshootTypeName}, '%')</if>
|
<if test="organizationDeptId != null "> and a.organization_dept_id = #{organizationDeptId}</if>
|
<if test="organizationDeptName != null and organizationDeptName != ''"> and a.organization_dept_name like concat('%', #{organizationDeptName}, '%')</if>
|
<if test="riskType != null and riskType != ''"> and a.risk_type = #{riskType}</if>
|
<if test="riskId != null "> and a.risk_id = #{riskId}</if>
|
<if test="riskName != null and riskName != ''"> and a.risk_name like concat('%', #{riskName}, '%')</if>
|
<if test="checkUserId != null "> and a.check_user_id = #{checkUserId}</if>
|
|
|
<if test="null != checkUserIdList and checkUserIdList.size() > 0">
|
and (a.check_user_id in
|
<foreach collection="checkUserIdList" item="checkUserId" open="(" separator="," close=")">
|
#{checkUserId}
|
</foreach>)
|
</if>
|
|
<if test="checkUserName != null and checkUserName != ''"> and a.check_user_name like concat('%', #{checkUserName}, '%')</if>
|
<if test="beCheckedDeptId != null "> and a.be_checked_dept_id = #{beCheckedDeptId}</if>
|
<if test="beCheckedDeptName != null and beCheckedDeptName != ''"> and a.be_checked_dept_name like concat('%', #{beCheckedDeptName}, '%')</if>
|
<if test="checkBeginTime != null and checkBeginTime != ''"> and a.check_begin_time = #{checkBeginTime}</if>
|
<if test="checkEndTime != null and checkEndTime != ''"> and a.check_end_time = #{checkEndTime}</if>
|
<if test="planFormulateStatus != null and planFormulateStatus != ''"> and a.plan_formulate_status = #{planFormulateStatus}</if>
|
<if test="planExecuteStatus != null and planExecuteStatus != ''"> and a.plan_execute_status = #{planExecuteStatus}</if>
|
<if test="checkStatus != null and checkStatus != ''"> and a.check_status = #{checkStatus}</if>
|
<if test="dangerDeptId != null and dangerDeptId != ''"> and a.danger_dept_id = #{dangerDeptId}</if>
|
<if test="dangerDeptName != null and dangerDeptName != ''"> and a.danger_dept_name = #{dangerDeptName}</if>
|
<if test="dangerPlaceId != null and dangerPlaceId != ''"> and a.danger_place_id = #{dangerPlaceId}</if>
|
<if test="dangerPlaceName != null and dangerPlaceName != ''"> and a.danger_place_name = #{dangerPlaceName}</if>
|
<if test="checkTime != null "> and a.check_time = #{checkTime}</if>
|
<if test="examineUserId != null "> and a.examine_user_id = #{examineUserId}</if>
|
<if test="examineUserName != null and examineUserName != ''"> and a.examine_user_name like concat('%', #{examineUserName}, '%')</if>
|
<if test="stage != null and stage != ''"> and a.stage = #{stage}</if>
|
<if test="planFormulateStatusExclude != null and planFormulateStatusExclude != ''"> and a.plan_formulate_status != #{planFormulateStatusExclude}</if>
|
|
|
|
<if test="scheduleCreateUserId != null "> and a.schedule_create_user_id = #{scheduleCreateUserId}</if>
|
<if test="scheduleCreateUserName != null and scheduleCreateUserName != ''"> and a.schedule_create_user_name like concat('%', #{scheduleCreateUserName}, '%')</if>
|
<if test="scheduleCheckUserId != null "> and a.schedule_check_user_id = #{scheduleCheckUserId}</if>
|
|
<if test="null != scheduleCheckUserIdList and scheduleCheckUserIdList.size() > 0">
|
and (a.schedule_check_user_id in
|
<foreach collection="scheduleCheckUserIdList" item="scheduleCheckUserId" open="(" separator="," close=")">
|
#{scheduleCheckUserId}
|
</foreach>)
|
</if>
|
|
<if test="scheduleCheckUserName != null and scheduleCheckUserName != ''"> and a.schedule_check_user_name like concat('%', #{scheduleCheckUserName}, '%')</if>
|
<if test="scheduleCheckStatus != null and scheduleCheckStatus != ''"> and a.schedule_check_status = #{scheduleCheckStatus}</if>
|
<if test="jobId != null "> and a.job_id = #{jobId}</if>
|
<if test="jobName != null and jobName != ''"> and a.job_name like concat('%', #{jobName}, '%')</if>
|
<if test="jobGroup != null and jobGroup != ''"> and a.job_group = #{jobGroup}</if>
|
<if test="invokeTarget != null and invokeTarget != ''"> and a.invoke_target = #{invokeTarget}</if>
|
<if test="jobMessage != null and jobMessage != ''"> and a.job_message = #{jobMessage}</if>
|
<if test="status != null and status != ''"> and a.status = #{status}</if>
|
<if test="exceptionInfo != null and exceptionInfo != ''"> and a.exception_info = #{exceptionInfo}</if>
|
|
|
|
<if test="checkType != null and checkType != ''"> and a.check_type = #{checkType}</if>
|
|
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
AND date_format(a.register_create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
</if>
|
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
AND date_format(a.register_create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
</if>
|
|
|
<if test="ledgerUserId != null ">
|
and (a.examine_user_id = #{ledgerUserId}
|
or a.rectify_user_id = #{ledgerUserId}
|
or a.accept_user_id = #{ledgerUserId})</if>
|
|
|
<if test="null != ledgerUserIdList and ledgerUserIdList.size() > 0">
|
and (a.rectify_user_id in
|
<foreach collection="ledgerUserIdList" item="ledgerUserId" open="(" separator="," close=")">
|
#{ledgerUserId}
|
</foreach>)
|
</if>
|
|
</where>
|
order by a.create_time desc
|
</select>
|
|
<select id="selectHiddenDangerCheckById" parameterType="Long" resultMap="HiddenDangerCheckResult">
|
<include refid="selectHiddenDangerCheckVo"/>
|
where a.check_id = #{checkId}
|
</select>
|
|
<insert id="insertHiddenDangerCheck" parameterType="HiddenDangerCheck" useGeneratedKeys="true" keyProperty="checkId">
|
insert into tr_hidden_danger_check
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="checkId != null ">check_id,</if>
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
<if test="createTime != null ">create_time,</if>
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
<if test="updateTime != null ">update_time,</if>
|
<if test="remark != null and remark != ''">remark,</if>
|
<if test="planCreateUserId != null and planCreateUserId != ''">plan_create_user_id,</if>
|
<if test="planName != null and planName != ''">plan_name,</if>
|
<if test="troubleshootTypeId != null ">troubleshoot_type_id,</if>
|
<if test="troubleshootTypeName != null and troubleshootTypeName != ''">troubleshoot_type_name,</if>
|
<if test="organizationDeptId != null ">organization_dept_id,</if>
|
<if test="organizationDeptName != null and organizationDeptName != ''">organization_dept_name,</if>
|
<if test="riskType != null and riskType != ''">risk_type,</if>
|
<if test="riskId != null ">risk_id,</if>
|
<if test="riskName != null and riskName != ''">risk_name,</if>
|
<if test="checkUserId != null ">check_user_id,</if>
|
<if test="checkUserName != null and checkUserName != ''">check_user_name,</if>
|
<if test="beCheckedDeptId != null ">be_checked_dept_id,</if>
|
<if test="beCheckedDeptName != null and beCheckedDeptName != ''">be_checked_dept_name,</if>
|
<if test="checkBeginTime != null and checkBeginTime != ''">check_begin_time,</if>
|
<if test="checkEndTime != null and checkEndTime != ''">check_end_time,</if>
|
<if test="planFormulateStatus != null and planFormulateStatus != ''">plan_formulate_status,</if>
|
<if test="planExecuteStatus != null and planExecuteStatus != ''">plan_execute_status,</if>
|
<if test="checkStatus != null and checkStatus != ''">check_status,</if>
|
<if test="dangerDeptId != null and dangerDeptId != ''">danger_dept_id,</if>
|
<if test="dangerDeptName != null and dangerDeptName != ''">danger_dept_name,</if>
|
<if test="dangerPlaceId != null and dangerPlaceId != ''">danger_place_id,</if>
|
<if test="dangerPlaceName != null and dangerPlaceName != ''">danger_place_name,</if>
|
<if test="checkTime != null ">check_time,</if>
|
<if test="examineUserId != null ">examine_user_id,</if>
|
<if test="examineUserName != null and examineUserName != ''">examine_user_name,</if>
|
<if test="stage != null and stage != ''">stage,</if>
|
|
|
|
<if test="scheduleCreateUserId != null ">schedule_create_user_id,</if>
|
<if test="scheduleCreateUserName != null and scheduleCreateUserName != ''">schedule_create_user_name,</if>
|
<if test="scheduleCheckUserId != null ">schedule_check_user_id,</if>
|
|
<if test="scheduleCheckUserName != null and scheduleCheckUserName != ''">schedule_check_user_name,</if>
|
<if test="scheduleCheckStatus != null and scheduleCheckStatus != ''">schedule_check_status,</if>
|
<if test="jobId != null ">job_id,</if>
|
<if test="jobName != null and jobName != ''">job_name,</if>
|
<if test="jobGroup != null and jobGroup != ''">job_group,</if>
|
<if test="invokeTarget != null and invokeTarget != ''">invoke_target,</if>
|
<if test="jobMessage != null and jobMessage != ''">job_message,</if>
|
<if test="status != null and status != ''">status,</if>
|
<if test="exceptionInfo != null and exceptionInfo != ''">exception_info,</if>
|
|
|
|
<if test="checkType != null and checkType != ''">check_type,</if>
|
|
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
<if test="createTime != null ">#{createTime},</if>
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
<if test="updateTime != null ">#{updateTime},</if>
|
<if test="remark != null and remark != ''">#{remark},</if>
|
<if test="planCreateUserId != null and planCreateUserId != ''">#{planCreateUserId},</if>
|
<if test="planName != null and planName != ''">#{planName},</if>
|
<if test="troubleshootTypeId != null ">#{troubleshootTypeId},</if>
|
<if test="troubleshootTypeName != null and troubleshootTypeName != ''">#{troubleshootTypeName},</if>
|
<if test="organizationDeptId != null ">#{organizationDeptId},</if>
|
<if test="organizationDeptName != null and organizationDeptName != ''">#{organizationDeptName},</if>
|
<if test="riskType != null and riskType != ''">#{riskType},</if>
|
<if test="riskId != null ">#{riskId},</if>
|
<if test="riskName != null and riskName != ''">#{riskName},</if>
|
<if test="checkUserId != null ">#{checkUserId},</if>
|
<if test="checkUserName != null and checkUserName != ''">#{checkUserName},</if>
|
<if test="beCheckedDeptId != null ">#{beCheckedDeptId},</if>
|
<if test="beCheckedDeptName != null and beCheckedDeptName != ''">#{beCheckedDeptName},</if>
|
<if test="checkBeginTime != null and checkBeginTime != ''">#{checkBeginTime},</if>
|
<if test="checkEndTime != null and checkEndTime != ''">#{checkEndTime},</if>
|
<if test="planFormulateStatus != null and planFormulateStatus != ''">#{planFormulateStatus},</if>
|
<if test="planExecuteStatus != null and planExecuteStatus != ''">#{planExecuteStatus},</if>
|
<if test="checkStatus != null and checkStatus != ''">#{checkStatus},</if>
|
<if test="dangerDeptId != null and dangerDeptId != ''">#{dangerDeptId},</if>
|
<if test="dangerDeptName != null and dangerDeptName != ''">#{dangerDeptName},</if>
|
<if test="dangerPlaceId != null and dangerPlaceId != ''">#{dangerPlaceId},</if>
|
<if test="dangerPlaceName != null and dangerPlaceName != ''">#{dangerPlaceName},</if>
|
<if test="checkTime != null ">#{checkTime},</if>
|
<if test="examineUserId != null ">#{examineUserId},</if>
|
<if test="examineUserName != null and examineUserName != ''">#{examineUserName},</if>
|
<if test="stage != null and stage != ''">#{stage},</if>
|
|
|
<if test="scheduleCreateUserId != null ">#{scheduleCreateUserId},</if>
|
<if test="scheduleCreateUserName != null and scheduleCreateUserName != ''">#{scheduleCreateUserName},</if>
|
<if test="scheduleCheckUserId != null ">#{scheduleCheckUserId},</if>
|
<if test="scheduleCheckUserName != null and scheduleCheckUserName != ''">#{scheduleCheckUserName},</if>
|
<if test="scheduleCheckStatus != null and scheduleCheckStatus != ''">#{scheduleCheckStatus},</if>
|
<if test="jobId != null ">#{jobId},</if>
|
<if test="jobName != null and jobName != ''">#{jobName},</if>
|
<if test="jobGroup != null and jobGroup != ''">#{jobGroup},</if>
|
<if test="invokeTarget != null and invokeTarget != ''">#{invokeTarget},</if>
|
<if test="jobMessage != null and jobMessage != ''">#{jobMessage},</if>
|
<if test="status != null and status != ''">#{status},</if>
|
<if test="exceptionInfo != null and exceptionInfo != ''">#{exceptionInfo},</if>
|
|
|
<if test="checkType != null and checkType != ''">#{checkType},</if>
|
|
</trim>
|
</insert>
|
|
<update id="updateHiddenDangerCheck" parameterType="HiddenDangerCheck">
|
update tr_hidden_danger_check
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
<if test="planCreateUserId != null and planCreateUserId != ''">plan_create_user_id = #{planCreateUserId},</if>
|
<if test="planName != null and planName != ''">plan_name = #{planName},</if>
|
<if test="troubleshootTypeId != null ">troubleshoot_type_id = #{troubleshootTypeId},</if>
|
<if test="troubleshootTypeName != null and troubleshootTypeName != ''">troubleshoot_type_name = #{troubleshootTypeName},</if>
|
<if test="organizationDeptId != null ">organization_dept_id = #{organizationDeptId},</if>
|
<if test="organizationDeptName != null and organizationDeptName != ''">organization_dept_name = #{organizationDeptName},</if>
|
<if test="riskType != null and riskType != ''">risk_type = #{riskType},</if>
|
<if test="riskId != null ">risk_id = #{riskId},</if>
|
<if test="riskName != null and riskName != ''">risk_name = #{riskName},</if>
|
<if test="checkUserId != null ">check_user_id = #{checkUserId},</if>
|
<if test="checkUserName != null and checkUserName != ''">check_user_name = #{checkUserName},</if>
|
<if test="beCheckedDeptId != null ">be_checked_dept_id = #{beCheckedDeptId},</if>
|
<if test="beCheckedDeptName != null and beCheckedDeptName != ''">be_checked_dept_name = #{beCheckedDeptName},</if>
|
<if test="checkBeginTime != null and checkBeginTime != ''">check_begin_time = #{checkBeginTime},</if>
|
<if test="checkEndTime != null and checkEndTime != ''">check_end_time = #{checkEndTime},</if>
|
<if test="planFormulateStatus != null and planFormulateStatus != ''">plan_formulate_status = #{planFormulateStatus},</if>
|
<if test="planExecuteStatus != null and planExecuteStatus != ''">plan_execute_status = #{planExecuteStatus},</if>
|
<if test="checkStatus != null and checkStatus != ''">check_status = #{checkStatus},</if>
|
<if test="dangerDeptId != null and dangerDeptId != ''">danger_dept_id = #{dangerDeptId},</if>
|
<if test="dangerDeptName != null and dangerDeptName != ''">danger_dept_name = #{dangerDeptName},</if>
|
<if test="dangerPlaceId != null and dangerPlaceId != ''">danger_place_id = #{dangerPlaceId},</if>
|
<if test="dangerPlaceName != null and dangerPlaceName != ''">danger_place_name = #{dangerPlaceName},</if>
|
<if test="checkTime != null ">check_time = #{checkTime},</if>
|
<if test="examineUserId != null ">examine_user_id = #{examineUserId},</if>
|
<if test="examineUserName != null and examineUserName != ''">examine_user_name = #{examineUserName},</if>
|
<if test="stage != null and stage != ''">stage = #{stage},</if>
|
|
<if test="scheduleCreateUserId != null ">schedule_create_user_id = #{scheduleCreateUserId},</if>
|
<if test="scheduleCreateUserName != null and scheduleCreateUserName != ''">schedule_create_user_name = #{scheduleCreateUserName},</if>
|
<if test="scheduleCheckUserId != null ">schedule_check_user_id = #{scheduleCheckUserId},</if>
|
<if test="scheduleCheckUserName != null and scheduleCheckUserName != ''">schedule_check_user_name = #{scheduleCheckUserName},</if>
|
<if test="scheduleCheckStatus != null and scheduleCheckStatus != ''">schedule_check_status = #{scheduleCheckStatus},</if>
|
<if test="jobId != null ">job_id = #{jobId},</if>
|
<if test="jobName != null and jobName != ''">job_name = #{jobName},</if>
|
<if test="jobGroup != null and jobGroup != ''">job_group = #{jobGroup},</if>
|
<if test="invokeTarget != null and invokeTarget != ''">invoke_target = #{invokeTarget},</if>
|
<if test="jobMessage != null and jobMessage != ''">job_message = #{jobMessage},</if>
|
<if test="status != null and status != ''">status = #{status},</if>
|
<if test="exceptionInfo != null and exceptionInfo != ''">exception_info = #{exceptionInfo},</if>
|
|
|
<if test="checkType != null and checkType != ''">check_type = #{checkType},</if>
|
|
|
</trim>
|
where check_id = #{checkId}
|
</update>
|
|
<delete id="deleteHiddenDangerCheckById" parameterType="Long">
|
delete from tr_hidden_danger_check where check_id = #{checkId}
|
</delete>
|
|
<delete id="deleteHiddenDangerCheckByIds" parameterType="String">
|
delete from tr_hidden_danger_check where check_id in
|
<foreach item="checkId" collection="array" open="(" separator="," close=")">
|
#{checkId}
|
</foreach>
|
</delete>
|
|
</mapper>
|