From dbb1b432f9d483484cda2c529f39b6972d9e67b6 Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Fri, 23 Jan 2026 15:23:11 +0800
Subject: [PATCH] 设备管理

---
 drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdManageDeviceMapper.xml |  118 ++++++++++++++++++++++++++++++-----------------------------
 1 files changed, 60 insertions(+), 58 deletions(-)

diff --git a/drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdManageDeviceMapper.xml b/drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdManageDeviceMapper.xml
index fff0f13..32cc4ea 100644
--- a/drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdManageDeviceMapper.xml
+++ b/drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdManageDeviceMapper.xml
@@ -8,88 +8,90 @@
         <result column="device_sn" property="deviceSn"/>
         <result column="device_name" property="deviceName"/>
         <result column="nickname" property="nickname"/>
-        <result column="workspace_id" property="workspaceId"/>
         <result column="device_type" property="deviceType"/>
-        <result column="sub_type" property="subType"/>
         <result column="device_payload" property="devicePayload"/>
         <result column="longitude" property="longitude"/>
         <result column="latitude" property="latitude"/>
-        <result column="user_id" property="userId"/>
-        <result column="domain" property="domain"/>
         <result column="firmware_version" property="firmwareVersion"/>
-        <result column="compatible_status" property="compatibleStatus"/>
-        <result column="version" property="version"/>
-        <result column="device_index" property="deviceIndex"/>
         <result column="child_sn" property="childSn"/>
-        <result column="bound_time" property="boundTime"/>
-        <result column="bound_status" property="boundStatus"/>
-        <result column="login_time" property="loginTime"/>
-        <result column="device_desc" property="deviceDesc"/>
-        <result column="url_normal" property="urlNormal"/>
-        <result column="url_select" property="urlSelect"/>
-        <result column="reserve_id" property="reserveId"/>
-        <result column="creama_name" property="creamaName"/>
-        <result column="machine_nest_sn" property="machineNestSn"/>
-        <result column="operate_password" property="operatePassword"/>
-        <result column="mode_code" property="modeCode"/>
-        <result column="movable" property="movable"/>
+         <result column="mode_code" property="modeCode"/>
         <result column="insure_expired_time" property="insureExpiredTime"/>
-        <result column="flow_type" property="flowType"/>
-        <result column="maintenance_start" property="maintenanceStart"/>
-        <result column="maintenance_end" property="maintenanceEnd"/>
-        <result column="insure_start_time" property="insureStartTime"/>
-        <result column="eid" property="eid"/>
         <result column="traffic_remaining" property="trafficRemaining"/>
         <result column="traffic_expire_time" property="trafficExpireTime"/>
-        <result column="hidden_flag" property="hiddenFlag"/>
-        <result column="deployment_mode" property="deploymentMode"/>
-        <result column="dept_id" property="deptId"/>
         <result column="create_time" property="createTime"/>
         <result column="update_time" property="updateTime"/>
         <result column="is_deleted" property="isDeleted"/>
-        <result column="area_code" property="areaCode"/>
-        <result column="traffic_data" property="trafficData"/>
-        <result column="dem_status" property="demStatus"/>
     </resultMap>
 
 
     <select id="selectGdManageDevicePage" resultMap="gdManageDeviceResultMap">
-        select id, device_sn, device_name, nickname, device_payload,longitude,latitude
-        from ja_gd_manage_device
-        where is_deleted = 0
+        select
+            id,
+            device_sn,
+            device_name,
+            nickname,
+            device_payload,
+            longitude,
+            latitude,
+            location
+        from
+            ja_gd_manage_device
+        <where>
+            <if test="deviceName != null and deviceName != ''">
+                and device_name like concat('%',#{deviceName},'%')
+            </if>
+            <if test="nickname != null and nickname != ''">
+                and nickname like concat('%',#{nickname},'%')
+            </if>
+            <if test="deptId != null">
+                and create_dept = #{deptId}
+            </if>
+            <if test="location != null and location != ''">
+                and location like concat('%',#{location},'%')
+            </if>
+                is_deleted = 0
+        </where>
     </select>
 
 
     <select id="exportGdManageDevice" resultType="org.sxkj.gd.workorder.excel.GdManageDeviceExcel">
-        SELECT * FROM ja_gd_manage_device ${ew.customSqlSegment}
+        SELECT
+            *
+        FROM
+            ja_gd_manage_device ${ew.customSqlSegment}
     </select>
 
     <select id="selectGdManageDevice" resultType="org.sxkj.gd.workorder.vo.GdManageDeviceVO">
         select
-        id,
-        device_sn,
-        device_name,
-        nickname,
-        device_payload,
-        longitude,
-        latitude,
-        geom
+            id,
+            device_sn,
+            device_name,
+            nickname,
+            device_payload,
+            longitude,
+            latitude,
+            geom
         from
-        ja_gd_manage_device
-        where
-        is_deleted = 0
-        <if test="deviceIds != null and deviceIds.size() > 0">
-            and id in
-            <foreach item="item" collection="deviceIds" index="index" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </if>
-        <if test="devicePayload != null and devicePayload != ''">
-            and device_payload like concat('%',#{devicePayload},'%')
-        </if>
-        <if test="geom != null and geom != ''">
-            and ST_Intersects(geom, ST_GeomFromText(#{geom}))
-        </if>
-    </select>
+            ja_gd_manage_device
+        <where>
+            <if test="deviceIds != null and deviceIds.size() > 0">
+                and id in
+                <foreach item="item" collection="deviceIds" index="index" open="(" close=")" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="devicePayload != null and devicePayload != ''">
+                and device_payload like concat('%',#{devicePayload},'%')
+            </if>
+            <if test="geom != null and geom != ''">
+                and ST_Intersects(geom, ST_GeomFromText(#{geom}))
+            </if>
+                is_deleted = 0
+        </where>
+
+
+                <if test="isDeleted != null">
+                and is_deleted = #{isDeleted}
+            </if></select>
 
 </mapper>

--
Gitblit v1.9.3