From bc1a6bb5bb2803ed6a5669a976bf2b47f3dacfca Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Wed, 14 Jan 2026 11:27:28 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwDefenseZoneMapper.xml | 64 ++++++++++++++++++++++++--------
1 files changed, 48 insertions(+), 16 deletions(-)
diff --git a/drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwDefenseZoneMapper.xml b/drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwDefenseZoneMapper.xml
index f0fa9c9..28001b9 100644
--- a/drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwDefenseZoneMapper.xml
+++ b/drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwDefenseZoneMapper.xml
@@ -3,7 +3,7 @@
<mapper namespace="org.sxkj.fw.area.mapper.FwDefenseZoneMapper">
<!-- 通用查询映射结果 -->
- <resultMap id="fwDefenseZoneResultMap" type="org.sxkj.fw.area.entity.FwDefenseZoneEntity">
+ <resultMap id="fwDefenseZoneResultMap" type="org.sxkj.fw.area.vo.FwDefenseZoneVO">
<result column="id" property="id"/>
<result column="zone_name" property="zoneName"/>
<result column="zone_area" property="zoneArea"/>
@@ -30,7 +30,11 @@
defense_scene_ids,
area_divide_ids,
device_ids,
- concat(ST_AsText(geom), ' | ', ST_SRID(geom)) as geom,
+ case
+ when geom is null then null
+ when ST_SRID(geom) is null or ST_SRID(geom) = 0 then ST_AsText(geom)
+ else concat(ST_AsText(ST_SwapXY(geom)), ' | ', ST_SRID(geom))
+ end as geom,
area_code,
create_user,
create_dept,
@@ -95,6 +99,32 @@
</where>
</select>
+ <select id="selectFwDefenseZoneDetail" resultMap="fwDefenseZoneResultMap">
+ select
+ id,
+ zone_name,
+ zone_area,
+ defense_scene_ids,
+ area_divide_ids,
+ device_ids,
+ case
+ when geom is null then null
+ when ST_SRID(geom) is null or ST_SRID(geom) = 0 then ST_AsText(geom)
+ else concat(ST_AsText(ST_SwapXY(geom)), ' | ', ST_SRID(geom))
+ end as geom,
+ area_code,
+ create_user,
+ create_dept,
+ create_time,
+ update_user,
+ update_time,
+ status,
+ is_deleted
+ from ja_fw_defense_zone
+ where is_deleted = 0
+ and id = #{id}
+ </select>
+
<select id="exportFwDefenseZone" resultType="org.sxkj.fw.area.excel.FwDefenseZoneExcel">
SELECT
@@ -142,12 +172,13 @@
#{deviceIds},
<choose>
<when test="geom != null and geom != ''">
- ST_SRID(
- ST_GeomFromText(
- trim(case when instr(#{geom}, '|') > 0 then substring_index(#{geom}, '|', 1) else #{geom} end)
- ),
- case when instr(#{geom}, '|') > 0 then cast(trim(substring_index(#{geom}, '|', -1)) as unsigned) else 4326 end
- )
+ case
+ when instr(#{geom}, '|') > 0 then ST_GeomFromText(
+ trim(substring_index(#{geom}, '|', 1)),
+ cast(trim(substring_index(#{geom}, '|', -1)) as unsigned)
+ )
+ else ST_GeomFromText(trim(#{geom}))
+ end
</when>
<otherwise>null</otherwise>
</choose>,
@@ -157,8 +188,8 @@
#{createTime},
#{updateUser},
#{updateTime},
- #{status},
- #{isDeleted}
+ IFNULL(#{status}, '0'),
+ IFNULL(#{isDeleted}, 0)
)
</insert>
@@ -171,12 +202,13 @@
<if test="areaDivideIds != null">area_divide_ids = #{areaDivideIds},</if>
<if test="deviceIds != null">device_ids = #{deviceIds},</if>
<if test="geom != null and geom != ''">
- geom = ST_SRID(
- ST_GeomFromText(
- trim(case when instr(#{geom}, '|') > 0 then substring_index(#{geom}, '|', 1) else #{geom} end)
- ),
- case when instr(#{geom}, '|') > 0 then cast(trim(substring_index(#{geom}, '|', -1)) as unsigned) else 4326 end
- ),
+ geom = case
+ when instr(#{geom}, '|') > 0 then ST_GeomFromText(
+ trim(substring_index(#{geom}, '|', 1)),
+ cast(trim(substring_index(#{geom}, '|', -1)) as unsigned)
+ )
+ else ST_GeomFromText(trim(#{geom}))
+ end,
</if>
<if test="areaCode != null">area_code = #{areaCode},</if>
<if test="createUser != null">create_user = #{createUser},</if>
--
Gitblit v1.9.3