From 2358538cb53e2784caf8f4e09d9f638f30e55211 Mon Sep 17 00:00:00 2001
From: xiebin <vip_xiaobin810@163.com>
Date: Fri, 03 Apr 2026 13:45:35 +0800
Subject: [PATCH] opt: ST_GeomFromText-替换人大金仓-ST_GeometryFromText

---
 drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwDefenseZoneMapper.xml |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 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 fcb116c..d95e3f9 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
@@ -96,7 +96,7 @@
             and ds.area_divide_ids is not null
             and ds.area_divide_ids != ''
             and ad.id = ANY(string_to_array(replace(ds.area_divide_ids, ' ', ''), ',')::bigint[])
-        left join ja_fw_police_station ps on ps.id = ad.police_station_id::VARCHAR and ps.is_deleted = 0
+        left join ja_fw_police_station ps on ps.id::VARCHAR = ad.police_station_id::VARCHAR and ps.is_deleted = 0
     </select>
 
 
@@ -146,7 +146,7 @@
                 and ST_Equals(
                     geom,
                     ST_SRID(
-                        ST_GeomFromText(
+                        ST_GeometryFromText(
                             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
@@ -251,11 +251,11 @@
             <choose>
                 <when test="geom != null and geom != ''">
                     case
-                        when instr(#{geom}, '|') &gt; 0 then ST_GeomFromText(
+                        when instr(#{geom}, '|') &gt; 0 then ST_GeometryFromText(
                             trim(substring_index(#{geom}, '|', 1)),
                             cast(trim(substring_index(#{geom}, '|', -1)) as unsigned)
                         )
-                        else ST_GeomFromText(trim(#{geom}))
+                        else ST_GeometryFromText(trim(#{geom}))
                     end
                 </when>
                 <otherwise>null</otherwise>
@@ -266,8 +266,8 @@
             #{createTime},
             #{updateUser},
             #{updateTime},
-            IFNULL(#{status}, '0'),
-            IFNULL(#{isDeleted}, 0)
+        COALESCE(#{status}, '0'),
+        COALESCE(#{isDeleted}, 0)
         )
     </insert>
 
@@ -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_GeomFromText(
+                    when instr(#{geom}, '|') &gt; 0 then ST_GeometryFromText(
                         trim(substring_index(#{geom}, '|', 1)),
                         cast(trim(substring_index(#{geom}, '|', -1)) as unsigned)
                     )
-                    else ST_GeomFromText(trim(#{geom}))
+                    else ST_GeometryFromText(trim(#{geom}))
                 end,
             </if>
             <if test="areaCode != null">area_code = #{areaCode},</if>

--
Gitblit v1.9.3