Xiajijian
2026-03-07 4d314c8b1232773cb5c8288ea6ed6ff6fe8ee4b9
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<?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.route.mapper.ArdRouteInfoMapper">
    
    <resultMap type="ArdRouteInfo" id="ArdRouteInfoResult">
        <result property="id"    column="id"    />
        <result property="name"    column="name"    />
        <result property="path"    column="path"    />
        <result property="groupId"    column="group_id"    />
        <result property="type"    column="type"    />
        <result property="aircraft"    column="aircraft"    />
        <result property="payload"    column="payload"    />
        <result property="routeData"    column="route_data"    />
        <result property="cloudData"    column="cloud_data"    />
        <result property="readOnly"    column="read_only"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="pointCount"    column="point_count"    />
        <result property="isLoop"    column="is_loop"    />
        <result property="missionId"    column="mission_id"    />
    </resultMap>
 
    <sql id="selectArdRouteInfoVo">
        select id,
               name,
               path,
               group_id,
               type,
               aircraft,
               payload,
               route_data,
               cloud_data,
               read_only,
               create_by,
               create_time,
               update_by,
               update_time,
               point_count,
               is_loop,
               mission_id
        from ard_route_info
    </sql>
 
    <select id="selectArdRouteInfoList" parameterType="ArdRouteInfo" resultMap="ArdRouteInfoResult">
        <include refid="selectArdRouteInfoVo"/>
        <where>  
            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
            <if test="aircraft != null  and aircraft != ''"> and aircraft = #{aircraft}</if>
            <if test="payload != null  and payload != ''"> and payload = #{payload}</if>
            <if test="type != null  and type != ''"> and type = #{type}</if>
            <if test="path != null  and path != ''"> and path = #{path}</if>
            <if test="groupId != null"> and group_id = #{groupId}</if>
            <if test="isLoop != null"> and is_loop = #{isLoop}</if>
        </where>
        <if test="orderByTime == null and orderByTime == ''">
            ORDER BY update_time DESC
        </if>
        <!-- 动态排序 -->
        <if test="orderByTime != null and orderByTime != ''">
            ORDER BY update_time ${orderByTime}
        </if>
    </select>
    
    <select id="selectArdRouteInfoById" parameterType="String" resultMap="ArdRouteInfoResult">
        <include refid="selectArdRouteInfoVo"/>
        where id = #{id}
    </select>
 
    <insert id="insertArdRouteInfo" parameterType="ArdRouteInfo">
        insert into ard_route_info
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="name != null">name,</if>
            <if test="path != null">path,</if>
            <if test="groupId != null">group_id,</if>
            <if test="type != null">type,</if>
            <if test="aircraft != null">aircraft,</if>
            <if test="payload != null">payload,</if>
            <if test="routeData != null">route_data,</if>
            <if test="cloudData != null">cloud_data,</if>
            <if test="readOnly != null">read_only,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="pointCount != null">point_count,</if>
            <if test="isLoop != null">is_loop,</if>
            <if test="missionId != null">mission_id,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="name != null">#{name},</if>
            <if test="path != null">#{path},</if>
            <if test="groupId != null">#{groupId},</if>
            <if test="type != null">#{type},</if>
            <if test="aircraft != null">#{aircraft},</if>
            <if test="payload != null">#{payload},</if>
            <if test="routeData != null">#{routeData},</if>
            <if test="cloudData != null">#{cloudData},</if>
            <if test="readOnly != null">#{readOnly},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="pointCount != null">#{pointCount},</if>
            <if test="isLoop != null">#{isLoop},</if>
            <if test="missionId != null">#{missionId},</if>
         </trim>
    </insert>
 
    <update id="updateArdRouteInfo" parameterType="ArdRouteInfo">
        update ard_route_info
        <trim prefix="SET" suffixOverrides=",">
            <if test="name != null">name = #{name},</if>
            <if test="path != null">path = #{path},</if>
            <if test="groupId != null">group_id = #{groupId},</if>
            <if test="type != null">type = #{type},</if>
            <if test="aircraft != null">aircraft = #{aircraft},</if>
            <if test="payload != null">payload = #{payload},</if>
            <if test="routeData != null">route_data = #{routeData},</if>
            <if test="cloudData != null">cloud_data = #{cloudData},</if>
            <if test="readOnly != null">read_only = #{readOnly},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="pointCount != null">point_count = #{pointCount},</if>
            <if test="isLoop != null">is_loop = #{isLoop},</if>
            <if test="missionId != null">mission_id = #{missionId},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteArdRouteInfoById" parameterType="String">
        delete from ard_route_info where id = #{id}
    </delete>
 
    <delete id="deleteArdRouteInfoByIds" parameterType="String">
        delete from ard_route_info where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
 
    <select id="selectArdRouteInfoByName" parameterType="String" resultMap="ArdRouteInfoResult">
        <include refid="selectArdRouteInfoVo"/>
        where name = #{name}
    </select>
 
    <delete id="deleteRouteInforByGroupIds" parameterType="String">
        delete from ard_route_info where group_id in
        <foreach item="groupId" collection="array" open="(" separator="," close=")">
            #{groupId}
        </foreach>
    </delete>
 
    <select id="selectArdRouteInfoByGroupId" parameterType="String" resultMap="ArdRouteInfoResult">
        <include refid="selectArdRouteInfoVo"/>
        <where>
            <if test="groupId != null "> and group_id = #{groupId}</if>
        </where>
    </select>
 
    <update id="updateRouteInforGroupId">
        update ard_route_info
        <trim prefix="SET" suffixOverrides=",">
            <if test="groupId != null">group_id = #{groupId},</if>
        </trim>
        where id = #{id}
    </update>
 
</mapper>