吉安感知网项目-后端
xiebin
2026-01-28 74756c657109a4e48dd6c0b4d8959cdab89b33a9
drone-service/drone-fw/src/main/java/org/sxkj/fw/area/mapper/FwDefenseSceneMapper.xml
@@ -21,14 +21,16 @@
        <result column="update_user" property="updateUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="status" property="status"/>
        <result column="is_deleted" property="isDeleted"/>
    </resultMap>
    <select id="selectFwDefenseScenePage" resultMap="fwDefenseSceneResultMap">
        select * from ja_fw_defense_scene
        select
            *
        from
            ja_fw_defense_scene
        <where>
            is_deleted = 0
                and is_deleted = 0
            <if test="param2.id != null and param2.id != ''">
                and id = #{param2.id}
            </if>
@@ -80,6 +82,12 @@
            <if test="param2.status != null and param2.status != ''">
                and status = #{param2.status}
            </if>
            <if test="param2.deptList != null and param2.deptList.size > 0">
                and create_dept in
                <foreach collection="param2.deptList" item="deptId" open="(" separator="," close=")">
                    #{deptId}
                </foreach>
            </if>
        </where>
    </select>
@@ -87,14 +95,9 @@
        select ds.* from ja_fw_defense_scene ds
        <where>
            ds.is_deleted = 0
            <choose>
                <when test="areaId != null">
                    and ds.area_divide_ids is not null
                    and ds.area_divide_ids != ''
                    and find_in_set(#{areaId}, replace(ds.area_divide_ids, ' ', ''))
                </when>
                <when test="filterSelected != null and filterSelected == 1">
                    and not exists (
            <if test="filterSelected != null and filterSelected == 1">
                and (
                    not exists (
                        select 1
                        from ja_fw_defense_zone dz
                        where dz.is_deleted = 0
@@ -102,8 +105,24 @@
                          and dz.defense_scene_ids != ''
                          and find_in_set(ds.id, dz.defense_scene_ids)
                    )
                </when>
            </choose>
                    <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>