吉安感知网项目-后端
linwei
2026-02-02 1bfbc52da47b22f00a1c1f5f670c30f70d999873
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>
@@ -38,47 +40,11 @@
            <if test="param2.sceneType != null and param2.sceneType != ''">
                and scene_type = #{param2.sceneType}
            </if>
            <if test="param2.longitude != null and param2.longitude != ''">
                and longitude = #{param2.longitude}
            </if>
            <if test="param2.latitude != null and param2.latitude != ''">
                and latitude = #{param2.latitude}
            </if>
            <if test="param2.defenseLeader != null and param2.defenseLeader != ''">
                and defense_leader like concat('%', #{param2.defenseLeader}, '%')
            </if>
            <if test="param2.leaderPhone != null and param2.leaderPhone != ''">
                and leader_phone = #{param2.leaderPhone}
            </if>
            <if test="param2.defenseArea != null and param2.defenseArea != ''">
                and defense_area = #{param2.defenseArea}
            </if>
            <if test="param2.deviceMode != null and param2.deviceMode != ''">
                and device_mode = #{param2.deviceMode}
            </if>
            <if test="param2.areaDivideIds != null and param2.areaDivideIds != ''">
                and area_divide_ids = #{param2.areaDivideIds}
            </if>
            <if test="param2.areaCode != null and param2.areaCode != ''">
                and area_code = #{param2.areaCode}
            </if>
            <if test="param2.createUser != null and param2.createUser != ''">
                and create_user = #{param2.createUser}
            </if>
            <if test="param2.createDept != null and param2.createDept != ''">
                and create_dept = #{param2.createDept}
            </if>
            <if test="param2.createTime != null and param2.createTime != ''">
                and create_time = #{param2.createTime}
            </if>
            <if test="param2.updateUser != null and param2.updateUser != ''">
                and update_user = #{param2.updateUser}
            </if>
            <if test="param2.updateTime != null and param2.updateTime != ''">
                and update_time = #{param2.updateTime}
            </if>
            <if test="param2.status != null and param2.status != ''">
                and status = #{param2.status}
            <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 +53,28 @@
        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="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
                    )
                    <if test="sceneManageId != null">
                        or exists (
                            select 1
                            from ja_fw_defense_scene_manage dsm
                            where dsm.is_deleted = 0
                              and dsm.id = #{sceneManageId}
                              and dsm.defense_scene_id = ds.id
                        )
                    </if>
                )
            </if>
            <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 +82,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>