吉安感知网项目-后端
linwei
2026-02-03 4a6c8a672dc22fe730c0d891eb42b31f2f06f713
Merge remote-tracking branch 'origin/master'
5 files modified
82 ■■■■■ changed files
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceController.java 6 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMapper.java 3 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMapper.xml 66 ●●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/IFwDeviceService.java 3 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceServiceImpl.java 4 ●●●● patch | view | raw | blame | history
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/controller/FwDeviceController.java
@@ -86,12 +86,14 @@
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "列表", notes = "传入isAreaSelect、areaId、status")
    @ApiOperation(value = "列表", notes = "传入isAreaSelect、areaId、areaIds、status")
    public R<List<FwDeviceVO>> list(@RequestParam(value = "isAreaSelect", required = false) Integer isAreaSelect,
                                    @RequestParam(value = "areaId", required = false) Long areaId,
                                    @RequestParam(value = "areaIds", required = false) String areaIds,
                                    @RequestParam(value = "status", required = false) Integer status,
                                    @RequestParam(value = "isTrack", required = false) Integer isTrack) {
        List<FwDeviceEntity> list = fwDeviceService.selectFwDeviceList(isAreaSelect, areaId, status, isTrack);
        List<Long> areaIdList = Func.toLongList(areaIds);
        List<FwDeviceEntity> list = fwDeviceService.selectFwDeviceList(isAreaSelect, areaId, areaIdList, status, isTrack);
        FwDeviceWrapper wrapper = FwDeviceWrapper.build();
        return R.data(list.stream().map(wrapper::entityVO).collect(Collectors.toList()));
    }
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMapper.java
@@ -54,10 +54,11 @@
     *
     * @param isAreaSelect
     * @param areaId
     * @param areaIds
     * @return
     */
    List<FwDeviceEntity> selectFwDeviceList(@Param("isAreaSelect") Integer isAreaSelect, @Param("areaId") Long areaId,
                                            @Param("status") Integer status, @Param("isTrack") Integer isTrack);
                                            @Param("areaIds") List<Long> areaIds, @Param("status") Integer status, @Param("isTrack") Integer isTrack);
    /**
     * 根据多边形查询设备列表
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/mapper/FwDeviceMapper.xml
@@ -104,42 +104,60 @@
        select * from ja_fw_device
        <where>
            is_deleted = 0
            <if test="isAreaSelect != null and isAreaSelect == 1">
                and (
            <choose>
                <when test="areaIds != null and areaIds.size > 0">
                    and (
                        exists (
                    select 1
                    from ja_fw_area_divide ad
                    where ad.is_deleted = 0
                    and ad.id in
                    <foreach collection="areaIds" item="areaIdItem" separator="," open="(" close=")">
                        #{areaIdItem}
                    </foreach>
                    and ad.device_ids is not null
                    and ad.device_ids != ''
                    and find_in_set(ja_fw_device.id, ad.device_ids)
                        )
                    )
                </when>
                <when test="isAreaSelect != null and isAreaSelect == 1">
                    and (
                    <choose>
                        <when test="areaId != null">
                            exists (
                                select 1
                                from ja_fw_area_divide ad
                                where ad.is_deleted = 0
                                and ad.id = #{areaId}
                                and ad.device_ids is not null
                                and ad.device_ids != ''
                                and find_in_set(ja_fw_device.id, ad.device_ids)
                            select 1
                            from ja_fw_area_divide ad
                            where ad.is_deleted = 0
                            and ad.id = #{areaId}
                            and ad.device_ids is not null
                            and ad.device_ids != ''
                            and find_in_set(ja_fw_device.id, ad.device_ids)
                            )
                            or not exists (
                                select 1
                                from ja_fw_area_divide ad
                                where ad.is_deleted = 0
                                and ad.device_ids is not null
                                and ad.device_ids != ''
                                and find_in_set(ja_fw_device.id, ad.device_ids)
                                and ad.id != #{areaId}
                            select 1
                            from ja_fw_area_divide ad
                            where ad.is_deleted = 0
                            and ad.device_ids is not null
                            and ad.device_ids != ''
                            and find_in_set(ja_fw_device.id, ad.device_ids)
                            and ad.id != #{areaId}
                            )
                        </when>
                        <otherwise>
                            not exists (
                                select 1
                                from ja_fw_area_divide ad
                                where ad.is_deleted = 0
                                and ad.device_ids is not null
                                and ad.device_ids != ''
                                and find_in_set(ja_fw_device.id, ad.device_ids)
                            select 1
                            from ja_fw_area_divide ad
                            where ad.is_deleted = 0
                            and ad.device_ids is not null
                            and ad.device_ids != ''
                            and find_in_set(ja_fw_device.id, ad.device_ids)
                            )
                        </otherwise>
                    </choose>
                )
            </if>
                    )
                </when>
            </choose>
            <if test="status != null">
                and status = #{status}
            </if>
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/IFwDeviceService.java
@@ -63,10 +63,11 @@
     *
     * @param isAreaSelect 是否过滤区域
     * @param areaId 设备被关联区域id
     * @param areaIds 设备被关联区域id集合
     * @param status 设备状态
     * @return
     */
    List<FwDeviceEntity> selectFwDeviceList(Integer isAreaSelect, Long areaId, Integer status, Integer isTrack);
    List<FwDeviceEntity> selectFwDeviceList(Integer isAreaSelect, Long areaId, List<Long> areaIds, Integer status, Integer isTrack);
    /**
     * 根据多边形查询设备列表
drone-service/drone-fw/src/main/java/org/sxkj/fw/device/service/impl/FwDeviceServiceImpl.java
@@ -92,8 +92,8 @@
    }
    @Override
    public List<FwDeviceEntity> selectFwDeviceList(Integer isAreaSelect, Long areaId, Integer status, Integer isTrack) {
        return baseMapper.selectFwDeviceList(isAreaSelect, areaId, status, isTrack);
    public List<FwDeviceEntity> selectFwDeviceList(Integer isAreaSelect, Long areaId, List<Long> areaIds, Integer status, Integer isTrack) {
        return baseMapper.selectFwDeviceList(isAreaSelect, areaId, areaIds, status, isTrack);
    }
    @Override