吉安感知网项目-后端
linwei
2026-01-30 9589ee836c7921cbd85edd0dec994c77fa5ba7e4
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMapper.xml
@@ -711,14 +711,9 @@
        SELECT
            d.*,
            t.out_target,
            ps.id AS shareId,
            CASE
                WHEN EXISTS (
                    SELECT 1
                    FROM ja_fw_device_per_share ps
                    WHERE ps.device_id = d.id
                    AND ps.loan_to_dept_id = #{currentDeptId}
                    AND ps.is_deleted = 0
                ) THEN TRUE
                WHEN ps.id IS NOT NULL THEN TRUE
                ELSE FALSE
            END AS isShared
        FROM
@@ -739,6 +734,9 @@
            out_target IS NOT NULL
            ) t ON d.id = t.device_id
            AND t.rn = 1
            LEFT JOIN ja_fw_device_per_share ps ON ps.device_id = d.id
            AND ps.loan_to_dept_id = #{currentDeptId}
            AND ps.is_deleted = 0
        WHERE
            d.is_deleted = 0
          and d.effective_range_km is not null