吉安感知网项目-后端
rain
2026-01-28 54898304203f3ea0c132899dca4341dc182d13de
drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwAreaDivideMapper.xml
@@ -46,37 +46,39 @@
    <select id="selectFwAreaDividePage" 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
            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
                ad.is_deleted = 0
            <if test="param2.id != null and param2.id != ''">
                and ad.id = #{param2.id}
            </if>
@@ -118,6 +120,12 @@
            </if>
            <if test="param2.areaCode != null and param2.areaCode != ''">
                and ad.area_code = #{param2.areaCode}
            </if>
            <if test="param2.deptList != null and param2.deptList.size > 0">
                and ad.create_dept in
                <foreach collection="param2.deptList" item="deptId" open="(" separator="," close=")">
                    #{deptId}
                </foreach>
            </if>
        </where>
    </select>
@@ -282,21 +290,21 @@
    <select id="selectFwAreaDivideStatisticsPage" resultMap="fwAreaDivideStatisticsResultMap">
        select
        stats.id,
        stats.area_name,
        stats.area_type,
        stats.scene_name,
        stats.scene_type,
        stats.device_count,
        stats.alarm_count,
        stats.counter_count,
        stats.counter_success_count,
        case
            when stats.counter_count = 0 then '/'
            when stats.counter_success_count * 100.0 / stats.counter_count &gt;= 80 then '好'
            when stats.counter_success_count * 100.0 / stats.counter_count &gt;= 60 then '一般'
            stats.id,
            stats.area_name,
            stats.area_type,
            stats.scene_name,
            stats.scene_type,
            stats.device_count,
            stats.alarm_count,
            stats.counter_count,
            stats.counter_success_count,
            case
                when stats.counter_count = 0 then '/'
                when stats.counter_success_count * 100.0 / stats.counter_count &gt;= 80 then '好'
                when stats.counter_success_count * 100.0 / stats.counter_count &gt;= 60 then '一般'
            else '差'
        end as control_effect
                end as control_effect
        from (
            select
            ad.id,
@@ -373,6 +381,12 @@
                <if test="param2.areaCode != null and param2.areaCode != ''">
                    and ad.area_code = #{param2.areaCode}
                </if>
                <if test="param2.deptList != null and param2.deptList.size > 0">
                    and ad.create_dept in
                    <foreach collection="param2.deptList" item="deptId" open="(" separator="," close=")">
                        #{deptId}
                    </foreach>
                </if>
            </where>
        ) stats
    </select>