吉安感知网项目-后端
rain
2026-01-13 d41b62733157067f352b43f9a6e635cedb0b6986
优化区域模块的geom格式
1 files modified
41 ■■■■■ changed files
drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwAreaDivideMapper.xml 41 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwAreaDivideMapper.xml
@@ -52,7 +52,7 @@
        ad.longitude,
        ad.latitude,
        ad.area_size,
        concat(ST_AsText(ad.geom), ' | ', ST_SRID(ad.geom)) as geom,
        concat(ST_AsText(ST_SwapXY(ad.geom)), ' | ', ST_SRID(ad.geom)) as geom,
        ad.area_type,
        ad.trigger_condition,
        ad.response_mechanism,
@@ -88,17 +88,6 @@
            </if>
            <if test="param2.areaSize != null and param2.areaSize != ''">
                and ad.area_size = #{param2.areaSize}
            </if>
            <if test="param2.geom != null and param2.geom != ''">
                and ST_Equals(
                    ad.geom,
                    ST_SRID(
                        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
                    )
                )
            </if>
            <if test="param2.areaType != null and param2.areaType != ''">
                and ad.area_type = #{param2.areaType}
@@ -137,7 +126,7 @@
        ad.longitude,
        ad.latitude,
        ad.area_size,
        concat(ST_AsText(ad.geom), ' | ', ST_SRID(ad.geom)) as geom,
        concat(ST_AsText(ST_SwapXY(ad.geom)), ' | ', ST_SRID(ad.geom)) as geom,
        ad.area_type,
        ad.trigger_condition,
        ad.response_mechanism,
@@ -402,12 +391,13 @@
            #{areaSize},
            <choose>
                <when test="geom != null and geom != ''">
                    ST_SRID(
                        ST_GeomFromText(
                            trim(case when instr(#{geom}, '|') &gt; 0 then substring_index(#{geom}, '|', 1) else #{geom} end)
                        ),
                        case when instr(#{geom}, '|') &gt; 0 then cast(trim(substring_index(#{geom}, '|', -1)) as unsigned) else 4326 end
                    )
                    case
                        when instr(#{geom}, '|') &gt; 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>,
@@ -438,12 +428,13 @@
            <if test="latitude != null">latitude = #{latitude},</if>
            <if test="areaSize != null">area_size = #{areaSize},</if>
            <if test="geom != null and geom != ''">
                geom = ST_SRID(
                    ST_GeomFromText(
                        trim(case when instr(#{geom}, '|') &gt; 0 then substring_index(#{geom}, '|', 1) else #{geom} end)
                    ),
                    case when instr(#{geom}, '|') &gt; 0 then cast(trim(substring_index(#{geom}, '|', -1)) as unsigned) else 4326 end
                ),
                geom = case
                    when instr(#{geom}, '|') &gt; 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="areaType != null">area_type = #{areaType},</if>
            <if test="triggerCondition != null">trigger_condition = #{triggerCondition},</if>