From 1c0e9484d0f2e59bdb06f2bf9be9450645fc4d8d Mon Sep 17 00:00:00 2001
From: liusuyi <1951119284@qq.com>
Date: Thu, 23 Oct 2025 16:03:37 +0800
Subject: [PATCH] 生产模式不允许多端同时登录
---
ard-work/src/main/resources/mapper/ArdDroneInfoMapper.xml | 86 ++++++++++++++++++++++++++++++++++--------
1 files changed, 69 insertions(+), 17 deletions(-)
diff --git a/ard-work/src/main/resources/mapper/ArdDroneInfoMapper.xml b/ard-work/src/main/resources/mapper/ArdDroneInfoMapper.xml
index 0a3a216..fdcc976 100644
--- a/ard-work/src/main/resources/mapper/ArdDroneInfoMapper.xml
+++ b/ard-work/src/main/resources/mapper/ArdDroneInfoMapper.xml
@@ -10,51 +10,53 @@
<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="onLine" column="on_line" />
<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="serverInfoId" column="server_info_id" />
+ <result property="serverId" column="server_id" />
<!-- 关联 ArdServerInfo 对象 -->
<association property="ardServerInfo"
javaType="com.ard.work.domain.entity.ArdServerInfo"
- column="server_info_id"
+ column="server_id"
autoMapping="true"
select="selectArdServerInfo">
</association>
</resultMap>
<select id="selectArdServerInfo" resultType="com.ard.work.domain.entity.ArdServerInfo">
- select * from ard_server_info where id = #{serverInfoId}
+ select * from ard_server_info 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_info_id,
- user_id,
- dept_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="selectArdDroneList" parameterType="ArdDroneInfo" resultMap="ArdDroneInfoResult">
<include refid="selectArdDroneVo"/>
- <where>
- <if test="boxSn != null and boxSn != ''"> and box_sn = #{boxSn}</if>
+ <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>
@@ -84,8 +86,10 @@
<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>
@@ -102,8 +106,10 @@
<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>
@@ -123,8 +129,10 @@
<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>
@@ -144,4 +152,48 @@
#{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