From 3f43e40ed1a1e9f66b3ad2862da9dbc4b710c712 Mon Sep 17 00:00:00 2001
From: nishiwei <13126973358@163.com>
Date: Fri, 23 Oct 2026 14:09:47 +0800
Subject: [PATCH] 智云3.0机场1适配内容提交

---
 ard-work/src/main/resources/mapper/ArdDroneInfoMapper.xml |   68 +++++++++++++++++-----------------
 1 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/ard-work/src/main/resources/mapper/ArdDroneInfoMapper.xml b/ard-work/src/main/resources/mapper/ArdDroneInfoMapper.xml
index 6c78ec8..ed3958f 100644
--- a/ard-work/src/main/resources/mapper/ArdDroneInfoMapper.xml
+++ b/ard-work/src/main/resources/mapper/ArdDroneInfoMapper.xml
@@ -16,7 +16,6 @@
         <result property="lastTaskId"    column="last_task_id"    />
         <result property="userId"    column="user_id"    />
         <result property="deptId"    column="dept_id"    />
-        <result property="boxAliasName"    column="box_alias_name"    />
         <result property="createBy"    column="create_by"    />
         <result property="createTime"    column="create_time"    />
         <result property="updateBy"    column="update_by"    />
@@ -33,36 +32,42 @@
     </resultMap>
 
     <select id="selectArdServerInfo" resultType="com.ard.work.domain.entity.ArdServerInfo">
-        select * from ard_server_info where id = #{serverId}
+        select * from ard_server where id = #{serverId}
     </select>
 
     <sql id="selectArdDroneVo">
-        select id,
-               box_sn,
-               box_name,
-               box_version,
-               start_time,
-               on_line,
-               video_server,
-               video_port,
-               last_task_id,
-               server_id,
-               user_id,
-               dept_id,
-               box_alias_name
-        from ard_drone_info
+        select c.id,
+               c.box_sn,
+               c.box_name,
+               c.box_version,
+               c.start_time,
+               c.on_line,
+               c.video_server,
+               c.video_port,
+               c.last_task_id,
+               c.server_id,
+               c.user_id,
+               c.dept_id
+        from ard_drone c
+                 left join sys_dept d on d.dept_id = c.dept_id
+                 left join sys_user u on u.user_id = c.user_id
     </sql>
 
     <select id="selectArdDroneList" parameterType="ArdDroneInfo" resultMap="ArdDroneInfoResult">
         <include refid="selectArdDroneVo"/>
         <where>
-            <if test="boxSn != null  and boxSn != ''"> and box_sn like concat('%', #{boxSn}, '%')</if>
-            <if test="boxName != null  and boxName != ''"> and box_name like concat('%', #{boxName}, '%')</if>
-            <if test="boxVersion != null  and boxVersion != ''"> and box_version = #{boxVersion}</if>
-            <if test="onLine != null "> and onLine = #{onLine}</if>
-            <if test="lastTaskId != null "> and last_task_id = #{lastTaskId}</if>
-            <if test="userId != null "> and user_id = #{userId}</if>
-            <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="boxSn != null  and boxSn != ''"> and c.box_sn like concat('%', #{boxSn}, '%')</if>
+            <if test="boxName != null  and boxName != ''"> and c.box_name like concat('%', #{boxName}, '%')</if>
+            <if test="boxVersion != null  and boxVersion != ''"> and c.box_version = #{boxVersion}</if>
+            <if test="onLine != null "> and c.onLine = #{onLine}</if>
+            <if test="lastTaskId != null "> and c.last_task_id = #{lastTaskId}</if>
+            <if test="userId != null "> and c.user_id = #{userId}</if>
+            <if test="deptId != null and deptId != 0">
+                and (d.dept_id = #{deptId} OR d.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE
+                find_in_set(#{deptId}, ancestors) ))
+            </if>
+            <!-- 数据范围过滤 -->
+            ${params.dataScope}
         </where>
     </select>
     
@@ -75,7 +80,7 @@
         where box_sn = #{boxSn}
     </select>
     <insert id="insertArdDrone" parameterType="ArdDroneInfo">
-        insert into ard_drone_info
+        insert into ard_drone
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="id != null">id,</if>
             <if test="boxSn != null">box_sn,</if>
@@ -89,7 +94,6 @@
             <if test="serverId != null">server_id,</if>
             <if test="userId != null">user_id,</if>
             <if test="deptId != null">dept_id,</if>
-            <if test="boxAliasName != null">box_alias_name,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateBy != null">update_by,</if>
@@ -109,7 +113,6 @@
             <if test="serverId != null">#{serverId},</if>
             <if test="userId != null">#{userId},</if>
             <if test="deptId != null">#{deptId},</if>
-            <if test="boxAliasName != null">#{boxAliasName},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
@@ -119,7 +122,7 @@
     </insert>
 
     <update id="updateArdDrone" parameterType="ArdDroneInfo">
-        update ard_drone_info
+        update ard_drone
         <trim prefix="SET" suffixOverrides=",">
             <if test="boxSn != null">box_sn = #{boxSn},</if>
             <if test="boxName != null">box_name = #{boxName},</if>
@@ -132,7 +135,6 @@
             <if test="serverId != null">server_id = #{serverId},</if>
             <if test="userId != null">user_id = #{userId},</if>
             <if test="deptId != null">dept_id = #{deptId},</if>
-            <if test="boxAliasName != null">box_alias_name = #{boxAliasName},</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>
@@ -143,18 +145,18 @@
     </update>
 
     <delete id="deleteArdDroneById" parameterType="String">
-        delete from ard_drone_info where id = #{id}
+        delete from ard_drone where id = #{id}
     </delete>
 
     <delete id="deleteArdDroneByIds" parameterType="String">
-        delete from ard_drone_info where id in
+        delete from ard_drone where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
     </delete>
 
     <insert id="insertArdDroneLs" parameterType="java.util.List">
-        insert into ard_drone_info(
+        insert into ard_drone(
             id,
             box_sn,
             box_name,
@@ -167,7 +169,6 @@
             server_id,
             user_id,
             dept_id,
-            box_alias_name,
             create_by,
             create_time,
             update_by,
@@ -187,7 +188,6 @@
             #{item.serverId},
             #{item.userId},
             #{item.deptId},
-            #{item.boxAliasName},
             #{item.createBy},
             #{item.createTime},
             #{item.updateBy},
@@ -197,7 +197,7 @@
     </insert>
 
     <update id="updateDroneStatus">
-        update ard_drone_info
+        update ard_drone
         <trim prefix="SET" suffixOverrides=",">
             <if test="onLine != null">on_line = #{onLine},</if>
         </trim>

--
Gitblit v1.9.3