| | |
| | | <result column="update_report_data_time" property="updateReportDataTime"/> |
| | | <result column="report_switch" property="reportSwitch"/> |
| | | </resultMap> |
| | | <update id="deletePreventRiskEventById"> |
| | | update prevent_risk_event |
| | | <set> |
| | | <if test="preventRiskEvent.gmtModitify != null "> |
| | | gmt_moditify = #{preventRiskEvent.gmtModitify}, |
| | | </if> |
| | | <if test="preventRiskEvent.lastEditUserName != null "> |
| | | last_edit_user_name = #{preventRiskEvent.lastEditUserName}, |
| | | </if> |
| | | delete_status = 1 where id = #{id} |
| | | </set> |
| | | </update> |
| | | |
| | | <!--IPage<PreventRiskEvent> getRiskUnitPage(PreventRiskEventQueryReqDTO riskEventQueryReqDTO);--> |
| | | <select id="getRiskEventPage" resultMap="BaseResultMap"> |
| | | |
| | | <update id="updatePreventRiskEventById"> |
| | | update prevent_risk_event |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="deleteStatus != null ">delete_status = #{deleteStatus},</if> |
| | | <if test="riskUnitId != null ">risk_unit_id = #{riskUnitId},</if> |
| | | <if test="enterpriseId != null ">enterprise_id = #{enterpriseId},</if> |
| | | <if test="enterpriseUuid != null ">enterprise_uuid = #{enterpriseUuid},</if> |
| | | <if test="riskUnitUuid != null ">risk_unit_uuid = #{riskUnitUuid},</if> |
| | | <if test="createByUserName != null and createByUserName != '' ">create_by_user_name = #{createByUserName},</if> |
| | | <if test="lastEditUserName != null and lastEditUserName != ''">last_edit_user_name = #{lastEditUserName},</if> |
| | | <if test="eventResult != null and eventResult != '' ">event_result = #{eventResult},</if> |
| | | <if test="riskEventName != null and riskEventName != ''">risk_event_name = #{riskEventName},</if> |
| | | <if test="reportStatus != null ">report_status = #{reportStatus},</if> |
| | | <if test="reportTime != null ">report_time = #{reportTime},</if> |
| | | <if test="updateReportDataTime != null ">update_report_data_time = #{updateReportDataTime},</if> |
| | | <if test="reportSwitch != null ">report_switch = #{reportSwitch},</if> |
| | | </trim> |
| | | </update> |
| | | |
| | | |
| | | <insert id="savePreventRiskEvent" parameterType="com.ruoyi.doublePrevention.entity.PreventRiskEvent"> |
| | | insert into prevent_risk_event |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="uuid != null ">uuid,</if> |
| | | <if test="deleteStatus != null ">delete_status,</if> |
| | | <if test="riskUnitId != null ">risk_unit_id,</if> |
| | | <if test="enterpriseId != null ">enterprise_id,</if> |
| | | <if test="enterpriseUuid != null ">enterprise_uuid,</if> |
| | | <if test="riskUnitUuid != null ">risk_unit_uuid,</if> |
| | | <if test="gmtCreate != null ">gmt_create,</if> |
| | | <if test="gmtModitify != null ">gmt_moditify,</if> |
| | | <if test="createByUserName != null and createByUserName != '' ">create_by_user_name,</if> |
| | | <if test="lastEditUserName != null and lastEditUserName != ''">last_edit_user_name,</if> |
| | | <if test="eventResult != null and eventResult != '' ">event_result,</if> |
| | | <if test="riskEventName != null and riskEventName != ''">risk_event_name,</if> |
| | | <if test="reportStatus != null ">report_status,</if> |
| | | <if test="reportTime != null ">report_time,</if> |
| | | <if test="updateReportDataTime != null ">update_report_data_time,</if> |
| | | <if test="reportSwitch != null ">report_switch,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="uuid != null ">uuid,</if> |
| | | <if test="deleteStatus != null ">#{deleteStatus},</if> |
| | | <if test="riskUnitId != null ">#{riskUnitId},</if> |
| | | <if test="enterpriseId != null ">#{enterpriseId},</if> |
| | | <if test="enterpriseUuid != null ">#{enterpriseUuid},</if> |
| | | <if test="riskUnitUuid != null ">#{riskUnitUuid},</if> |
| | | <if test="gmtCreate != null ">#{gmtCreate},</if> |
| | | <if test="gmtModitify != null ">#{gmtModitify},</if> |
| | | <if test="createByUserName != null and createByUserName != '' ">#{createByUserName},</if> |
| | | <if test="lastEditUserName != null and lastEditUserName != ''">#{lastEditUserName},</if> |
| | | <if test="eventResult != null and eventResult != '' ">#{eventResult},</if> |
| | | <if test="riskEventName != null and riskEventName != ''">#{riskEventName},</if> |
| | | <if test="reportStatus != null ">#{reportStatus},</if> |
| | | <if test="reportTime != null ">#{reportTime},</if> |
| | | <if test="updateReportDataTime != null ">#{updateReportDataTime},</if> |
| | | <if test="reportSwitch != null ">#{reportSwitch},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <select id="getPreventRiskEventById" resultType="com.ruoyi.doublePrevention.entity.PreventRiskEvent"> |
| | | select * from prevent_risk_event |
| | | <where> |
| | | delete_status = 0 |
| | | <if test="queryParams.riskEventName != null"> |
| | | and risk_event_name like '%' #{queryParams.riskEventName} '%' |
| | | </if> |
| | | <if test="queryParams.riskUnitId != null"> |
| | | and risk_unit_id = #{queryParams.riskUnitId} |
| | | </if> |
| | | </where> |
| | | order by gmt_create desc |
| | | </select> |
| | | |
| | | <!--PreventRiskEvent getRiskEventByName(String riskEventName);--> |
| | | <select id="getRiskEventByName" resultType="com.ruoyi.doublePrevention.entity.PreventRiskEvent"> |
| | | select |
| | | id, |
| | | uuid, |
| | | risk_event_name |
| | | from prevent_risk_event |
| | | where delete_status = 0 and risk_event_name = #{riskEventName} |
| | | </select> |
| | | |
| | | <!--PreventRiskEvent getRiskEventNameById(Long id);--> |
| | | <select id="getRiskEventNameById" resultType="com.ruoyi.doublePrevention.entity.PreventRiskEvent"> |
| | | select |
| | | id, |
| | | uuid, |
| | | risk_event_name, |
| | | report_switch |
| | | from prevent_risk_event |
| | | where delete_status = 0 and id = #{id} |
| | | </select> |
| | | <!--List<PreventRiskEvent> getRiskEventNameByRiskUnitId(Long riskUnitId);--> |
| | | <select id="getRiskEventNameByRiskUnitId" resultMap="BaseResultMap"> |
| | | select |
| | | id, |
| | | risk_event_name |
| | | from prevent_risk_event |
| | | where delete_status = 0 and risk_unit_id = #{riskUnitId} |
| | | </select> |
| | | |
| | | <!--List<PreventRiskEvent> getListEvents();--> |
| | | <select id="getListEvents" resultMap="BaseResultMap"> |
| | | select |
| | | id, |
| | | uuid, |
| | | risk_event_name |
| | | from prevent_risk_event |
| | | where delete_status = 0 |
| | | </select> |
| | | |
| | | <!--int updateRiskEventReport(PreventHandReportConfigReqDTO preventHandReportConfigReqDTO);--> |
| | | <update id="updateRiskEventReport"> |
| | | update prevent_risk_ana_unit set |
| | | report_switch = #{reportSwitch} |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <!--int updateRiskEvent(PreventRiskEventUpdateParams updateParams);--> |
| | | <update id="updateRiskEvent"> |
| | | update prevent_risk_event set |
| | | risk_event_name = #{riskEventName}, |
| | | risk_unit_id = #{riskUnitId}, |
| | | risk_unit_uuid = #{riskUnitUuid}, |
| | | event_result = #{eventResult}, |
| | | gmt_moditify = #{gmtModitify}, |
| | | last_edit_user_name = #{lastEditUserName}, |
| | | update_report_data_time = #{updateReportDataTime}, |
| | | report_status = #{reportStatus}, |
| | | report_switch = #{reportSwitch} |
| | | where delete_status = 0 and id = #{id} |
| | | </update> |
| | | |
| | | <!--int deleteRiskEventById(PreventRiskEventDeleteReqDTO riskEventDeleteReqDTO);--> |
| | | <update id="deleteRiskEventById"> |
| | | update prevent_risk_event set |
| | | delete_status = 1, |
| | | last_edit_user_name = #{lastEditUserName}, |
| | | gmt_moditify = #{gmtModitify}, |
| | | update_report_data_time = #{updateReportDataTime} |
| | | where delete_status = 0 and id = #{id} |
| | | </update> |
| | | |
| | | <!--int updateEventReportStatus(Long id, byte code);--> |
| | | <update id="updateEventReportStatus"> |
| | | update prevent_risk_event set |
| | | report_status = #{reportStatus}, |
| | | report_time = #{reportTime} |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | |
| | | |
| | | |
| | | <!--List<PreventRiskEvent> listReportEvent();--> |
| | | <select id="listReportEvent" resultMap="BaseResultMap"> |
| | | select * from prevent_risk_event |
| | | where report_switch = 1 and (update_report_data_time > report_time or report_time is null) |
| | | where id = #{id} and delete_status = 0 |
| | | </select> |
| | | |
| | | |