nishiwei
2026-10-16 e33b92fe82818792d1891f842ccde97fef51c731
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.ard.data.map.mapper.ArdMapMapper">
    
    <resultMap type="ArdMap" id="ArdMapResult">
        <result property="id"    column="id"    />
        <result property="mapName"    column="map_name"    />
        <result property="mapType"    column="map_type"    />
        <result property="fileName"    column="file_name"    />
        <result property="releaseStatus"    column="release_status"    />
        <result property="defaultLoading"    column="default_loading"    />
        <result property="mapPath"    column="map_path"    />
    </resultMap>
 
    <sql id="selectArdMapVo">
        select id,
               map_name,
               map_type,
               file_name,
               release_status,
               default_loading,
               map_path
        from ard_map
    </sql>
 
    <select id="selectArdMapList" parameterType="ArdMap" resultMap="ArdMapResult">
        <include refid="selectArdMapVo"/>
        <where>  
            <if test="mapName != null  and mapName != ''"> and map_name like concat('%', #{mapName}, '%')</if>
            <if test="mapType != null  and mapType != ''"> and map_type = #{mapType}</if>
            <if test="fileName != null  and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
            <if test="releaseStatus != null  and releaseStatus != ''"> and release_status = #{releaseStatus}</if>
        </where>
    </select>
    
    <select id="selectArdMapById" parameterType="String" resultMap="ArdMapResult">
        <include refid="selectArdMapVo"/>
        where id = #{id}
    </select>
 
    <insert id="insertArdMap" parameterType="ArdMap">
        insert into ard_map
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="mapName != null">map_name,</if>
            <if test="mapType != null">map_type,</if>
            <if test="fileName != null">file_name,</if>
            <if test="releaseStatus != null">release_status,</if>
            <if test="defaultLoading != null">default_loading,</if>
            <if test="mapPath != null">map_path,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="mapName != null">#{mapName},</if>
            <if test="mapType != null">#{mapType},</if>
            <if test="fileName != null">#{fileName},</if>
            <if test="releaseStatus != null">#{releaseStatus},</if>
            <if test="defaultLoading != null">#{defaultLoading},</if>
            <if test="mapPath != null">#{mapPath},</if>
         </trim>
    </insert>
 
    <update id="updateArdMap" parameterType="ArdMap">
        update ard_map
        <trim prefix="SET" suffixOverrides=",">
            <if test="mapName != null">map_name = #{mapName},</if>
            <if test="mapType != null">map_type = #{mapType},</if>
            <if test="fileName != null">file_name = #{fileName},</if>
            <if test="releaseStatus != null">release_status = #{releaseStatus},</if>
            <if test="defaultLoading != null">default_loading = #{defaultLoading},</if>
            <if test="mapPath != null">map_path = #{mapPath},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteArdMapById" parameterType="String">
        delete from ard_map where id = #{id}
    </delete>
 
    <delete id="deleteArdMapByIds" parameterType="String">
        delete from ard_map where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
 
    <select id="checkArdMapNameUnique" resultMap="ArdMapResult">
        select * from ard_map where map_name = #{mapName} limit 1
    </select>
 
</mapper>