| | |
| | | <mapper namespace="com.ruoyi.doublePrevention.repository.PreventRiskEventRepository" > |
| | | |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.doublePrevention.entity.PreventRiskEvent"> |
| | | <id column="id" property="id" jdbcType="BIGINT" /> |
| | | <result column="uuid" property="uuid" jdbcType="CHAR"/> |
| | | <result column="delete_status" property="deleteStatus" jdbcType="TINYINT"/> |
| | | <result column="risk_unit_id" property="riskUnitId" jdbcType="BIGINT"/> |
| | | <result column="enterprise_id" property="enterpriseId" jdbcType="BIGINT"/> |
| | | <result column="enterprise_uuid" property="enterpriseUuid" jdbcType="CHAR"/> |
| | | <result column="risk_unit_uuid" property="riskUnitUuid" jdbcType="CHAR"/> |
| | | <result column="gmt_create" property="gmtCreate" jdbcType="TIMESTAMP"/> |
| | | <result column="gmt_moditify" property="gmtModitify" jdbcType="TIMESTAMP"/> |
| | | <result column="create_by_user_name" property="createByUserName" jdbcType="VARCHAR"/> |
| | | <result column="last_edit_user_name" property="lastEditUserName" jdbcType="VARCHAR"/> |
| | | <id column="id" property="id" /> |
| | | <result column="uuid" property="uuid"/> |
| | | <result column="delete_status" property="deleteStatus"/> |
| | | <result column="risk_unit_id" property="riskUnitId"/> |
| | | <result column="enterprise_id" property="enterpriseId"/> |
| | | <result column="enterprise_uuid" property="enterpriseUuid"/> |
| | | <result column="risk_unit_uuid" property="riskUnitUuid"/> |
| | | <result column="gmt_create" property="gmtCreate"/> |
| | | <result column="gmt_moditify" property="gmtModitify"/> |
| | | <result column="create_by_user_name" property="createByUserName"/> |
| | | <result column="last_edit_user_name" property="lastEditUserName"/> |
| | | <result column="event_result" property="eventResult"/> |
| | | <result column="risk_event_name" property="riskEventName" jdbcType="VARCHAR"/> |
| | | <result column="risk_event_name" property="riskEventName"/> |
| | | <result column="report_status" property="reportStatus"/> |
| | | <result column="report_time" property="reportTime"/> |
| | | <result column="update_report_data_time" property="updateReportDataTime"/> |
| | | <result column="report_switch" property="reportSwitch"/> |
| | | </resultMap> |
| | | <update id="deletePreventRiskEventById"> |
| | | <update id="deletePreventRiskEventById" parameterType="com.ruoyi.doublePrevention.entity.PreventRiskEvent"> |
| | | update prevent_risk_event |
| | | <set> |
| | | <if test="preventRiskEvent.gmtModitify != null "> |
| | | gmt_moditify = #{preventRiskEvent.gmtModitify}, |
| | | <if test="gmtModitify != null "> |
| | | gmt_moditify = #{gmtModitify}, |
| | | </if> |
| | | <if test="preventRiskEvent.lastEditUserName != null "> |
| | | last_edit_user_name = #{preventRiskEvent.lastEditUserName}, |
| | | <if test="lastEditUserName != null "> |
| | | last_edit_user_name = #{lastEditUserName}, |
| | | </if> |
| | | delete_status = 1 where id = #{id} |
| | | <if test="updateReportDataTime != null"> |
| | | update_report_data_time = #{updateReportDataTime}, |
| | | </if> |
| | | delete_status = 1 where id = #{id} and delete_status = 0 |
| | | </set> |
| | | </update> |
| | | |
| | |
| | | <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="gmtModitify != null ">gmt_moditify = #{gmtModitify},</if> |
| | | <if test="gmtCreate != null ">gmt_create = #{gmtCreate},</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="reportSwitch != null ">report_switch,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="uuid != null ">uuid,</if> |
| | | <if test="uuid != null ">#{uuid},</if> |
| | | <if test="deleteStatus != null ">#{deleteStatus},</if> |
| | | <if test="riskUnitId != null ">#{riskUnitId},</if> |
| | | <if test="enterpriseId != null ">#{enterpriseId},</if> |
| | |
| | | </trim> |
| | | </insert> |
| | | |
| | | <select id="getPreventRiskEventById" resultType="com.ruoyi.doublePrevention.entity.PreventRiskEvent"> |
| | | <select id="getPreventRiskEventById" resultMap="BaseResultMap"> |
| | | select * from prevent_risk_event |
| | | where id = #{id} and delete_status = 0 |
| | | </select> |
| | | |
| | | <select id="getPreventRiskEventByEventName" |
| | | resultMap="BaseResultMap"> |
| | | select * from prevent_risk_event |
| | | where risk_event_name = #{name} and delete_status = 0 |
| | | </select> |
| | | |
| | | |
| | | <select id="listRiskEvenByCondition" resultMap="BaseResultMap"> |
| | | select * from prevent_risk_event |
| | | <where> |
| | | delete_status = 0 |
| | | <if test="riskUnitId != null"> |
| | | and risk_unit_id = #{riskUnitId} |
| | | </if> |
| | | <if test="riskEventName != null"> |
| | | and risk_event_name like concat('%',#{riskEventName},'%') |
| | | </if> |
| | | order by gmt_moditify desc |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |