fix
songhuangfeng123
2022-09-20 f1f506172a3edff8d31e4db77b8940f115660919
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
<?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.emergency.repository.EmergencyPlanAreaInfoRepository">
 
 
    <insert id="addEmergencyPlanArea">
        insert into emergency_plan_area
        <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="planId != null ">plan_id,</if>
            <if test="areaId != null ">area_id,</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="planId != null ">#{planId},</if>
            <if test="areaId != null ">#{areaId},</if>
        </trim>
    </insert>
 
    <resultMap type="com.gkhy.safePlatform.emergency.entity.EmergencyPlanAreaInfoDO" id="emergencyPlanAreaInfoDOResult">
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="plan_id" property="planId"/>
        <result column="area_id" property="areaId"/>
    </resultMap>
 
    <select id="selectEmergencyPlanAreaByPlanId" resultMap="emergencyPlanAreaInfoDOResult">
        select id , plan_id , area_id from emergency_plan_area where plan_id=#{planId} and del_flag = 0
    </select>
 
    <update id = "deleteEmergencyPlanAreaByIds" >
        update emergency_plan_area set del_flag = 1 where id in
        <foreach item="id" collection="ids" open="(" separator="," close=")">
            #{id}
        </foreach>
    </update>
 
    <update id="deleteEmergencyPlanAreaByPlanId">
        update emergency_plan_area set del_flag = 1 where plan_id = #{planId}
    </update>
 
</mapper>