songhuangfeng123
2022-08-18 233fb69fa9d1694e97337d74fa3da72cacda04c1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?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.AccidentExpressCasualtyInfoRepository">
 
    <insert id="addAccidentExpressCasualty">
        insert into accident_express_casualty
        <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="accidentExpressId != null ">accident_express_id,</if>
            <if test="name != null and name != ''">`name`,</if>
            <if test="gender != null ">gender,</if>
            <if test="card != null and card != ''">card,</if>
            <if test="injuryDesc != null and injuryDesc != ''">injury_desc,</if>
            <if test="damageDesc != null and damageDesc != ''">damage_desc,</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="accidentExpressId != null ">#{accidentExpressId},</if>
            <if test="name != null and name != ''">#{name},</if>
            <if test="gender != null ">#{gender},</if>
            <if test="card != null and card != ''">#{card},</if>
            <if test="injuryDesc != null and injuryDesc != ''">#{injuryDesc},</if>
            <if test="damageDesc != null and damageDesc != ''">#{damageDesc},</if>
        </trim>
    </insert>
 
    <resultMap type="com.gkhy.safePlatform.incidentManage.entity.AccidentExpressCasualtyInfoDO" id="AccidentExpressCasualtyInfoDOResult">
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="accident_express_id" property="accidentExpressId" />
        <result column="name" property="name" />
        <result column="gender" property="gender" />
        <result column="card" property="card" />
        <result column="injury_desc" property="injuryDesc" />
        <result column="damage_desc" property="damageDesc" />
    </resultMap>
 
    <select id="selectByAccidentExpressId" resultMap="AccidentExpressCasualtyInfoDOResult">
        select id,accident_express_id,`name`,`gender`,`card`,injury_desc,damage_desc from accident_express_casualty where del_flag = 0 and accident_express_id = #{accidentExpressId}
    </select>
 
 
    <update id="deleteAccidentExpressCasualtyById">
        update accident_express_casualty set del_flag = 1 where id = #{id}
    </update>
 
    <update id="deleteAccidentExpressCasualtyByAccidentExpressId">
        update accident_express_casualty set del_flag = 1 where accident_express_id = #{id}
    </update>
</mapper>