From 67e736eaefd59d98f1f3bfdf593e7fdd3d75d52d Mon Sep 17 00:00:00 2001
From: liusuyi <1951119284@qq.com>
Date: Sat, 18 Oct 2025 11:40:51 +0800
Subject: [PATCH] 细化授权文件不存在和不匹配
---
ard-work/src/main/resources/mapper/ArdDroneInfoMapper.xml | 210 +++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 157 insertions(+), 53 deletions(-)
diff --git a/ard-work/src/main/resources/mapper/ArdDroneInfoMapper.xml b/ard-work/src/main/resources/mapper/ArdDroneInfoMapper.xml
index a79d442..dafd26d 100644
--- a/ard-work/src/main/resources/mapper/ArdDroneInfoMapper.xml
+++ b/ard-work/src/main/resources/mapper/ArdDroneInfoMapper.xml
@@ -4,92 +4,196 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ard.work.mapper.ArdDroneInfoMapper">
- <resultMap type="ArdDroneInfo" id="ArdDroneManagementResult">
+ <resultMap type="ArdDroneInfo" id="ArdDroneInfoResult">
<result property="id" column="id" />
- <result property="deviceModel" column="device_model" />
- <result property="deviceSn" column="device_sn" />
- <result property="deviceName" column="device_name" />
- <result property="deviceStatus" column="device_status" />
- <result property="deviceAddTime" column="device_add_time" />
- <result property="onlineTime" column="online_time" />
- <result property="serverInfoId" column="server_info_id" />
+ <result property="boxSn" column="box_sn" />
+ <result property="boxName" column="box_name" />
+ <result property="boxVersion" column="box_version" />
+ <result property="startTime" column="start_time" />
+ <result property="onLine" column="onLine" />
+ <result property="videoServer" column="video_server" />
+ <result property="videoPort" column="video_port" />
+ <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" />
+ <result property="updateTime" column="update_time" />
+ <result property="remark" column="remark" />
+ <result property="serverId" column="server_id" />
+ <!-- 关联 ArdServerInfo 对象 -->
+ <association property="ardServerInfo"
+ javaType="com.ard.work.domain.entity.ArdServerInfo"
+ column="server_id"
+ autoMapping="true"
+ select="selectArdServerInfo">
+ </association>
</resultMap>
- <sql id="selectArdDroneManagementVo">
+ <select id="selectArdServerInfo" resultType="com.ard.work.domain.entity.ArdServerInfo">
+ select * from ard_server_info where id = #{serverId}
+ </select>
+
+ <sql id="selectArdDroneVo">
select id,
- device_model,
- device_sn,
- device_name,
- device_status,
- device_add_time,
- online_time,
- server_info_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
</sql>
- <select id="selectArdDroneManagementList" parameterType="ArdDroneInfo" resultMap="ArdDroneManagementResult">
- <include refid="selectArdDroneManagementVo"/>
- <where>
- <if test="deviceModel != null and deviceModel != ''"> and device_model = #{deviceModel}</if>
- <if test="deviceSn != null and deviceSn != ''"> and device_sn = #{deviceSn}</if>
- <if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
- <if test="deviceStatus != null and deviceStatus != ''"> and device_status = #{deviceStatus}</if>
- <if test="deviceAddTime != null "> and device_add_time = #{deviceAddTime}</if>
- <if test="onlineTime != null "> and online_time = #{onlineTime}</if>
+ <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>
</where>
</select>
- <select id="selectArdDroneManagementById" parameterType="String" resultMap="ArdDroneManagementResult">
- <include refid="selectArdDroneManagementVo"/>
+ <select id="selectArdDroneById" parameterType="String" resultMap="ArdDroneInfoResult">
+ <include refid="selectArdDroneVo"/>
where id = #{id}
</select>
-
- <insert id="insertArdDroneManagement" parameterType="ArdDroneInfo">
+ <select id="selectArdDroneByBoxSn" parameterType="String" resultMap="ArdDroneInfoResult">
+ <include refid="selectArdDroneVo"/>
+ where box_sn = #{boxSn}
+ </select>
+ <insert id="insertArdDrone" parameterType="ArdDroneInfo">
insert into ard_drone_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
- <if test="deviceModel != null">device_model,</if>
- <if test="deviceSn != null">device_sn,</if>
- <if test="deviceName != null">device_name,</if>
- <if test="deviceStatus != null">device_status,</if>
- <if test="deviceAddTime != null">device_add_time,</if>
- <if test="onlineTime != null">online_time,</if>
- <if test="serverInfoId != null">server_info_id,</if>
+ <if test="boxSn != null">box_sn,</if>
+ <if test="boxName != null">box_name,</if>
+ <if test="boxVersion != null">box_version,</if>
+ <if test="startTime != null">start_time,</if>
+ <if test="onLine != null">on_line,</if>
+ <if test="videoServer != null">video_server,</if>
+ <if test="videoPort != null">video_port,</if>
+ <if test="lastTaskId != null">last_task_id,</if>
+ <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>
+ <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="deviceModel != null">#{deviceModel},</if>
- <if test="deviceSn != null">#{deviceSn},</if>
- <if test="deviceName != null">#{deviceName},</if>
- <if test="deviceStatus != null">#{deviceStatus},</if>
- <if test="deviceAddTime != null">#{deviceAddTime},</if>
- <if test="onlineTime != null">#{onlineTime},</if>
- <if test="serverInfoId != null">#{serverInfoId},</if>
+ <if test="boxSn != null">#{boxSn},</if>
+ <if test="boxName != null">#{boxName},</if>
+ <if test="boxVersion != null">#{boxVersion},</if>
+ <if test="startTime != null">#{startTime},</if>
+ <if test="onLine != null">#{onLine},</if>
+ <if test="videoServer != null">#{videoServer},</if>
+ <if test="videoPort != null">#{videoPort},</if>
+ <if test="lastTaskId != null">#{lastTaskId},</if>
+ <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>
+ <if test="updateTime != null">#{updateTime},</if>
+ <if test="remark != null">#{remark},</if>
</trim>
</insert>
- <update id="updateArdDroneManagement" parameterType="ArdDroneInfo">
+ <update id="updateArdDrone" parameterType="ArdDroneInfo">
update ard_drone_info
<trim prefix="SET" suffixOverrides=",">
- <if test="deviceModel != null">device_model = #{deviceModel},</if>
- <if test="deviceSn != null">device_sn = #{deviceSn},</if>
- <if test="deviceName != null">device_name = #{deviceName},</if>
- <if test="deviceStatus != null">device_status = #{deviceStatus},</if>
- <if test="deviceAddTime != null">device_add_time = #{deviceAddTime},</if>
- <if test="onlineTime != null">online_time = #{onlineTime},</if>
- <if test="serverInfoId != null">server_info_id = #{serverInfoId},</if>
+ <if test="boxSn != null">box_sn = #{boxSn},</if>
+ <if test="boxName != null">box_name = #{boxName},</if>
+ <if test="boxVersion != null">box_version = #{boxVersion},</if>
+ <if test="startTime != null">start_time = #{startTime},</if>
+ <if test="onLine != null">on_line = #{onLine},</if>
+ <if test="videoServer != null">video_server = #{videoServer},</if>
+ <if test="videoPort != null">video_port = #{videoPort},</if>
+ <if test="lastTaskId != null">last_task_id = #{lastTaskId},</if>
+ <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>
+ <if test="updateTime != null">update_time = #{updateTime},</if>
+ <if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
- <delete id="deleteArdDroneManagementById" parameterType="String">
+ <delete id="deleteArdDroneById" parameterType="String">
delete from ard_drone_info where id = #{id}
</delete>
- <delete id="deleteArdDroneManagementByIds" parameterType="String">
+ <delete id="deleteArdDroneByIds" parameterType="String">
delete from ard_drone_info 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(
+ 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,
+ create_by,
+ create_time,
+ update_by,
+ update_time,
+ remark
+ ) values
+ <foreach item="item" index="index" collection="list" separator=",">
+ (#{item.id},
+ #{item.boxSn},
+ #{item.boxName},
+ #{item.boxVersion},
+ #{item.startTime},
+ #{item.onLine},
+ #{item.videoServer},
+ #{item.videoPort},
+ #{item.lastTaskId},
+ #{item.serverId},
+ #{item.userId},
+ #{item.deptId},
+ #{item.boxAliasName},
+ #{item.createBy},
+ #{item.createTime},
+ #{item.updateBy},
+ #{item.updateTime},
+ #{item.remark})
+ </foreach>
+ </insert>
+
</mapper>
\ No newline at end of file
--
Gitblit v1.9.3