双重预防项目-国泰新华二开定制版
heheng
2025-06-24 e98eeaaa5766511fdb8e6d5e412eb1c59d1f07ce
src/main/resources/mybatis/tr/HiddenDangerCheckPointMapper.xml
@@ -82,8 +82,6 @@
        <result property="acceptCreateTime" column="accept_create_time"/>
        <result property="acceptStatus" column="accept_status"/>
        <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"/>
@@ -96,20 +94,23 @@
        <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"/>
        <result property="companyId" column="company_id"/>
        <result property="checkPerson" column="check_person"/>
        <result property="findTime" column="find_time"/>
        <result property="dangerSrc" column="danger_src"/>
<!--        <result property="dangerSrcName" column="danger_src_name"/>-->
    </resultMap>
    <sql id="selectHiddenDangerCheckPointVo">
        select a.id,a.check_point_id,a.check_id, a.create_by, a.create_time, a.update_by, a.update_time,a.remark,
        select a.id,a.check_point_id,a.check_id, a.create_by, a.create_time, a.update_by, a.update_time,a.remark,a.accept_status,
        c.plan_create_user_id,
        c.plan_name, c.troubleshoot_type_id,
        c.troubleshoot_type_name, c.organization_dept_id,
@@ -132,16 +133,773 @@
      c.check_type,a.company_id,
         b.type_cycle_num,b.type_cycle_type,
         a.examine_user_id, a.examine_user_name
         a.examine_user_id, a.examine_user_name,
         a.check_person, a.find_time,e.danger_src
<!--        ,f.dict_label as danger_src_name-->
         from tr_hidden_danger_check_point a
         left join tr_hidden_danger_check  c  on  c.check_id = a.check_id
         left join tr_troubleshoot_type  b  on  c.troubleshoot_type_id = b.type_id
         left join prevent_risk_danger_info e on e.danger_check_point_id = a.id
<!--         left join sys_dict_data f on f.dict_value = e.danger_src and f.dict_type = 'danger_source'-->
    </sql>
    <select id="selectHiddenDangerCheckPointList" parameterType="HiddenDangerCheckPoint"
            resultMap="HiddenDangerCheckPointResult">
        <include refid="selectHiddenDangerCheckPointVo"/>
        <where>
            <if test="id != null  and id != ''">and a.id = #{id}</if>
            <if test="checkPointId != null  and checkPointId != ''">and a.check_point_id = #{checkPointId}</if>
            <if test="checkId != null  and checkId != ''">and a.check_id = #{checkId}</if>
            <if test="planCreateUserId != null  and planCreateUserId != ''">and c.plan_create_user_id =
                #{planCreateUserId}
            </if>
            <if test="dangerSrc != null"> and e.danger_src = #{dangerSrc}</if>
            <if test="planName != null  and planName != ''">and c.plan_name like concat('%', #{planName}, '%')</if>
            <if test="troubleshootTypeId != null ">and c.troubleshoot_type_id = #{troubleshootTypeId}</if>
            <if test="troubleshootTypeName != null  and troubleshootTypeName != ''">and c.troubleshoot_type_name like
                concat('%', #{troubleshootTypeName}, '%')
            </if>
            <if test="organizationDeptId != null ">and c.organization_dept_id = #{organizationDeptId}</if>
            <if test="organizationDeptName != null  and organizationDeptName != ''">and c.organization_dept_name like
                concat('%', #{organizationDeptName}, '%')
            </if>
            <if test="riskType != null  and riskType != ''">and c.risk_type = #{riskType}</if>
            <if test="riskId != null ">and c.risk_id = #{riskId}</if>
            <if test="riskName != null  and riskName != ''">and c.risk_name like concat('%', #{riskName}, '%')</if>
            <if test="checkUserId != null ">and c.check_user_id = #{checkUserId}</if>
            <if test="checkUserName != null  and checkUserName != ''">and c.check_user_name like concat('%',
                #{checkUserName}, '%')
            </if>
            <if test="beCheckedDeptId != null ">and c.be_checked_dept_id = #{beCheckedDeptId}</if>
            <if test="beCheckedDeptName != null  and beCheckedDeptName != ''">and c.be_checked_dept_name like
                concat('%', #{beCheckedDeptName}, '%')
            </if>
            <if test="checkBeginTime != null  and checkBeginTime != ''">and c.check_begin_time = #{checkBeginTime}</if>
            <if test="checkEndTime != null  and checkEndTime != ''">and c.check_end_time = #{checkEndTime}</if>
            <if test="planFormulateStatus != null  and planFormulateStatus != ''">and c.plan_formulate_status =
                #{planFormulateStatus}
            </if>
            <if test="planExecuteStatus != null  and planExecuteStatus != ''">and c.plan_execute_status =
                #{planExecuteStatus}
            </if>
            <if test="checkStatus != null  and checkStatus != ''">and c.check_status = #{checkStatus}</if>
            <if test="whetherDanger != null  and whetherDanger != ''">and a.whether_danger = #{whetherDanger}</if>
            <if test="dangerName != null  and dangerName != ''">and a.danger_name like concat('%', #{dangerName}, '%')
            </if>
            <if test="dangerDescription != null  and dangerDescription != ''">and a.danger_description =
                #{dangerDescription}
            </if>
            <if test="dangerLevel != null  and dangerLevel != ''">and a.danger_level = #{dangerLevel}</if>
            <if test="troubleTypeId != null ">and a.trouble_type_id = #{troubleTypeId}</if>
            <if test="troubleTypeName != null  and troubleTypeName != ''">and a.trouble_type_name like concat('%',
                #{troubleTypeName}, '%')
            </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="preRectifyPhoto != null  and preRectifyPhoto != ''">and a.pre_rectify_photo = #{preRectifyPhoto}
            </if>
            <if test="registerUserId != null  and registerUserId != ''">and a.register_user_id = #{registerUserId}</if>
            <if test="registerUserName != null  and registerUserName != ''">and a.register_user_name =
                #{registerUserName}
            </if>
            <if test="registerCreateTime != null ">and a.register_create_time = #{registerCreateTime}</if>
            <if test="params.beginRegisterCreateTime != null and params.beginRegisterCreateTime != '' and params.endRegisterCreateTime != null and params.endRegisterCreateTime != ''">
                and a.register_create_time between #{params.beginRegisterCreateTime} and
                #{params.endRegisterCreateTime}
            </if>
            <if test="registerSubmitTime != null ">and a.register_submit_time = #{registerSubmitTime}</if>
            <if test="judgeUserId != null  and judgeUserId != ''">and a.judge_user_id = #{judgeUserId}</if>
            <if test="judgeUserName != null  and judgeUserName != ''">and a.judge_user_name = #{judgeUserName}</if>
            <if test="judgeCreateTime != null ">and a.judge_create_time = #{judgeCreateTime}</if>
            <if test="judgeCreateUserId != null  and judgeCreateUserId != ''">and a.judge_create_user_id =
                #{judgeCreateUserId}
            </if>
            <if test="dangerSources != null  and dangerSources != ''">and a.danger_sources = #{dangerSources}</if>
            <if test="reportStatus != null  and reportStatus != ''">and a.report_status = #{reportStatus}</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="examineStatus != null  and examineStatus != ''">and a.examine_status = #{examineStatus}</if>
            <if test="examineOpinion != null  and examineOpinion != ''">and a.examine_opinion = #{examineOpinion}</if>
            <if test="examineResult != null  and examineResult != ''">and a.examine_result = #{examineResult}</if>
            <if test="examineCreateTime != null ">and a.examine_create_time = #{examineCreateTime}</if>
            <if test="treatMeasure != null  and treatMeasure != ''">and a.treat_measure = #{treatMeasure}</if>
            <if test="rectifyUserId != null ">and a.rectify_user_id = #{rectifyUserId}</if>
            <if test="rectifyUserName != null  and rectifyUserName != ''">and a.rectify_user_name like concat('%',
                #{rectifyUserName}, '%')
            </if>
            <if test="rectifyDeptId != null ">and a.rectify_dept_id = #{rectifyDeptId}</if>
            <if test="rectifyDeptName != null  and rectifyDeptName != ''">and a.rectify_dept_name like concat('%',
                #{rectifyDeptName}, '%')
            </if>
            <if test="rectifyDeadlineTime != null ">and a.rectify_deadline_time = #{rectifyDeadlineTime}</if>
            <if test="rectifyType != null  and rectifyType != ''">and a.rectify_type = #{rectifyType}</if>
            <if test="rectifyAttachment != null  and rectifyAttachment != ''">and a.rectify_attachment =
                #{rectifyAttachment}
            </if>
            <if test="rectifyMeasure != null  and rectifyMeasure != ''">and a.rectify_measure = #{rectifyMeasure}</if>
            <if test="rectifyCondition != null  and rectifyCondition != ''">and a.rectify_condition =
                #{rectifyCondition}
            </if>
            <if test="rectifyFund != null  and rectifyFund != ''">and a.rectify_fund = #{rectifyFund}</if>
            <if test="rectifyCompleteTime != null ">and a.rectify_complete_time = #{rectifyCompleteTime}</if>
            <if test="rectifyStatus != null  and rectifyStatus != ''">and a.rectify_status = #{rectifyStatus}</if>
            <if test="rectifyCreateTime != null ">and a.rectify_create_time = #{rectifyCreateTime}</if>
            <if test="acceptUserId != null ">and a.accept_user_id = #{acceptUserId}</if>
            <if test="acceptUserName != null  and acceptUserName != ''">and a.accept_user_name like concat('%',
                #{acceptUserName}, '%')
            </if>
            <if test="postRectifyPhoto != null  and postRectifyPhoto != ''">and a.post_rectify_photo =
                #{postRectifyPhoto}
            </if>
            <if test="acceptResult != null  and acceptResult != ''">and a.accept_result = #{acceptResult}</if>
            <if test="acceptOpinion != null  and acceptOpinion != ''">and a.accept_opinion = #{acceptOpinion}</if>
            <if test="acceptFile != null  and acceptFile != ''">and a.accept_file = #{acceptFile}</if>
            <if test="acceptCreateTime != null ">and a.accept_create_time = #{acceptCreateTime}</if>
            <if test="acceptStatus != null  and acceptStatus != ''">and a.accept_status = #{acceptStatus}</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="judgeQueryByUserId != null  and judgeQueryByUserId != ''">
                and a.danger_sources in (2,3)
                and (a.register_user_id = #{judgeQueryByUserId} or (a.judge_user_id = #{judgeQueryByUserId} and
                a.report_status IS NOT NULL) )
            </if>
            <if test="null != judgeQueryByUserIdList  and judgeQueryByUserIdList.size() > 0">
                and a.danger_sources in (2,3) and a.report_status IS NOT NULL and (a.judge_user_id in
                <foreach collection="judgeQueryByUserIdList" item="judgeQueryByUserId" open="(" separator="," close=")">
                    #{judgeQueryByUserId}
                </foreach>)
            </if>
            <if test="reportStatusIsNotNull != null  and reportStatusIsNotNull != ''">and (a.report_status IS NOT
                NULL)
            </if>
            <if test="scheduleCreateUserId != null ">and c.schedule_create_user_id = #{scheduleCreateUserId}</if>
            <if test="scheduleCreateUserName != null  and scheduleCreateUserName != ''">and c.schedule_create_user_name
                like concat('%', #{scheduleCreateUserName}, '%')
            </if>
            <if test="scheduleCheckUserId != null ">and c.schedule_check_user_id = #{scheduleCheckUserId}</if>
            <if test="scheduleCheckUserName != null  and scheduleCheckUserName != ''">and c.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 c.job_id = #{jobId}</if>
            <if test="jobName != null  and jobName != ''">and c.job_name like concat('%', #{jobName}, '%')</if>
            <if test="jobGroup != null  and jobGroup != ''">and c.job_group = #{jobGroup}</if>
            <if test="invokeTarget != null  and invokeTarget != ''">and c.invoke_target = #{invokeTarget}</if>
            <if test="jobMessage != null  and jobMessage != ''">and c.job_message = #{jobMessage}</if>
            <if test="status != null  and status != ''">and c.status = #{status}</if>
            <if test="exceptionInfo != null  and exceptionInfo != ''">and c.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') &gt;= 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') &lt;= 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>
            <if test="null != examineUserIdList  and examineUserIdList.size() > 0">
                and (a.examine_user_id in
                <foreach collection="examineUserIdList" item="examineUserId" open="(" separator="," close=")">
                    #{examineUserId}
                </foreach>)
            </if>
            <if test="overdueRectify != null  and overdueRectify != ''">
                and (Date(a.rectify_complete_time) > Date(a.rectify_deadline_time))
            </if>
            <if test="companyId != null  and companyId != ''">and a.company_id  = #{companyId}</if>
            <if test="rectifyUserIdIsNotNull != null  and rectifyUserIdIsNotNull != ''">and a.rectify_user_id is not null</if>
            <if test="acceptStatus != null  and acceptStatus != ''">and a.accept_status  = #{acceptStatus}</if>
            <if test="null != companyIdList  and companyIdList.size() > 0">
                and (a.company_id in
                <foreach collection="companyIdList" item="companyId" open="(" separator="," close=")">
                    #{companyId}
                </foreach>)
            </if>
            <if test="reportStatusByHasHandle != null  and reportStatusByHasHandle != ''">and (a.report_status = 0 or a.report_status = 1 or
                a.report_status = 2)
            </if>
            and (a.whether_danger = 1 or a.whether_danger is null) and  danger_name is not null
        </where>
        order by a.accept_status, a.create_time desc
    </select>
    <resultMap  type="HiddenDangerCheckPoint" id="HiddenDangerCheckPointResultNew">
        <result property="id" column="id"/>
        <result property="checkPointId" column="check_point_id"/>
        <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="whetherDanger" column="whether_danger"/>
        <result property="dangerName" column="danger_name"/>
        <result property="dangerDescription" column="danger_description"/>
        <result property="dangerLevel" column="danger_level"/>
        <result property="troubleTypeId" column="trouble_type_id"/>
        <result property="troubleTypeName" column="trouble_type_name"/>
        <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="preRectifyPhoto" column="pre_rectify_photo"/>
        <result property="registerUserId" column="register_user_id"/>
        <result property="registerUserName" column="register_user_name"/>
        <result property="registerCreateTime" column="register_create_time"/>
        <result property="registerSubmitTime" column="register_submit_time"/>
        <result property="judgeUserId" column="judge_user_id"/>
        <result property="judgeUserName" column="judge_user_name"/>
        <result property="judgeCreateTime" column="judge_create_time"/>
        <result property="judgeCreateUserId" column="judge_create_user_id"/>
        <result property="dangerSources" column="danger_sources"/>
        <result property="reportStatus" column="report_status"/>
        <result property="examineUserId" column="examine_user_id"/>
        <result property="examineUserName" column="examine_user_name"/>
        <result property="examineStatus" column="examine_status"/>
        <result property="examineOpinion" column="examine_opinion"/>
        <result property="examineResult" column="examine_result"/>
        <result property="examineCreateTime" column="examine_create_time"/>
        <result property="treatMeasure" column="treat_measure"/>
        <result property="rectifyUserId" column="rectify_user_id"/>
        <result property="rectifyUserName" column="rectify_user_name"/>
        <result property="rectifyDeptId" column="rectify_dept_id"/>
        <result property="rectifyDeptName" column="rectify_dept_name"/>
        <result property="rectifyDeadlineTime" column="rectify_deadline_time"/>
        <result property="rectifyType" column="rectify_type"/>
        <result property="rectifyAttachment" column="rectify_attachment"/>
        <result property="rectifyMeasure" column="rectify_measure"/>
        <result property="rectifyCondition" column="rectify_condition"/>
        <result property="rectifyFund" column="rectify_fund"/>
        <result property="rectifyCompleteTime" column="rectify_complete_time"/>
        <result property="rectifyStatus" column="rectify_status"/>
        <result property="rectifyCreateTime" column="rectify_create_time"/>
        <result property="acceptUserId" column="accept_user_id"/>
        <result property="acceptUserName" column="accept_user_name"/>
        <result property="postRectifyPhoto" column="post_rectify_photo"/>
        <result property="acceptResult" column="accept_result"/>
        <result property="acceptOpinion" column="accept_opinion"/>
        <result property="acceptFile" column="accept_file"/>
        <result property="acceptCreateTime" column="accept_create_time"/>
        <result property="acceptStatus" column="accept_status"/>
        <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"/>
        <result property="companyId" column="company_id"/>
        <result property="checkPerson" column="check_person"/>
        <result property="findTime" column="find_time"/>
        <result property="dangerSrc" column="danger_src"/>
    </resultMap>
    <sql id="selectHiddenDangerCheckPointVoNewCount">
        select a.id,a.check_point_id,a.check_id, a.create_by, a.create_time, a.update_by, a.update_time,a.remark,a.accept_status,
        c.plan_create_user_id,
        c.plan_name, c.troubleshoot_type_id,
        c.troubleshoot_type_name, c.organization_dept_id,
        c.organization_dept_name, c.risk_id, c.risk_name,c.risk_type, c.check_user_id, c.check_user_name,
        c.be_checked_dept_id, c.be_checked_dept_name, c.check_begin_time, c.check_end_time,
        c.plan_formulate_status, c.plan_execute_status, c.check_status, a.whether_danger,
        a.danger_name, a.danger_description, a.danger_level, a.trouble_type_id, a.trouble_type_name,
        c.danger_place_id,c.danger_place_name, a.check_time, a.pre_rectify_photo, a.register_create_time, a.judge_create_time,
        a.danger_sources, a.report_status,
        a.examine_status, a.examine_opinion, a.examine_result, a.examine_create_time,
        a.treat_measure, a.rectify_user_id, a.rectify_user_name, a.rectify_dept_id, a.rectify_dept_name, a.rectify_deadline_time,
        a.rectify_type, a.rectify_attachment, a.rectify_measure, a.rectify_condition, a.rectify_fund, a.rectify_complete_time,
        a.rectify_status, a.rectify_create_time, a.accept_user_id, a.accept_user_name, a.post_rectify_photo, a.accept_result,
        a.accept_create_time,a.accept_status, a.accept_opinion, a.accept_file, a.stage,
        c.danger_dept_id,c.danger_dept_name,a.judge_user_id,a.judge_user_name,a.judge_create_user_id,
        a.register_submit_time,a.register_user_id,a.register_user_name,
        c.schedule_create_user_id, c.schedule_create_user_name,
        c.schedule_check_user_id, c.schedule_check_user_name, a.schedule_check_status,
        c.job_id, c.job_name, c.job_group, c.invoke_target, c.job_message, c.status, c.exception_info,
        c.check_type,a.company_id,
        b.type_cycle_num,b.type_cycle_type,
        a.examine_user_id, a.examine_user_name,
        a.check_person, a.find_time,e.danger_src
        from tr_hidden_danger_check_point a
        left join tr_hidden_danger_check  c  on  c.check_id = a.check_id
        left join tr_troubleshoot_type  b  on  c.troubleshoot_type_id = b.type_id
        left join prevent_risk_danger_info e on e.danger_check_point_id = a.id
    </sql>
    <!-- todo 查隐患台账-->
    <select id="selectHiddenDangerCheckPointListNewCount" parameterType="HiddenDangerCheckPoint"
            resultMap="HiddenDangerCheckPointResultNew">
        <include refid="selectHiddenDangerCheckPointVoNewCount"/>
        <where>
            <if test="id != null  and id != ''">and a.id = #{id}</if>
            <if test="dangerLevel != null  and dangerLevel != ''">and a.danger_level = #{dangerLevel}</if>
            <if test="registerUserId != null  and registerUserId != ''">and a.register_user_id = #{registerUserId}</if>
            <if test="registerUserName != null  and registerUserName != ''">and a.register_user_name =
                #{registerUserName}
            </if>
            <if test="dangerSrc != null"> and e.danger_src = #{dangerSrc}</if>
            <if test="registerCreateTime != null ">and a.register_create_time = #{registerCreateTime}</if>
            <if test="params.beginRegisterCreateTime != null and params.beginRegisterCreateTime != '' and params.endRegisterCreateTime != null and params.endRegisterCreateTime != ''">
                and a.register_create_time between #{params.beginRegisterCreateTime} and
                #{params.endRegisterCreateTime}
            </if>
            <if test="rectifyDeptId != null ">and a.rectify_dept_id = #{rectifyDeptId}</if>
            <if test="rectifyDeptName != null  and rectifyDeptName != ''">and a.rectify_dept_name like concat('%',
                #{rectifyDeptName}, '%')
            </if>
            <if test="rectifyStatus != null  and rectifyStatus != ''">and a.rectify_status = #{rectifyStatus}</if>
            <if test="acceptStatus != null  and acceptStatus != ''">and a.accept_status = #{acceptStatus}</if>
            <if test="stage != null  and stage != ''">and a.stage = #{stage}</if>
            <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
                AND date_format(a.register_create_time,'%y%m%d') &gt;= 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') &lt;= date_format(#{params.endTime},'%y%m%d')
            </if>
            <if test="overdueRectify != null  and overdueRectify != ''">
                and (Date(a.rectify_complete_time) > Date(a.rectify_deadline_time))
            </if>
            <if test="acceptStatus != null  and acceptStatus != ''">and a.accept_status  = #{acceptStatus}</if>
            <if test="dangerSources != null  and dangerSources != ''">and a.danger_sources = #{dangerSources}</if>
            <if test="dangerName != null  and dangerName != ''">and a.danger_name like concat('%', #{dangerName}, '%')
            </if>
<!--            <if test="rectifyUserIdIsNotNull != null  and rectifyUserIdIsNotNull != ''">and a.rectify_user_id is not null</if>-->
            and (a.whether_danger = 1 or a.whether_danger is null) and  danger_name is not null
        </where>
        order by a.accept_status, a.create_time desc
    </select>
    <select id="selectHiddenDangerCheckPointById" parameterType="Long" resultMap="HiddenDangerCheckPointResult">
        <include refid="selectHiddenDangerCheckPointVo"/>
        where a.id = #{id}
    </select>
    <insert id="insertHiddenDangerCheckPoint" parameterType="HiddenDangerCheckPoint" useGeneratedKeys="true" keyProperty="id">
        insert into tr_hidden_danger_check_point
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null ">id,</if>
            <if test="checkPointId != null ">check_point_id,</if>
            <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="whetherDanger != null  and whetherDanger != ''">whether_danger,</if>
            <if test="dangerName != null  and dangerName != ''">danger_name,</if>
            <if test="dangerDescription != null  and dangerDescription != ''">danger_description,</if>
            <if test="dangerLevel != null  and dangerLevel != ''">danger_level,</if>
            <if test="troubleTypeId != null ">trouble_type_id,</if>
            <if test="troubleTypeName != null  and troubleTypeName != ''">trouble_type_name,</if>
            <if test="checkTime != null ">check_time,</if>
            <if test="preRectifyPhoto != null  and preRectifyPhoto != ''">pre_rectify_photo,</if>
            <if test="registerUserId != null  and registerUserId != ''">register_user_id,</if>
            <if test="registerUserName != null  and registerUserName != ''">register_user_name,</if>
            <if test="registerCreateTime != null ">register_create_time,</if>
            <if test="registerSubmitTime != null ">register_submit_time,</if>
            <if test="judgeUserId != null  and judgeUserId != ''">judge_user_id,</if>
            <if test="judgeUserName != null  and judgeUserName != ''">judge_user_name,</if>
            <if test="judgeCreateTime != null ">judge_create_time,</if>
            <if test="judgeCreateUserId != null  and judgeCreateUserId != ''">judge_create_user_id,</if>
            <if test="dangerSources != null  and dangerSources != ''">danger_sources,</if>
            <if test="reportStatus != null  and reportStatus != ''">report_status,</if>
            <if test="examineUserId != null ">examine_user_id,</if>
            <if test="examineUserName != null  and examineUserName != ''">examine_user_name,</if>
            <if test="examineStatus != null  and examineStatus != ''">examine_status,</if>
            <if test="examineOpinion != null  and examineOpinion != ''">examine_opinion,</if>
            <if test="examineResult != null  and examineResult != ''">examine_result,</if>
            <if test="examineCreateTime != null ">examine_create_time,</if>
            <if test="treatMeasure != null  and treatMeasure != ''">treat_measure,</if>
            <if test="rectifyUserId != null ">rectify_user_id,</if>
            <if test="rectifyUserName != null  and rectifyUserName != ''">rectify_user_name,</if>
            <if test="rectifyDeptId != null ">rectify_dept_id,</if>
            <if test="rectifyDeptName != null  and rectifyDeptName != ''">rectify_dept_name,</if>
            <if test="rectifyDeadlineTime != null ">rectify_deadline_time,</if>
            <if test="rectifyType != null  and rectifyType != ''">rectify_type,</if>
            <if test="rectifyAttachment != null  and rectifyAttachment != ''">rectify_attachment,</if>
            <if test="rectifyMeasure != null  and rectifyMeasure != ''">rectify_measure,</if>
            <if test="rectifyCondition != null  and rectifyCondition != ''">rectify_condition,</if>
            <if test="rectifyFund != null  and rectifyFund != ''">rectify_fund,</if>
            <if test="rectifyCompleteTime != null ">rectify_complete_time,</if>
            <if test="rectifyStatus != null  and rectifyStatus != ''">rectify_status,</if>
            <if test="rectifyCreateTime != null ">rectify_create_time,</if>
            <if test="acceptUserId != null ">accept_user_id,</if>
            <if test="acceptUserName != null  and acceptUserName != ''">accept_user_name,</if>
            <if test="postRectifyPhoto != null  and postRectifyPhoto != ''">post_rectify_photo,</if>
            <if test="acceptResult != null  and acceptResult != ''">accept_result,</if>
            <if test="acceptOpinion != null  and acceptOpinion != ''">accept_opinion,</if>
            <if test="acceptFile != null  and acceptFile != ''">accept_file,</if>
            <if test="acceptCreateTime != null ">accept_create_time,</if>
            <if test="acceptStatus != null  and acceptStatus != ''">accept_status,</if>
            <if test="stage != null  and stage != ''">stage,</if>
            <if test="scheduleCheckStatus != null  and scheduleCheckStatus != ''">schedule_check_status,</if>
            <if test="checkType != null  and checkType != ''">check_type,</if>
            <if test="companyId != null  and companyId != ''">company_id,</if>
            <if test="checkPerson != null  and checkPerson != ''">check_person,</if>
            <if test="findTime != null ">find_time,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null ">#{id},</if>
            <if test="checkPointId != null ">#{checkPointId},</if>
            <if test="checkId != null ">#{checkId},</if>
            <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="whetherDanger != null  and whetherDanger != ''">#{whetherDanger},</if>
            <if test="dangerName != null  and dangerName != ''">#{dangerName},</if>
            <if test="dangerDescription != null  and dangerDescription != ''">#{dangerDescription},</if>
            <if test="dangerLevel != null  and dangerLevel != ''">#{dangerLevel},</if>
            <if test="troubleTypeId != null ">#{troubleTypeId},</if>
            <if test="troubleTypeName != null  and troubleTypeName != ''">#{troubleTypeName},</if>
            <if test="checkTime != null ">#{checkTime},</if>
            <if test="preRectifyPhoto != null  and preRectifyPhoto != ''">#{preRectifyPhoto},</if>
            <if test="registerUserId != null  and registerUserId != ''">#{registerUserId},</if>
            <if test="registerUserName != null  and registerUserName != ''">#{registerUserName},</if>
            <if test="registerCreateTime != null ">#{registerCreateTime},</if>
            <if test="registerSubmitTime != null ">#{registerSubmitTime},</if>
            <if test="judgeUserId != null  and judgeUserId != ''">#{judgeUserId},</if>
            <if test="judgeUserName != null  and judgeUserName != ''">#{judgeUserName},</if>
            <if test="judgeCreateTime != null ">#{judgeCreateTime},</if>
            <if test="judgeCreateUserId != null  and judgeCreateUserId != ''">#{judgeCreateUserId},</if>
            <if test="dangerSources != null  and dangerSources != ''">#{dangerSources},</if>
            <if test="reportStatus != null  and reportStatus != ''">#{reportStatus},</if>
            <if test="examineUserId != null ">#{examineUserId},</if>
            <if test="examineUserName != null  and examineUserName != ''">#{examineUserName},</if>
            <if test="examineStatus != null  and examineStatus != ''">#{examineStatus},</if>
            <if test="examineOpinion != null  and examineOpinion != ''">#{examineOpinion},</if>
            <if test="examineResult != null  and examineResult != ''">#{examineResult},</if>
            <if test="examineCreateTime != null ">#{examineCreateTime},</if>
            <if test="treatMeasure != null  and treatMeasure != ''">#{treatMeasure},</if>
            <if test="rectifyUserId != null ">#{rectifyUserId},</if>
            <if test="rectifyUserName != null  and rectifyUserName != ''">#{rectifyUserName},</if>
            <if test="rectifyDeptId != null ">#{rectifyDeptId},</if>
            <if test="rectifyDeptName != null  and rectifyDeptName != ''">#{rectifyDeptName},</if>
            <if test="rectifyDeadlineTime != null ">#{rectifyDeadlineTime},</if>
            <if test="rectifyType != null  and rectifyType != ''">#{rectifyType},</if>
            <if test="rectifyAttachment != null  and rectifyAttachment != ''">#{rectifyAttachment},</if>
            <if test="rectifyMeasure != null  and rectifyMeasure != ''">#{rectifyMeasure},</if>
            <if test="rectifyCondition != null  and rectifyCondition != ''">#{rectifyCondition},</if>
            <if test="rectifyFund != null  and rectifyFund != ''">#{rectifyFund},</if>
            <if test="rectifyCompleteTime != null ">#{rectifyCompleteTime},</if>
            <if test="rectifyStatus != null  and rectifyStatus != ''">#{rectifyStatus},</if>
            <if test="rectifyCreateTime != null ">#{rectifyCreateTime},</if>
            <if test="acceptUserId != null ">#{acceptUserId},</if>
            <if test="acceptUserName != null  and acceptUserName != ''">#{acceptUserName},</if>
            <if test="postRectifyPhoto != null  and postRectifyPhoto != ''">#{postRectifyPhoto},</if>
            <if test="acceptResult != null  and acceptResult != ''">#{acceptResult},</if>
            <if test="acceptOpinion != null  and acceptOpinion != ''">#{acceptOpinion},</if>
            <if test="acceptFile != null  and acceptFile != ''">#{acceptFile},</if>
            <if test="acceptCreateTime != null ">#{acceptCreateTime},</if>
            <if test="acceptStatus != null  and acceptStatus != ''">#{acceptStatus},</if>
            <if test="stage != null  and stage != ''">#{stage},</if>
            <if test="scheduleCheckStatus != null  and scheduleCheckStatus != ''">#{scheduleCheckStatus},</if>
            <if test="checkType != null  and checkType != ''">#{checkType},</if>
            <if test="companyId != null  and companyId != ''">#{companyId},</if>
            <if test="checkPerson != null  and checkPerson != ''">#{checkPerson},</if>
            <if test="findTime != null ">#{findTime},</if>
        </trim>
    </insert>
    <update id="updateHiddenDangerCheckPoint" parameterType="HiddenDangerCheckPoint">
        update tr_hidden_danger_check_point
        <trim prefix="SET" suffixOverrides=",">
            <if test="checkPointId != null  and checkPointId != ''">check_point_id = #{checkPointId},</if>
            <if test="checkId != null  and checkId != ''">check_id = #{checkId},</if>
            <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="whetherDanger != null  and whetherDanger != ''">whether_danger = #{whetherDanger},</if>
            <if test="dangerName != null  and dangerName != ''">danger_name = #{dangerName},</if>
            <if test="dangerDescription != null  and dangerDescription != ''">danger_description =
                #{dangerDescription},
            </if>
            <if test="dangerLevel != null  and dangerLevel != ''">danger_level = #{dangerLevel},</if>
            <if test="troubleTypeId != null ">trouble_type_id = #{troubleTypeId},</if>
            <if test="troubleTypeName != null  and troubleTypeName != ''">trouble_type_name = #{troubleTypeName},</if>
            <if test="checkTime != null ">check_time = #{checkTime},</if>
            <if test="preRectifyPhoto != null  and preRectifyPhoto != ''">pre_rectify_photo = #{preRectifyPhoto},</if>
            <if test="registerUserId != null  and registerUserId != ''">register_user_id = #{registerUserId},</if>
            <if test="registerUserName != null  and registerUserName != ''">register_user_name = #{registerUserName},
            </if>
            <if test="registerCreateTime != null ">register_create_time = #{registerCreateTime},</if>
            <if test="registerSubmitTime != null ">register_submit_time = #{registerSubmitTime},</if>
            <if test="judgeUserId != null  and judgeUserId != ''">judge_user_id = #{judgeUserId},</if>
            <if test="judgeUserName != null  and judgeUserName != ''">judge_user_name = #{judgeUserName},</if>
            <if test="judgeCreateTime != null ">judge_create_time = #{judgeCreateTime},</if>
            <if test="judgeCreateUserId != null  and judgeCreateUserId != ''">judge_create_user_id =
                #{judgeCreateUserId},
            </if>
            <if test="dangerSources != null  and dangerSources != ''">danger_sources = #{dangerSources},</if>
            <if test="reportStatus != null  and reportStatus != ''">report_status = #{reportStatus},</if>
            <if test="examineUserId != null ">examine_user_id = #{examineUserId},</if>
            <if test="examineUserName != null  and examineUserName != ''">examine_user_name = #{examineUserName},</if>
            <if test="examineStatus != null  and examineStatus != ''">examine_status = #{examineStatus},</if>
            <if test="examineOpinion != null  and examineOpinion != ''">examine_opinion = #{examineOpinion},</if>
            <if test="examineResult != null  and examineResult != ''">examine_result = #{examineResult},</if>
            <if test="examineCreateTime != null ">examine_create_time = #{examineCreateTime},</if>
            <if test="treatMeasure != null  and treatMeasure != ''">treat_measure = #{treatMeasure},</if>
            <if test="rectifyUserId != null ">rectify_user_id = #{rectifyUserId},</if>
            <if test="rectifyUserName != null  and rectifyUserName != ''">rectify_user_name = #{rectifyUserName},</if>
            <if test="rectifyDeptId != null ">rectify_dept_id = #{rectifyDeptId},</if>
            <if test="rectifyDeptName != null  and rectifyDeptName != ''">rectify_dept_name = #{rectifyDeptName},</if>
            <if test="rectifyDeadlineTime != null ">rectify_deadline_time = #{rectifyDeadlineTime},</if>
            <if test="rectifyType != null  and rectifyType != ''">rectify_type = #{rectifyType},</if>
            <if test="rectifyAttachment != null  and rectifyAttachment != ''">rectify_attachment =
                #{rectifyAttachment},
            </if>
            <if test="rectifyMeasure != null  and rectifyMeasure != ''">rectify_measure = #{rectifyMeasure},</if>
            <if test="rectifyCondition != null  and rectifyCondition != ''">rectify_condition = #{rectifyCondition},
            </if>
            <if test="rectifyFund != null  and rectifyFund != ''">rectify_fund = #{rectifyFund},</if>
            <if test="rectifyCompleteTime != null ">rectify_complete_time = #{rectifyCompleteTime},</if>
            <if test="rectifyStatus != null  and rectifyStatus != ''">rectify_status = #{rectifyStatus},</if>
            <if test="rectifyCreateTime != null ">rectify_create_time = #{rectifyCreateTime},</if>
            <if test="acceptUserId != null ">accept_user_id = #{acceptUserId},</if>
            <if test="acceptUserName != null  and acceptUserName != ''">accept_user_name = #{acceptUserName},</if>
            <if test="postRectifyPhoto != null  and postRectifyPhoto != ''">post_rectify_photo = #{postRectifyPhoto},
            </if>
            <if test="acceptResult != null  and acceptResult != ''">accept_result = #{acceptResult},</if>
            <if test="acceptOpinion != null  and acceptOpinion != ''">accept_opinion = #{acceptOpinion},</if>
            <if test="acceptFile != null  and acceptFile != ''">accept_file = #{acceptFile},</if>
            <if test="acceptCreateTime != null ">accept_create_time = #{acceptCreateTime},</if>
            <if test="acceptStatus != null  and acceptStatus != ''">accept_status = #{acceptStatus},</if>
            <if test="stage != null  and stage != ''">stage = #{stage},</if>
            <if test="scheduleCheckStatus != null  and scheduleCheckStatus != ''">schedule_check_status =
                #{scheduleCheckStatus},
            </if>
            <if test="checkType != null  and checkType != ''">check_type = #{checkType},</if>
            <if test="checkPerson != null  and checkPerson != ''">check_person = #{checkPerson},</if>
            <if test="findTime != null ">find_time = #{findTime},</if>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteHiddenDangerCheckPointById" parameterType="Long">
        delete from tr_hidden_danger_check_point where id = #{id}
    </delete>
    <delete id="deleteHiddenDangerCheckPointByIds" parameterType="String">
        delete from tr_hidden_danger_check_point where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
    <resultMap type="RiskCheckPointDTO" id="RiskCheckPointDTOResult">
        <result property="id" column="id"/>
        <result property="checkPointId" column="check_point_id"/>
        <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="sclJianchaXiangmu" column="SCL_jiancha_xiangmu"/>
        <result property="sclJianchaMubiao" column="SCL_jiancha_mubiao"/>
        <result property="sclQingkuang" column="SCL_qingkuang"/>
        <result property="sclZhuyaoHouguo" column="SCL_zhuyao_houguo"/>
        <result property="jhaZuoyeBuzhou" column="JHA_zuoye_buzhou"/>
        <result property="jhaWeixianyuan" column="JHA_weixianyuan"/>
        <result property="jhaShiguLeixing" column="JHA_shigu_leixing"/>
        <result property="hazopJiedian" column="HAZOP_jiedian"/>
        <result property="hazopCanshu" column="HAZOP_canshu"/>
        <result property="hazopCanshuMiaoshu" column="HAZOP_canshu_miaoshu"/>
        <result property="hazopYindaoci" column="HAZOP_yindaoci"/>
        <result property="hazopPiancha" column="HAZOP_piancha"/>
        <result property="hazopYuanyin" column="HAZOP_yuanyin"/>
        <result property="hazopHouguo" column="HAZOP_houguo"/>
        <result property="whetherDanger" column="whether_danger"/>
        <result property="evaluationAfterJishu" column="evaluation_after_jishu"/>
        <result property="evaluationAfterGuanli" column="evaluation_after_guanli"/>
        <result property="evaluationAfterJiaoyu" column="evaluation_after_jiaoyu"/>
        <result property="evaluationAfterFanghu" column="evaluation_after_fanghu"/>
        <result property="evaluationAfterYingji" column="evaluation_after_yingji"/>
    </resultMap>
    <select id="selectRiskCheckPointListByCheckId" parameterType="RiskCheckPointDTO"
            resultMap="RiskCheckPointDTOResult">
        SELECT rcp.check_point_id, rcp.create_by, rcp.create_time, rcp.update_by, rcp.update_time, rcp.remark,
        rcp.SCL_jiancha_xiangmu, rcp.SCL_jiancha_mubiao, rcp.SCL_qingkuang, rcp.SCL_zhuyao_houguo,
        rcp.JHA_zuoye_buzhou, rcp.JHA_weixianyuan, rcp.JHA_shigu_leixing,
        rcp.HAZOP_jiedian, rcp.HAZOP_canshu, rcp.HAZOP_canshu_miaoshu, rcp.HAZOP_yindaoci,
        rcp.HAZOP_piancha, rcp.HAZOP_yuanyin, rcp.HAZOP_houguo,
        rcp.evaluation_after_jishu, rcp.evaluation_after_guanli, rcp.evaluation_after_jiaoyu,
        rcp.evaluation_after_fanghu, rcp.evaluation_after_yingji,
        hdcp.id,hdcp.check_id,
        hdcp.whether_danger
        FROM
        tr_hidden_danger_check_point hdcp
        LEFT JOIN
        tr_risk_check_point AS rcp
        ON
        hdcp.check_point_id = rcp.`check_point_id`
        <where>
            <if test="id != null  and id != ''">and hdcp.id = #{id}</if>
            <if test="checkPointId != null  and checkPointId != ''">and hdcp.check_point_id = #{checkPointId}</if>
            <if test="checkId != null  and checkId != ''">and hdcp.check_id = #{checkId}</if>
        </where>
        order by rcp.create_time DESC
    </select>
    <resultMap type="BaseCheckPointDTO" id="BaseCheckPointDTOResult">
        <result property="id" column="id"/>
        <result property="checkPointId" column="check_point_id"/>
        <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="checkContent" column="check_content"/>
        <result property="checkResult" column="check_result"/>
        <result property="whetherDanger" column="whether_danger"/>
        <result property="checkType" column="check_type"/>
    </resultMap>
    <select id="selectBaseCheckPointListByCheckId" parameterType="BaseCheckPointDTO"
            resultMap="BaseCheckPointDTOResult">
        SELECT bcp.check_point_id, bcp.create_by, bcp.create_time, bcp.update_by, bcp.update_time, bcp.remark,
        bcp.check_content, bcp.check_result,bcp.check_type,
        hdcp.id,hdcp.check_id,
        hdcp.whether_danger
        FROM
        tr_hidden_danger_check_point hdcp
        LEFT JOIN
        tr_base_check_point AS bcp
        ON
        hdcp.check_point_id = bcp.`check_point_id`
        <where>
            <if test="id != null  and id != ''">and hdcp.id = #{id}</if>
            <if test="checkPointId != null  and checkPointId != ''">and hdcp.check_point_id = #{checkPointId}</if>
            <if test="checkId != null  and checkId != ''">and hdcp.check_id = #{checkId}</if>
        </where>
        order by bcp.create_time DESC
    </select>
    <!--    HiddenDangerCheckPoint getHiddenDangerCheckPointById(Long dangerCheckPointId);-->
    <select id="getHiddenDangerCheckPointById" parameterType="HiddenDangerCheckPoint" resultMap="HiddenDangerCheckPointResult">
        select * from tr_hidden_danger_check_point
        where id = #{dangerCheckPointId}
    </select>
<!--    List<HiddenDangerCheckPoint> getHiddenDangerCheckPointByCheckId(Long checkId);-->
    <select id="getHiddenDangerCheckPointByCheckId" parameterType="HiddenDangerCheckPoint" resultMap="HiddenDangerCheckPointResult">
        select * from tr_hidden_danger_check_point
        where check_id = #{checkId}
    </select>
<!--    int rectifyTimeOut(HiddenDangerCheckPoint hdcp);-->
    <update id="rectifyTimeOut" parameterType="HiddenDangerCheckPoint">
        update tr_hidden_danger_check_point set
            rectify_deadline_time = #{rectifyDeadlineTime}
        where id = #{id}
    </update>
<!--    int updateConfirm(HiddenDangerCheckPoint hdcp);-->
    <update id="updateConfirm" parameterType="HiddenDangerCheckPoint">
        update tr_hidden_danger_check_point set
        examine_user_id = #{examineUserId},
        examine_user_name = #{examineUserName}
        where id = #{id}
    </update>
<!--    List<HiddenDangerCheckPoint> selectHiddenDangerCheckPointListNew(HiddenDangerCheckPoint hiddenDangerCheckPoint);-->
    <!-- todo 导出隐患台账-->
    <select id="selectHiddenDangerCheckPointListNew" parameterType="HiddenDangerCheckPoint"
            resultMap="HiddenDangerCheckPointResult">
        <include refid="selectHiddenDangerCheckPointVo"/>
        <where>
            danger_name is not null
            <if test="id != null  and id != ''">and a.id = #{id}</if>
            <if test="checkPointId != null  and checkPointId != ''">and a.check_point_id = #{checkPointId}</if>
            <if test="checkId != null  and checkId != ''">and a.check_id = #{checkId}</if>
@@ -261,7 +1019,7 @@
                a.plan_formulate_status != #{planFormulateStatusExclude}
            </if>
            <if test="judgeQueryByUserId != null  and judgeQueryByUserId != ''">
                and a.danger_sources = 2
<!--                and a.danger_sources = 2-->
                and (a.register_user_id = #{judgeQueryByUserId} or (a.judge_user_id = #{judgeQueryByUserId} and
                a.report_status IS NOT NULL) )
            </if>
@@ -272,10 +1030,6 @@
                <foreach collection="judgeQueryByUserIdList" item="judgeQueryByUserId" open="(" separator="," close=")">
                    #{judgeQueryByUserId}
                </foreach>)
            </if>
            <if test="reportStatusByHasHandle != null  and reportStatusByHasHandle != ''">and (a.report_status = 1 or
                a.report_status = 2)
            </if>
            <if test="reportStatusIsNotNull != null  and reportStatusIsNotNull != ''">and (a.report_status IS NOT
                NULL)
@@ -341,7 +1095,7 @@
            <if test="companyId != null  and companyId != ''">and a.company_id  = #{companyId}</if>
            <if test="rectifyUserIdIsNotNull != null  and rectifyUserIdIsNotNull != ''">and a.rectify_user_id is not null</if>
<!--            <if test="rectifyUserIdIsNotNull != null  and rectifyUserIdIsNotNull != ''">and a.rectify_user_id is not null</if>-->
            <if test="null != companyIdList  and companyIdList.size() > 0">
                and (a.company_id in
@@ -349,327 +1103,22 @@
                    #{companyId}
                </foreach>)
            </if>
<!--            <if test="reportStatusByHasHandle != null  and reportStatusByHasHandle != ''">and (a.report_status = 0 or a.report_status = 1 or-->
<!--                a.report_status = 2)-->
<!--            </if>-->
            and (a.whether_danger = 1 or a.whether_danger is null)
        </where>
        order by a.create_time desc
    </select>
    <select id="selectHiddenDangerCheckPointById" parameterType="Long" resultMap="HiddenDangerCheckPointResult">
        <include refid="selectHiddenDangerCheckPointVo"/>
        where a.id = #{id}
    </select>
    <insert id="insertHiddenDangerCheckPoint" parameterType="HiddenDangerCheckPoint" useGeneratedKeys="true" keyProperty="id">
        insert into tr_hidden_danger_check_point
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null ">id,</if>
            <if test="checkPointId != null ">check_point_id,</if>
            <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="whetherDanger != null  and whetherDanger != ''">whether_danger,</if>
            <if test="dangerName != null  and dangerName != ''">danger_name,</if>
            <if test="dangerDescription != null  and dangerDescription != ''">danger_description,</if>
            <if test="dangerLevel != null  and dangerLevel != ''">danger_level,</if>
            <if test="troubleTypeId != null ">trouble_type_id,</if>
            <if test="troubleTypeName != null  and troubleTypeName != ''">trouble_type_name,</if>
            <if test="checkTime != null ">check_time,</if>
            <if test="preRectifyPhoto != null  and preRectifyPhoto != ''">pre_rectify_photo,</if>
            <if test="registerUserId != null  and registerUserId != ''">register_user_id,</if>
            <if test="registerUserName != null  and registerUserName != ''">register_user_name,</if>
            <if test="registerCreateTime != null ">register_create_time,</if>
            <if test="registerSubmitTime != null ">register_submit_time,</if>
            <if test="judgeUserId != null  and judgeUserId != ''">judge_user_id,</if>
            <if test="judgeUserName != null  and judgeUserName != ''">judge_user_name,</if>
            <if test="judgeCreateTime != null ">judge_create_time,</if>
            <if test="judgeCreateUserId != null  and judgeCreateUserId != ''">judge_create_user_id,</if>
            <if test="dangerSources != null  and dangerSources != ''">danger_sources,</if>
            <if test="reportStatus != null  and reportStatus != ''">report_status,</if>
            <if test="examineUserId != null ">examine_user_id,</if>
            <if test="examineUserName != null  and examineUserName != ''">examine_user_name,</if>
            <if test="examineStatus != null  and examineStatus != ''">examine_status,</if>
            <if test="examineOpinion != null  and examineOpinion != ''">examine_opinion,</if>
            <if test="examineResult != null  and examineResult != ''">examine_result,</if>
            <if test="examineCreateTime != null ">examine_create_time,</if>
            <if test="treatMeasure != null  and treatMeasure != ''">treat_measure,</if>
            <if test="rectifyUserId != null ">rectify_user_id,</if>
            <if test="rectifyUserName != null  and rectifyUserName != ''">rectify_user_name,</if>
            <if test="rectifyDeptId != null ">rectify_dept_id,</if>
            <if test="rectifyDeptName != null  and rectifyDeptName != ''">rectify_dept_name,</if>
            <if test="rectifyDeadlineTime != null ">rectify_deadline_time,</if>
            <if test="rectifyType != null  and rectifyType != ''">rectify_type,</if>
            <if test="rectifyAttachment != null  and rectifyAttachment != ''">rectify_attachment,</if>
            <if test="rectifyMeasure != null  and rectifyMeasure != ''">rectify_measure,</if>
            <if test="rectifyCondition != null  and rectifyCondition != ''">rectify_condition,</if>
            <if test="rectifyFund != null  and rectifyFund != ''">rectify_fund,</if>
            <if test="rectifyCompleteTime != null ">rectify_complete_time,</if>
            <if test="rectifyStatus != null  and rectifyStatus != ''">rectify_status,</if>
            <if test="rectifyCreateTime != null ">rectify_create_time,</if>
            <if test="acceptUserId != null ">accept_user_id,</if>
            <if test="acceptUserName != null  and acceptUserName != ''">accept_user_name,</if>
            <if test="postRectifyPhoto != null  and postRectifyPhoto != ''">post_rectify_photo,</if>
            <if test="acceptResult != null  and acceptResult != ''">accept_result,</if>
            <if test="acceptOpinion != null  and acceptOpinion != ''">accept_opinion,</if>
            <if test="acceptFile != null  and acceptFile != ''">accept_file,</if>
            <if test="acceptCreateTime != null ">accept_create_time,</if>
            <if test="acceptStatus != null  and acceptStatus != ''">accept_status,</if>
            <if test="stage != null  and stage != ''">stage,</if>
            <if test="scheduleCheckStatus != null  and scheduleCheckStatus != ''">schedule_check_status,</if>
            <if test="checkType != null  and checkType != ''">check_type,</if>
            <if test="companyId != null  and companyId != ''">company_id,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null ">#{id},</if>
            <if test="checkPointId != null ">#{checkPointId},</if>
            <if test="checkId != null ">#{checkId},</if>
            <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="whetherDanger != null  and whetherDanger != ''">#{whetherDanger},</if>
            <if test="dangerName != null  and dangerName != ''">#{dangerName},</if>
            <if test="dangerDescription != null  and dangerDescription != ''">#{dangerDescription},</if>
            <if test="dangerLevel != null  and dangerLevel != ''">#{dangerLevel},</if>
            <if test="troubleTypeId != null ">#{troubleTypeId},</if>
            <if test="troubleTypeName != null  and troubleTypeName != ''">#{troubleTypeName},</if>
            <if test="checkTime != null ">#{checkTime},</if>
            <if test="preRectifyPhoto != null  and preRectifyPhoto != ''">#{preRectifyPhoto},</if>
            <if test="registerUserId != null  and registerUserId != ''">#{registerUserId},</if>
            <if test="registerUserName != null  and registerUserName != ''">#{registerUserName},</if>
            <if test="registerCreateTime != null ">#{registerCreateTime},</if>
            <if test="registerSubmitTime != null ">#{registerSubmitTime},</if>
            <if test="judgeUserId != null  and judgeUserId != ''">#{judgeUserId},</if>
            <if test="judgeUserName != null  and judgeUserName != ''">#{judgeUserName},</if>
            <if test="judgeCreateTime != null ">#{judgeCreateTime},</if>
            <if test="judgeCreateUserId != null  and judgeCreateUserId != ''">#{judgeCreateUserId},</if>
            <if test="dangerSources != null  and dangerSources != ''">#{dangerSources},</if>
            <if test="reportStatus != null  and reportStatus != ''">#{reportStatus},</if>
            <if test="examineUserId != null ">#{examineUserId},</if>
            <if test="examineUserName != null  and examineUserName != ''">#{examineUserName},</if>
            <if test="examineStatus != null  and examineStatus != ''">#{examineStatus},</if>
            <if test="examineOpinion != null  and examineOpinion != ''">#{examineOpinion},</if>
            <if test="examineResult != null  and examineResult != ''">#{examineResult},</if>
            <if test="examineCreateTime != null ">#{examineCreateTime},</if>
            <if test="treatMeasure != null  and treatMeasure != ''">#{treatMeasure},</if>
            <if test="rectifyUserId != null ">#{rectifyUserId},</if>
            <if test="rectifyUserName != null  and rectifyUserName != ''">#{rectifyUserName},</if>
            <if test="rectifyDeptId != null ">#{rectifyDeptId},</if>
            <if test="rectifyDeptName != null  and rectifyDeptName != ''">#{rectifyDeptName},</if>
            <if test="rectifyDeadlineTime != null ">#{rectifyDeadlineTime},</if>
            <if test="rectifyType != null  and rectifyType != ''">#{rectifyType},</if>
            <if test="rectifyAttachment != null  and rectifyAttachment != ''">#{rectifyAttachment},</if>
            <if test="rectifyMeasure != null  and rectifyMeasure != ''">#{rectifyMeasure},</if>
            <if test="rectifyCondition != null  and rectifyCondition != ''">#{rectifyCondition},</if>
            <if test="rectifyFund != null  and rectifyFund != ''">#{rectifyFund},</if>
            <if test="rectifyCompleteTime != null ">#{rectifyCompleteTime},</if>
            <if test="rectifyStatus != null  and rectifyStatus != ''">#{rectifyStatus},</if>
            <if test="rectifyCreateTime != null ">#{rectifyCreateTime},</if>
            <if test="acceptUserId != null ">#{acceptUserId},</if>
            <if test="acceptUserName != null  and acceptUserName != ''">#{acceptUserName},</if>
            <if test="postRectifyPhoto != null  and postRectifyPhoto != ''">#{postRectifyPhoto},</if>
            <if test="acceptResult != null  and acceptResult != ''">#{acceptResult},</if>
            <if test="acceptOpinion != null  and acceptOpinion != ''">#{acceptOpinion},</if>
            <if test="acceptFile != null  and acceptFile != ''">#{acceptFile},</if>
            <if test="acceptCreateTime != null ">#{acceptCreateTime},</if>
            <if test="acceptStatus != null  and acceptStatus != ''">#{acceptStatus},</if>
            <if test="stage != null  and stage != ''">#{stage},</if>
            <if test="scheduleCheckStatus != null  and scheduleCheckStatus != ''">#{scheduleCheckStatus},</if>
            <if test="checkType != null  and checkType != ''">#{checkType},</if>
            <if test="companyId != null  and companyId != ''">#{companyId},</if>
        </trim>
    </insert>
    <update id="updateHiddenDangerCheckPoint" parameterType="HiddenDangerCheckPoint">
        update tr_hidden_danger_check_point
        <trim prefix="SET" suffixOverrides=",">
            <if test="checkPointId != null  and checkPointId != ''">check_point_id = #{checkPointId},</if>
            <if test="checkId != null  and checkId != ''">check_id = #{checkId},</if>
            <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="whetherDanger != null  and whetherDanger != ''">whether_danger = #{whetherDanger},</if>
            <if test="dangerName != null  and dangerName != ''">danger_name = #{dangerName},</if>
            <if test="dangerDescription != null  and dangerDescription != ''">danger_description =
                #{dangerDescription},
            </if>
            <if test="dangerLevel != null  and dangerLevel != ''">danger_level = #{dangerLevel},</if>
            <if test="troubleTypeId != null ">trouble_type_id = #{troubleTypeId},</if>
            <if test="troubleTypeName != null  and troubleTypeName != ''">trouble_type_name = #{troubleTypeName},</if>
            <if test="checkTime != null ">check_time = #{checkTime},</if>
            <if test="preRectifyPhoto != null  and preRectifyPhoto != ''">pre_rectify_photo = #{preRectifyPhoto},</if>
            <if test="registerUserId != null  and registerUserId != ''">register_user_id = #{registerUserId},</if>
            <if test="registerUserName != null  and registerUserName != ''">register_user_name = #{registerUserName},
            </if>
            <if test="registerCreateTime != null ">register_create_time = #{registerCreateTime},</if>
            <if test="registerSubmitTime != null ">register_submit_time = #{registerSubmitTime},</if>
            <if test="judgeUserId != null  and judgeUserId != ''">judge_user_id = #{judgeUserId},</if>
            <if test="judgeUserName != null  and judgeUserName != ''">judge_user_name = #{judgeUserName},</if>
            <if test="judgeCreateTime != null ">judge_create_time = #{judgeCreateTime},</if>
            <if test="judgeCreateUserId != null  and judgeCreateUserId != ''">judge_create_user_id =
                #{judgeCreateUserId},
            </if>
            <if test="dangerSources != null  and dangerSources != ''">danger_sources = #{dangerSources},</if>
            <if test="reportStatus != null  and reportStatus != ''">report_status = #{reportStatus},</if>
            <if test="examineUserId != null ">examine_user_id = #{examineUserId},</if>
            <if test="examineUserName != null  and examineUserName != ''">examine_user_name = #{examineUserName},</if>
            <if test="examineStatus != null  and examineStatus != ''">examine_status = #{examineStatus},</if>
            <if test="examineOpinion != null  and examineOpinion != ''">examine_opinion = #{examineOpinion},</if>
            <if test="examineResult != null  and examineResult != ''">examine_result = #{examineResult},</if>
            <if test="examineCreateTime != null ">examine_create_time = #{examineCreateTime},</if>
            <if test="treatMeasure != null  and treatMeasure != ''">treat_measure = #{treatMeasure},</if>
            <if test="rectifyUserId != null ">rectify_user_id = #{rectifyUserId},</if>
            <if test="rectifyUserName != null  and rectifyUserName != ''">rectify_user_name = #{rectifyUserName},</if>
            <if test="rectifyDeptId != null ">rectify_dept_id = #{rectifyDeptId},</if>
            <if test="rectifyDeptName != null  and rectifyDeptName != ''">rectify_dept_name = #{rectifyDeptName},</if>
            <if test="rectifyDeadlineTime != null ">rectify_deadline_time = #{rectifyDeadlineTime},</if>
            <if test="rectifyType != null  and rectifyType != ''">rectify_type = #{rectifyType},</if>
            <if test="rectifyAttachment != null  and rectifyAttachment != ''">rectify_attachment =
                #{rectifyAttachment},
            </if>
            <if test="rectifyMeasure != null  and rectifyMeasure != ''">rectify_measure = #{rectifyMeasure},</if>
            <if test="rectifyCondition != null  and rectifyCondition != ''">rectify_condition = #{rectifyCondition},
            </if>
            <if test="rectifyFund != null  and rectifyFund != ''">rectify_fund = #{rectifyFund},</if>
            <if test="rectifyCompleteTime != null ">rectify_complete_time = #{rectifyCompleteTime},</if>
            <if test="rectifyStatus != null  and rectifyStatus != ''">rectify_status = #{rectifyStatus},</if>
            <if test="rectifyCreateTime != null ">rectify_create_time = #{rectifyCreateTime},</if>
            <if test="acceptUserId != null ">accept_user_id = #{acceptUserId},</if>
            <if test="acceptUserName != null  and acceptUserName != ''">accept_user_name = #{acceptUserName},</if>
            <if test="postRectifyPhoto != null  and postRectifyPhoto != ''">post_rectify_photo = #{postRectifyPhoto},
            </if>
            <if test="acceptResult != null  and acceptResult != ''">accept_result = #{acceptResult},</if>
            <if test="acceptOpinion != null  and acceptOpinion != ''">accept_opinion = #{acceptOpinion},</if>
            <if test="acceptFile != null  and acceptFile != ''">accept_file = #{acceptFile},</if>
            <if test="acceptCreateTime != null ">accept_create_time = #{acceptCreateTime},</if>
            <if test="acceptStatus != null  and acceptStatus != ''">accept_status = #{acceptStatus},</if>
            <if test="stage != null  and stage != ''">stage = #{stage},</if>
            <if test="scheduleCheckStatus != null  and scheduleCheckStatus != ''">schedule_check_status =
                #{scheduleCheckStatus},
            </if>
            <if test="checkType != null  and checkType != ''">check_type = #{checkType},</if>
        </trim>
<!--    int editDangerLevel(HiddenDangerCheckPoint hdcp);-->
    <update id="editDangerLevel" parameterType="HiddenDangerCheckPoint">
        update tr_hidden_danger_check_point set
        trouble_type_name = #{troubleTypeName},
        update_by = #{updateBy},
        update_time = #{updateTime}
        where id = #{id}
    </update>
    <delete id="deleteHiddenDangerCheckPointById" parameterType="Long">
        delete from tr_hidden_danger_check_point where id = #{id}
    </delete>
    <delete id="deleteHiddenDangerCheckPointByIds" parameterType="String">
        delete from tr_hidden_danger_check_point where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
    <resultMap type="RiskCheckPointDTO" id="RiskCheckPointDTOResult">
        <result property="id" column="id"/>
        <result property="checkPointId" column="check_point_id"/>
        <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="sclJianchaXiangmu" column="SCL_jiancha_xiangmu"/>
        <result property="sclJianchaMubiao" column="SCL_jiancha_mubiao"/>
        <result property="sclQingkuang" column="SCL_qingkuang"/>
        <result property="sclZhuyaoHouguo" column="SCL_zhuyao_houguo"/>
        <result property="jhaZuoyeBuzhou" column="JHA_zuoye_buzhou"/>
        <result property="jhaWeixianyuan" column="JHA_weixianyuan"/>
        <result property="jhaShiguLeixing" column="JHA_shigu_leixing"/>
        <result property="hazopJiedian" column="HAZOP_jiedian"/>
        <result property="hazopCanshu" column="HAZOP_canshu"/>
        <result property="hazopCanshuMiaoshu" column="HAZOP_canshu_miaoshu"/>
        <result property="hazopYindaoci" column="HAZOP_yindaoci"/>
        <result property="hazopPiancha" column="HAZOP_piancha"/>
        <result property="hazopYuanyin" column="HAZOP_yuanyin"/>
        <result property="hazopHouguo" column="HAZOP_houguo"/>
        <result property="whetherDanger" column="whether_danger"/>
        <result property="evaluationAfterJishu" column="evaluation_after_jishu"/>
        <result property="evaluationAfterGuanli" column="evaluation_after_guanli"/>
        <result property="evaluationAfterJiaoyu" column="evaluation_after_jiaoyu"/>
        <result property="evaluationAfterFanghu" column="evaluation_after_fanghu"/>
        <result property="evaluationAfterYingji" column="evaluation_after_yingji"/>
    </resultMap>
    <select id="selectRiskCheckPointListByCheckId" parameterType="RiskCheckPointDTO"
            resultMap="RiskCheckPointDTOResult">
        SELECT rcp.check_point_id, rcp.create_by, rcp.create_time, rcp.update_by, rcp.update_time, rcp.remark,
        rcp.SCL_jiancha_xiangmu, rcp.SCL_jiancha_mubiao, rcp.SCL_qingkuang, rcp.SCL_zhuyao_houguo,
        rcp.JHA_zuoye_buzhou, rcp.JHA_weixianyuan, rcp.JHA_shigu_leixing,
        rcp.HAZOP_jiedian, rcp.HAZOP_canshu, rcp.HAZOP_canshu_miaoshu, rcp.HAZOP_yindaoci,
        rcp.HAZOP_piancha, rcp.HAZOP_yuanyin, rcp.HAZOP_houguo,
        rcp.evaluation_after_jishu, rcp.evaluation_after_guanli, rcp.evaluation_after_jiaoyu,
        rcp.evaluation_after_fanghu, rcp.evaluation_after_yingji,
        hdcp.id,hdcp.check_id,
        hdcp.whether_danger
        FROM
        tr_hidden_danger_check_point hdcp
        LEFT JOIN
        tr_risk_check_point AS rcp
        ON
        hdcp.check_point_id = rcp.`check_point_id`
        <where>
            <if test="id != null  and id != ''">and hdcp.id = #{id}</if>
            <if test="checkPointId != null  and checkPointId != ''">and hdcp.check_point_id = #{checkPointId}</if>
            <if test="checkId != null  and checkId != ''">and hdcp.check_id = #{checkId}</if>
        </where>
        order by rcp.create_time DESC
    </select>
    <resultMap type="BaseCheckPointDTO" id="BaseCheckPointDTOResult">
        <result property="id" column="id"/>
        <result property="checkPointId" column="check_point_id"/>
        <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="checkContent" column="check_content"/>
        <result property="checkResult" column="check_result"/>
        <result property="whetherDanger" column="whether_danger"/>
        <result property="checkType" column="check_type"/>
    </resultMap>
    <select id="selectBaseCheckPointListByCheckId" parameterType="BaseCheckPointDTO"
            resultMap="BaseCheckPointDTOResult">
        SELECT bcp.check_point_id, bcp.create_by, bcp.create_time, bcp.update_by, bcp.update_time, bcp.remark,
        bcp.check_content, bcp.check_result,bcp.check_type,
        hdcp.id,hdcp.check_id,
        hdcp.whether_danger
        FROM
        tr_hidden_danger_check_point hdcp
        LEFT JOIN
        tr_base_check_point AS bcp
        ON
        hdcp.check_point_id = bcp.`check_point_id`
        <where>
            <if test="id != null  and id != ''">and hdcp.id = #{id}</if>
            <if test="checkPointId != null  and checkPointId != ''">and hdcp.check_point_id = #{checkPointId}</if>
            <if test="checkId != null  and checkId != ''">and hdcp.check_id = #{checkId}</if>
        </where>
        order by bcp.create_time DESC
    </select>
</mapper>