吉安感知网项目-后端
linwei
6 days ago 8585b431e9257333413358eb37c30ae58f74db76
drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwDefenseSceneMapper.xml
@@ -50,16 +50,25 @@
    </select>
    <select id="selectFwDefenseSceneList" resultMap="fwDefenseSceneResultMap">
        select ds.* from ja_fw_defense_scene ds
        select
            ds.*
        from
            ja_fw_defense_scene ds
        <where>
            ds.is_deleted = 0
                ds.is_deleted = 0
            <if test="deptList != null and deptList.size > 0">
                and ds.create_dept in
                <foreach collection="deptList" item="deptId" open="(" separator="," close=")">
                    #{deptId}
                </foreach>
            </if>
            <if test="unbound != null and unbound == 1">
                and (
                    not exists (
                        select 1
                        from ja_fw_defense_scene_manage dsm
                        where dsm.is_deleted = 0
                          and dsm.defense_scene_id = ds.id
                          and dsm.defense_scene_id::VARCHAR = ds.id::VARCHAR
                    )
                    <if test="sceneManageId != null">
                        or exists (
@@ -67,7 +76,7 @@
                            from ja_fw_defense_scene_manage dsm
                            where dsm.is_deleted = 0
                              and dsm.id = #{sceneManageId}
                              and dsm.defense_scene_id = ds.id
                              and dsm.defense_scene_id::VARCHAR = ds.id::VARCHAR
                        )
                    </if>
                )
@@ -80,7 +89,7 @@
                        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 ds.id = ANY(string_to_array(dz.defense_scene_ids, ',')::bigint[])
                    )
                    <if test="zoneId != null">
                        or exists (
@@ -90,7 +99,7 @@
                              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)
                              and ds.id = ANY(string_to_array(dz.defense_scene_ids, ',')::bigint[])
                        )
                    </if>
                )
@@ -98,7 +107,7 @@
            <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, ' ', ''))
                and #{areaId} = ANY(string_to_array(replace(ds.area_divide_ids, ' ', ''), ',')::bigint[])
            </if>
        </where>
    </select>