From 2af0687164dc784d048c96c91c664bdfefb52f49 Mon Sep 17 00:00:00 2001 From: songhuangfeng123 <shf18767906695@163.com> Date: 星期三, 20 七月 2022 11:06:21 +0800 Subject: [PATCH] 事故快报 --- incident-manage/incident-manage-service/src/main/resources/config/mapper/incidentManage/AccidentExpressInfoMapper.xml | 97 +++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 94 insertions(+), 3 deletions(-) diff --git a/incident-manage/incident-manage-service/src/main/resources/config/mapper/incidentManage/AccidentExpressInfoMapper.xml b/incident-manage/incident-manage-service/src/main/resources/config/mapper/incidentManage/AccidentExpressInfoMapper.xml index 614dd2e..050c87a 100644 --- a/incident-manage/incident-manage-service/src/main/resources/config/mapper/incidentManage/AccidentExpressInfoMapper.xml +++ b/incident-manage/incident-manage-service/src/main/resources/config/mapper/incidentManage/AccidentExpressInfoMapper.xml @@ -2,12 +2,103 @@ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> -<mapper namespace="com.gkhy.safePlatform.goalManage.entity.TestTable"> +<mapper namespace="com.gkhy.safePlatform.incidentManage.repository.AccidentExpressInfoRepository"> - <resultMap id="TestTableMap" type="com.gkhy.safePlatform.goalManage.entity.TestTable"> + <resultMap type="com.gkhy.safePlatform.incidentManage.entity.AccidentExpressInfoPageDO" id="AccidentExpressInfoPageDOResult"> <id column="id" property="id" jdbcType="BIGINT"/> - <result property="title" column="title"/> + <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> -- Gitblit v1.9.2