<?xml version="1.0" encoding="UTF-8" ?>
|
<!DOCTYPE mapper
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.gkhy.safePlatform.incidentManage.repository.AccidentExpressInfoRepository">
|
|
<resultMap type="com.gkhy.safePlatform.incidentManage.entity.AccidentExpressInfoPageDO" id="AccidentExpressInfoPageDOResult">
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
<result column="gmt_moditify" property="gmtModitify"/>
|
<result column="create_uid" property="createUid"/>
|
<result column="accident_cause" property="accidentCause"/>
|
<result column="occurrence_time" property="occurrenceTime"/>
|
<result column="occurrence_place" property="occurrencePlace"/>
|
<result column="accident_department_id" property="accidentDepartmentId"/>
|
<result column="accident_name" property="accidentName"/>
|
</resultMap>
|
|
<select id="selectAccidentExpressList" resultMap="AccidentExpressInfoPageDOResult">
|
select id,`gmt_moditify`,`create_uid`,`accident_cause`,`occurrence_time`,occurrence_place ,accident_department_id ,accident_name
|
from accident_express where del_flag = 0
|
<if test="query.accidentName != null and query.accidentName != ''">and `accident_name` like concat('%', #{query.accidentName}, '%')</if>
|
</select>
|
|
<insert id="addAccidentExpress" parameterType="com.gkhy.safePlatform.incidentManage.entity.AccidentExpressInfo"
|
keyProperty="id" useGeneratedKeys="true">
|
insert into accident_express
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null ">id,</if>
|
<if test="delFlag != null ">del_flag,</if>
|
<if test="gmtCreate != null ">gmt_create,</if>
|
<if test="gmtModitify != null ">gmt_moditify,</if>
|
<if test="createUid != null ">create_uid,</if>
|
<if test="updateUid != null ">update_uid,</if>
|
<if test="emergencyPrecautions != null and emergencyPrecautions != ''">emergency_precautions,</if>
|
<if test="accidentCausesPreliminaryAnalysis != null and accidentCausesPreliminaryAnalysis != ''">accident_causes_preliminary_analysis,</if>
|
<if test="accidentBriefProcess != null and accidentBriefProcess != ''">accident_brief_process,</if>
|
<if test="casualties != null ">casualties,</if>
|
<if test="accidentCause != null and accidentCause != ''">accident_cause,</if>
|
<if test="occurrenceTime != null ">occurrence_time,</if>
|
<if test="occurrencePlace != null and occurrencePlace != ''">occurrence_place,</if>
|
<if test="accidentDepartmentId != null ">accident_department_id,</if>
|
<if test="accidentName != null and accidentName != ''">accident_name,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null ">#{id},</if>
|
<if test="delFlag != null ">#{delFlag},</if>
|
<if test="gmtCreate != null ">#{gmtCreate},</if>
|
<if test="gmtModitify != null ">#{gmtModitify},</if>
|
<if test="createUid != null ">#{createUid},</if>
|
<if test="updateUid != null ">#{updateUid},</if>
|
<if test="emergencyPrecautions != null and emergencyPrecautions != ''">#{emergencyPrecautions},</if>
|
<if test="accidentCausesPreliminaryAnalysis != null and accidentCausesPreliminaryAnalysis != ''">#{accidentCausesPreliminaryAnalysis},</if>
|
<if test="accidentBriefProcess != null and accidentBriefProcess != ''">#{accidentBriefProcess},</if>
|
<if test="casualties != null ">#{casualties},</if>
|
<if test="accidentCause != null and accidentCause != ''">#{accidentCause},</if>
|
<if test="occurrenceTime != null ">#{occurrenceTime},</if>
|
<if test="occurrencePlace != null and occurrencePlace != ''">#{occurrencePlace},</if>
|
<if test="accidentDepartmentId != null ">#{accidentDepartmentId},</if>
|
<if test="accidentName != null and accidentName != ''">#{accidentName},</if>
|
</trim>
|
</insert>
|
|
|
<resultMap type="com.gkhy.safePlatform.incidentManage.entity.AccidentExpressInfoDetailDO" id="AccidentExpressInfoDetailDOResult">
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
<result column="emergency_precautions" property="emergencyPrecautions"/>
|
<result column="accident_causes_preliminary_analysis" property="accidentCausesPreliminaryAnalysis"/>
|
<result column="accident_brief_process" property="accidentBriefProcess"/>
|
<result column="casualties" property="casualties"/>
|
<result column="accident_cause" property="accidentCause"/>
|
<result column="occurrence_time" property="occurrenceTime"/>
|
<result column="occurrence_place" property="occurrencePlace"/>
|
<result column="accident_department_id" property="accidentDepartmentId"/>
|
<result column="accident_name" property="accidentName"/>
|
</resultMap>
|
|
<select id="selectAccidentExpressById" resultMap="AccidentExpressInfoDetailDOResult">
|
select id ,`emergency_precautions`,`accident_causes_preliminary_analysis`,`accident_brief_process`,`casualties`,accident_cause,
|
occurrence_time ,occurrence_place ,accident_department_id ,accident_name from accident_express
|
where del_flag = 0 and id = #{id}
|
</select>
|
|
<update id="updateAccidentExpress" parameterType="com.gkhy.safePlatform.incidentManage.entity.AccidentExpressInfo">
|
update accident_express
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="gmtModitify != null ">gmt_moditify = #{gmtModitify},</if>
|
<if test="updateUid != null ">update_uid = #{updateUid},</if>
|
<if test="emergencyPrecautions != null and emergencyPrecautions != ''">emergency_precautions = #{emergencyPrecautions},</if>
|
<if test="accidentCausesPreliminaryAnalysis != null and accidentCausesPreliminaryAnalysis != ''"> accident_causes_preliminary_analysis= #{accidentCausesPreliminaryAnalysis},</if>
|
<if test="accidentBriefProcess != null and accidentBriefProcess != ''">accident_brief_process = #{accidentBriefProcess},</if>
|
<if test="casualties != null ">casualties = #{casualties},</if>
|
<if test="accidentCause != null and accidentCause != ''">accident_cause = #{accidentCause},</if>
|
<if test="occurrenceTime != null ">occurrence_time = #{occurrenceTime},</if>
|
<if test="occurrencePlace != null and occurrencePlace != ''">occurrence_place = #{occurrencePlace},</if>
|
<if test="accidentDepartmentId != null ">accident_department_id = #{accidentDepartmentId},</if>
|
<if test="accidentName != null and accidentName != ''">accident_name = #{accidentName},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<update id="deleteAccidentExpressById">
|
update accident_express set del_flag = 1 where id = #{id}
|
</update>
|
</mapper>
|