马宇豪
2023-08-25 aa2051a2327c079105110f5424f3a44ffaa0c7bb
src/main/resources/mybatis/doublePrevention/PreventRiskDangerInfoMapper.xml
@@ -12,6 +12,7 @@
        <result column="danger_reason" property="dangerReason"/>
        <result column="hazard_danger_type" property="hazardDangerType"/>
        <result column="danger_state" property="dangerState"/>
        <result column="danger_result" property="dangerResult"/>
        <result column="timeout_flag" property="timeoutFlag"/>
        <result column="report_time" property="reportTime"/>
        <result column="update_report_data_time" property="updateReportDataTime"/>
@@ -23,7 +24,7 @@
<!--    int insertDangerInfo(PreventRiskDangerInfo dangerInfo);-->
    <insert id="insertDangerInfo">
        insert into prevent_risk_danger_info values
        (null, #{uuid}, #{dangerCheckPointId}, #{hazardCode}, #{dangerSrc}, #{dangerDesc}, #{dangerReason}, #{hazardDangerType}, #{dangerState},
        (null, #{uuid}, #{dangerCheckPointId}, #{hazardCode}, #{dangerSrc}, #{dangerDesc}, #{dangerReason}, #{dangerResult}, #{hazardDangerType}, #{dangerState},
            #{timeoutFlag}, #{reportTime}, #{updateReportDataTime}, #{reportStatus}, #{reportSwitch})
    </insert>
@@ -36,6 +37,7 @@
            danger_reason = #{dangerReason},
            hazard_danger_type = #{hazardDangerType},
            danger_state = #{dangerState},
            danger_result =#{dangerResult},
            timeout_flag = #{timeoutFlag},
            update_report_data_time = #{updateReportDataTime},
            report_status = #{reportStatus},
@@ -75,5 +77,38 @@
        </if>
    </select>
<!--    int updateDangerInfoState(PreventRiskDangerInfo dangerInfo);-->
    <update id="updateDangerInfoState">
        update prevent_risk_danger_info set
            danger_state = #{dangerState},
            update_report_data_time = #{updateReportDataTime},
            report_status = #{reportStatus},
            report_switch = #{reportSwitch}
        where danger_check_point_id = #{dangerCheckPointId}
    </update>
<!--    List<PreventRiskDangerInfo> listReportDanger();-->
    <select id="listReportDanger" resultMap="BaseResultMap">
<!--        select * from prevent_risk_danger_info-->
<!--        where report_switch = 0 and (update_report_data_time > report_time or report_time is null) and (hazard_code !='' or hazard_code != null )-->
        select * from prevent_risk_danger_info
        where report_switch = 0 and (update_report_data_time > report_time or report_time is null) and (hazard_code !='' or hazard_code != null) and danger_state = 9
    </select>
<!--    PreventRiskDangerInfo updateDangerInfoReportStatus(HandlerReportParam handlerReportParam);-->
    <select id="updateDangerInfoReportStatus">
        update prevent_risk_danger_info set
            report_status =  #{reportStatus},
            report_time = #{reportTime}
        where id = #{id}
    </select>
<!--    PreventRiskDangerInfo getByHiddenDangerId(Long id);resultType="com.ruoyi.doublePrevention.entity.PreventRiskDangerInfo"-->
    <select id="getByHiddenDangerId" resultMap="BaseResultMap">
        select * from prevent_risk_danger_info
        where danger_check_point_id = #{id}
    </select>
</mapper>