From 6b3eead4b660064f58412c80d36b35cc659fc077 Mon Sep 17 00:00:00 2001
From: rain <1679827795@qq.com>
Date: Tue, 13 Jan 2026 10:55:26 +0800
Subject: [PATCH] 设备,场景,区域,派出所新增list

---
 drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwAreaDivideMapper.xml |   58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 56 insertions(+), 2 deletions(-)

diff --git a/drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwAreaDivideMapper.xml b/drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwAreaDivideMapper.xml
index 46a84c4..59edf3f 100644
--- a/drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwAreaDivideMapper.xml
+++ b/drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwAreaDivideMapper.xml
@@ -52,7 +52,11 @@
         ad.longitude,
         ad.latitude,
         ad.area_size,
-        concat(ST_AsText(ST_SwapXY(ad.geom)), ' | ', ST_SRID(ad.geom)) as geom,
+        case
+            when ad.geom is null then null
+            when ST_SRID(ad.geom) is null or ST_SRID(ad.geom) = 0 then ST_AsText(ad.geom)
+            else concat(ST_AsText(ST_SwapXY(ad.geom)), ' | ', ST_SRID(ad.geom))
+        end as geom,
         ad.area_type,
         ad.trigger_condition,
         ad.response_mechanism,
@@ -119,6 +123,52 @@
         </where>
     </select>
 
+    <select id="selectFwAreaDivideList" resultMap="fwAreaDivideResultMap">
+        select
+        ad.id,
+        ad.area_name,
+        ad.longitude,
+        ad.latitude,
+        ad.area_size,
+        case
+            when ad.geom is null then null
+            when ST_SRID(ad.geom) is null or ST_SRID(ad.geom) = 0 then ST_AsText(ad.geom)
+            else concat(ST_AsText(ST_SwapXY(ad.geom)), ' | ', ST_SRID(ad.geom))
+        end as geom,
+        ad.area_type,
+        ad.trigger_condition,
+        ad.response_mechanism,
+        ad.control_level,
+        ad.police_station_id,
+        ad.device_ids,
+        ad.fly_date_start,
+        ad.fly_date_end,
+        ad.area_code,
+        ps.station_name as police_station_name,
+        ad.create_user,
+        ad.create_dept,
+        ad.create_time,
+        ad.update_user,
+        ad.update_time,
+        ad.status,
+        ad.is_deleted
+        from ja_fw_area_divide ad
+        left join ja_fw_police_station ps on ps.id = ad.police_station_id and ps.is_deleted = 0
+        <where>
+            ad.is_deleted = 0
+            <if test="filterSelected != null and filterSelected == 1">
+                and not exists (
+                    select 1
+                    from ja_fw_defense_scene ds
+                    where ds.is_deleted = 0
+                      and ds.area_divide_ids is not null
+                      and ds.area_divide_ids != ''
+                      and find_in_set(ad.id, ds.area_divide_ids)
+                )
+            </if>
+        </where>
+    </select>
+
     <select id="selectFwAreaDivideDetail" resultMap="fwAreaDivideResultMap">
         select
         ad.id,
@@ -126,7 +176,11 @@
         ad.longitude,
         ad.latitude,
         ad.area_size,
-        concat(ST_AsText(ST_SwapXY(ad.geom)), ' | ', ST_SRID(ad.geom)) as geom,
+        case
+            when ad.geom is null then null
+            when ST_SRID(ad.geom) is null or ST_SRID(ad.geom) = 0 then ST_AsText(ad.geom)
+            else concat(ST_AsText(ST_SwapXY(ad.geom)), ' | ', ST_SRID(ad.geom))
+        end as geom,
         ad.area_type,
         ad.trigger_condition,
         ad.response_mechanism,

--
Gitblit v1.9.3