From 8585b431e9257333413358eb37c30ae58f74db76 Mon Sep 17 00:00:00 2001
From: linwei <872216696@qq.com>
Date: Thu, 13 Aug 2026 15:46:10 +0800
Subject: [PATCH] refactor(database): 优化数据库查询中的字段映射

---
 drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwDefenseZoneMapper.xml |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 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 d95e3f9..9612c28 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
@@ -63,8 +63,8 @@
         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))
+            when ST_SRID(ad.geom) is null or ST_SRID(ad.geom) = 0 then public.st_astext(ad.geom)
+            else concat(public.st_astext(ST_SwapXY(ad.geom)), ' | ', ST_SRID(ad.geom))
         end as geom,
         ad.area_type,
         ad.trigger_condition,
@@ -110,8 +110,8 @@
         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))
+            when ST_SRID(geom) is null or ST_SRID(geom) = 0 then public.st_astext(geom)
+            else concat(public.st_astext(ST_SwapXY(geom)), ' | ', ST_SRID(geom))
         end as geom,
         area_code,
         create_user,
@@ -146,7 +146,7 @@
                 and ST_Equals(
                     geom,
                     ST_SRID(
-                        ST_GeometryFromText(
+                        ST_GeomFromText(
                             trim(case when instr(#{param2.geom}, '|') &gt; 0 then substring_index(#{param2.geom}, '|', 1) else #{param2.geom} end)
                         ),
                         case when instr(#{param2.geom}, '|') &gt; 0 then cast(trim(substring_index(#{param2.geom}, '|', -1)) as unsigned) else 4326 end
@@ -187,8 +187,8 @@
         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))
+            when ST_SRID(geom) is null or ST_SRID(geom) = 0 then public.st_astext(geom)
+            else concat(public.st_astext(ST_SwapXY(geom)), ' | ', ST_SRID(geom))
         end as geom,
         area_code,
         create_user,
@@ -212,7 +212,7 @@
         defense_scene_ids,
         area_divide_ids,
         device_ids,
-        concat(ST_AsText(geom), ' | ', ST_SRID(geom)) as geom,
+        concat(public.st_astext(geom), ' | ', ST_SRID(geom)) as geom,
         area_code,
         create_user,
         create_dept,
@@ -251,11 +251,11 @@
             <choose>
                 <when test="geom != null and geom != ''">
                     case
-                        when instr(#{geom}, '|') &gt; 0 then ST_GeometryFromText(
+                        when instr(#{geom}, '|') &gt; 0 then ST_GeomFromText(
                             trim(substring_index(#{geom}, '|', 1)),
                             cast(trim(substring_index(#{geom}, '|', -1)) as unsigned)
                         )
-                        else ST_GeometryFromText(trim(#{geom}))
+                        else ST_GeomFromText(trim(#{geom}))
                     end
                 </when>
                 <otherwise>null</otherwise>
@@ -281,11 +281,11 @@
             <if test="deviceIds != null">device_ids = #{deviceIds},</if>
             <if test="geom != null and geom != ''">
                 geom = case
-                    when instr(#{geom}, '|') &gt; 0 then ST_GeometryFromText(
+                    when instr(#{geom}, '|') &gt; 0 then ST_GeomFromText(
                         trim(substring_index(#{geom}, '|', 1)),
                         cast(trim(substring_index(#{geom}, '|', -1)) as unsigned)
                     )
-                    else ST_GeometryFromText(trim(#{geom}))
+                    else ST_GeomFromText(trim(#{geom}))
                 end,
             </if>
             <if test="areaCode != null">area_code = #{areaCode},</if>

--
Gitblit v1.9.3