zhaowenyu
2026-03-09 a95db5fc78b3f86df131cc7271f06a053a9b2611
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
<?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.work.mapper.UavWaylineMapper">
    
    <resultMap type="UavWayline" id="UavWaylineResult">
        <result property="id"    column="id"    />
        <result property="name"    column="name"    />
        <result property="type"    column="type"    />
        <result property="uavModel"    column="uav_model"    />
        <result property="payloadModel"    column="payload_model"    />
        <result property="globalSpeed"    column="global_speed"    />
        <result property="globalHeight"    column="global_height"    />
        <result property="userWaypointCount"    column="user_waypoint_count"    />
        <result property="planWaypointCount"    column="plan_waypoint_count"    />
        <result property="srcWaylineData"    column="src_wayline_data"    />
        <result property="planWaylineData"    column="plan_wayline_data"    />
        <result property="kmzUrl"    column="kmz_url"    />
        <result property="userId"    column="user_id"    />
        <result property="deptId"    column="dept_id"    />
        <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="remark"    column="remark"    />
    </resultMap>
 
    <sql id="selectUavWaylineVo">
        select id,
               name,
               type,
               uav_model,
               payload_model,
               global_speed,
               global_height,
               user_waypoint_count,
               plan_waypoint_count,
               src_wayline_data,
               plan_wayline_data,
               kmz_url,
               user_id,
               dept_id,
               create_by,
               create_time,
               update_by,
               update_time,
               remark
        from uav_wayline
    </sql>
 
    <select id="selectUavWaylineList" parameterType="UavWayline" resultMap="UavWaylineResult">
        <include refid="selectUavWaylineVo"/>
        <where>  
            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
            <if test="type != null  and type != ''"> and type = #{type}</if>
            <if test="uavModel != null  and uavModel != ''"> and uav_model = #{uavModel}</if>
            <if test="payloadModel != null  and payloadModel != ''"> and payload_model = #{payloadModel}</if>
            <if test="globalSpeed != null "> and global_speed = #{globalSpeed}</if>
            <if test="globalHeight != null "> and global_height = #{globalHeight}</if>
            <if test="userWaypointCount != null "> and user_waypoint_count = #{userWaypointCount}</if>
            <if test="planWaypointCount != null "> and plan_waypoint_count = #{planWaypointCount}</if>
            <if test="srcWaylineData != null"> and src_wayline_data =#{srcWaylineData}</if>
            <if test="planWaylineData != null"> and plan_wayline_data = #{planWaylineData}</if>
            <if test="kmzUrl != null  and kmzUrl != ''"> and kmz_url = #{kmzUrl}</if>
            <if test="userId != null "> and user_id = #{userId}</if>
            <if test="deptId != null "> and dept_id = #{deptId}</if>
        </where>
    </select>
    
    <select id="selectUavWaylineById" parameterType="String" resultMap="UavWaylineResult">
        <include refid="selectUavWaylineVo"/>
        where id = #{id}
    </select>
 
    <insert id="insertUavWayline" parameterType="UavWayline">
        insert into uav_wayline
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="name != null">name,</if>
            <if test="type != null">type,</if>
            <if test="uavModel != null">uav_model,</if>
            <if test="payloadModel != null">payload_model,</if>
            <if test="globalSpeed != null">global_speed,</if>
            <if test="globalHeight != null">global_height,</if>
            <if test="userWaypointCount != null">user_waypoint_count,</if>
            <if test="planWaypointCount != null">plan_waypoint_count,</if>
            <if test="srcWaylineData != null">src_wayline_data,</if>
            <if test="planWaylineData != null">plan_wayline_data,</if>
            <if test="kmzUrl != null">kmz_url,</if>
            <if test="userId != null">user_id,</if>
            <if test="deptId != null">dept_id,</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="remark != null">remark,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="name != null">#{name},</if>
            <if test="type != null">#{type},</if>
            <if test="uavModel != null">#{uavModel},</if>
            <if test="payloadModel != null">#{payloadModel},</if>
            <if test="globalSpeed != null">#{globalSpeed},</if>
            <if test="globalHeight != null">#{globalHeight},</if>
            <if test="userWaypointCount != null">#{userWaypointCount},</if>
            <if test="planWaypointCount != null">#{planWaypointCount},</if>
            <if test="srcWaylineData != null">#{srcWaylineData},</if>
            <if test="planWaylineData != null">#{planWaylineData},</if>
            <if test="kmzUrl != null">#{kmzUrl},</if>
            <if test="userId != null">#{userId},</if>
            <if test="deptId != null">#{deptId},</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="remark != null">#{remark},</if>
         </trim>
    </insert>
 
    <update id="updateUavWayline" parameterType="UavWayline">
        update uav_wayline
        <trim prefix="SET" suffixOverrides=",">
            <if test="name != null">name = #{name},</if>
            <if test="type != null">type = #{type},</if>
            <if test="uavModel != null">uav_model = #{uavModel},</if>
            <if test="payloadModel != null">payload_model = #{payloadModel},</if>
            <if test="globalSpeed != null">global_speed = #{globalSpeed},</if>
            <if test="globalHeight != null">global_height = #{globalHeight},</if>
            <if test="userWaypointCount != null ">  user_waypoint_count = #{userWaypointCount}</if>
            <if test="planWaypointCount != null ">  plan_waypoint_count = #{planWaypointCount}</if>
            <if test="srcWaylineData != null ">  src_wayline_data =#{srcWaylineData}</if>
            <if test="planWaylineData != null ">  plan_wayline_data = #{planWaylineData}</if>
            <if test="kmzUrl != null">kmz_url = #{kmzUrl},</if>
            <if test="userId != null">user_id = #{userId},</if>
            <if test="deptId != null">dept_id = #{deptId},</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="remark != null">remark = #{remark},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteUavWaylineById" parameterType="String">
        delete from uav_wayline where id = #{id}
    </delete>
 
    <delete id="deleteUavWaylineByIds" parameterType="String">
        delete from uav_wayline where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
 
    <select id="checkUavWaylineNameUnique" parameterType="String" resultMap="UavWaylineResult">
        select id, name from uav_wayline where name = #{name}  limit 1
    </select>
</mapper>