吉安感知网项目-后端
linwei
2026-04-02 716e79646c1b6f950d07096188c681cdbc9c077a
sql改造
1 files modified
17 ■■■■ changed files
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMapper.xml 17 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMapper.xml
@@ -770,17 +770,18 @@
        FROM
            ja_fw_device d
        LEFT JOIN ja_fw_area_divide ad
            ON find_in_set(d.id, ad.device_ids) > 0
            AND ad.is_deleted = 0
        ON d.id = ANY(string_to_array(ad.device_ids, ',')::bigint[])
        AND ad.is_deleted = 0
        WHERE
            d.is_deleted = 0
        AND d.is_enabled = 1
        AND d.final_outbound_area IS NOT NULL
        <if test="regionCode != null and regionCode != ''">
            and ( d.final_outbound_area_code like concat(#{regionCode},'%')
            and ( d.final_outbound_area_code::text LIKE concat(#{regionCode}, '%')
            <if test="currentDeptId != null and currentDeptId != '' ">
                or d.id in (
                SELECT device_id FROM ja_fw_device_per_share
                or d.id IN (
                SELECT device_id::bigint
                FROM ja_fw_device_per_share
                WHERE loan_to_dept_id = #{currentDeptId}
                AND is_deleted = 0
                )
@@ -795,9 +796,9 @@
            where ds.is_deleted = 0
            and ds.area_divide_ids is not null
            and ds.area_divide_ids != ''
            and find_in_set(ad.id, replace(ds.area_divide_ids, ' ', ''))
            and (dsm.effective_date_start is null or dsm.effective_date_start &lt;= #{flyTime})
            and (dsm.effective_date_end is null or dsm.effective_date_end &gt;= #{flyTime})
            and ad.id = ANY(string_to_array(replace(ds.area_divide_ids, ' ', ''), ',')::bigint[])
            and dsm.effective_date_start &lt;= #{flyTime}::timestamp
            and dsm.effective_date_end &gt;= #{flyTime}::timestamp
            )
        </if>
        GROUP BY