jinpengyong
2023-10-30 14949a6a6e7dec654d13e75f46b24319a624ff8b
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?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.moral.api.mapper.MonitorPointMapper">
 
        <!-- 通用查询映射结果 -->
        <resultMap id="BaseResultMap" type="com.moral.api.entity.MonitorPoint">
                    <id column="id" property="id" />
                    <result column="name" property="name" />
                    <result column="longitude" property="longitude" />
                    <result column="latitude" property="latitude" />
                    <result column="province_code" property="provinceCode" />
                    <result column="city_code" property="cityCode" />
                    <result column="area_code" property="areaCode" />
                    <result column="address" property="address" />
                    <result column="organization_id" property="organizationId" />
                    <result column="create_time" property="createTime" />
                    <result column="update_time" property="updateTime" />
                    <result column="is_delete" property="isDelete" />
                    <result column="desc" property="desc" />
        </resultMap>
 
    <sql id="Base_Column_List">
            mp.id,mp.name,mp.longitude,mp.latitude,mp.province_code,mp.city_code,mp.area_code,mp.address,mp.organization_id,mp.create_time,mp.update_time,mp.is_delete,mp.desc
    </sql>
 
    <update id="updateMonitorPoint" parameterType="java.util.Map">
        update monitor_point
        <set>
            <if test="name != null">
                name = #{name},
            </if>
            <if test="longitude != null">
                <if test="longitude == ''">
                    longitude = null,
                </if>
                <if test="longitude != ''">
                    longitude = #{longitude},
                </if>
            </if>
            <if test="latitude != null">
                <if test="latitude == ''">
                    latitude = null,
                </if>
                <if test="latitude != ''">
                    latitude = #{latitude},
                </if>
            </if>
            <if test="province_code != null">
                <if test="province_code == ''">
                    province_code = null,
                </if>
                <if test="province_code != ''">
                    province_code = #{province_code},
                </if>
            </if>
            <if test="city_code != null">
                <if test="city_code == ''">
                    city_code = null,
                </if>
                <if test="city_code != ''">
                    city_code = #{city_code},
                </if>
            </if>
            <if test="area_code != null">
                <if test="area_code == ''">
                    area_code = null,
                </if>
                <if test="area_code != ''">
                    area_code = #{area_code},
                </if>
            </if>
            <if test="address != null">
                address = #{address},
            </if>
            <if test="organization_id != null">
                <if test="organization_id == ''">
                    organization_id = null,
                </if>
                <if test="organization_id != ''">
                    organization_id = #{organization_id},
                </if>
            </if>
            <if test="desc != null">
                `desc` = #{desc},
            </if>
            <if test="isDelete != null">
                is_delete = #{isDelete},
            </if>
        </set>
        where id = #{id}
    </update>
 
</mapper>