吉安感知网项目-后端
linwei
2026-01-27 e7e920b15e7cb9cf28e380a445ce87b9937c675a
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMapper.xml
@@ -38,7 +38,18 @@
    <select id="selectFwDevicePage" resultMap="fwDeviceResultMap">
        select * from ja_fw_device
        select
            *,
            (
            select
                 count(*)
             from
                 ja_fw_device_track tmp
             where
                 ja_fw_device.id = tmp.device_id
                ) out_count
            from
                ja_fw_device
        <where>
            is_deleted = 0
            <if test="param2.id != null and param2.id != ''">
@@ -80,6 +91,12 @@
            </if>
            <if test="param2.status != null">
                and status = #{param2.status}
            </if>
            <if test="param2.isTrack != null and param2.isTrack == 1">
                and (SELECT COUNT(*) FROM ja_fw_device_track tmp WHERE ja_fw_device.id = tmp.device_id) > 0
            </if>
            <if test="param2.isTrack != null and param2.isTrack == 2">
                and (SELECT COUNT(*) FROM ja_fw_device_track tmp WHERE ja_fw_device.id = tmp.device_id) = 0
            </if>
        </where>
    </select>
@@ -225,6 +242,13 @@
        WHERE
            d.is_deleted = 0
          AND t.out_target IS NOT NULL
        <if test="effectiveRangeKmIsNotNull != null and effectiveRangeKmIsNotNull == 1">
            and d.effective_range_km is not null
            and d.effective_range_km > 0
        </if>
        <if test="effectiveRangeKmIsNotNull != null and effectiveRangeKmIsNotNull == 2">
            and (d.effective_range_km is null or d.effective_range_km = 0)
        </if>
        GROUP BY
            t.out_target;
    </select>