吉安感知网项目-后端
linwei
2026-01-14 bc1a6bb5bb2803ed6a5669a976bf2b47f3dacfca
drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwDefenseSceneMapper.xml
@@ -88,15 +88,33 @@
        <where>
            ds.is_deleted = 0
            <if test="filterSelected != null and filterSelected == 1">
                and not exists (
                    select 1
                    from ja_fw_defense_zone dz
                    where dz.is_deleted = 0
                      and dz.defense_scene_ids is not null
                      and dz.defense_scene_ids != ''
                      and find_in_set(ds.id, dz.defense_scene_ids)
                and (
                    not exists (
                        select 1
                        from ja_fw_defense_zone dz
                        where dz.is_deleted = 0
                          and dz.defense_scene_ids is not null
                          and dz.defense_scene_ids != ''
                          and find_in_set(ds.id, dz.defense_scene_ids)
                    )
                    <if test="zoneId != null">
                        or exists (
                            select 1
                            from ja_fw_defense_zone dz
                            where dz.is_deleted = 0
                              and dz.id = #{zoneId}
                              and dz.defense_scene_ids is not null
                              and dz.defense_scene_ids != ''
                              and find_in_set(ds.id, dz.defense_scene_ids)
                        )
                    </if>
                )
            </if>
            <if test="areaId != null and (filterSelected == null or filterSelected != 1)">
                and ds.area_divide_ids is not null
                and ds.area_divide_ids != ''
                and find_in_set(#{areaId}, replace(ds.area_divide_ids, ' ', ''))
            </if>
        </where>
    </select>