| | |
| | | List<FwDefenseSceneVO> selectFwDefenseSceneListByAreaIds(@Param("areaIds") List<Long> areaIds); |
| | | |
| | | /** |
| | | * 根据设备ID统计关联区域数量 |
| | | * |
| | | * @param deviceId |
| | | * @return |
| | | */ |
| | | Integer selectAreaCountByDeviceId(@Param("deviceId") Long deviceId); |
| | | |
| | | /** |
| | | * 统计分页 |
| | | * |
| | | * @param page |
| | |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectAreaCountByDeviceId" resultType="java.lang.Integer"> |
| | | select count(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(#{deviceId}, replace(ad.device_ids, ' ', '')) |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectFwAreaDivideDetail" resultMap="fwAreaDivideResultMap"> |
| | | select |
| | | ad.id, |
| | |
| | | Map<Long, String> selectSceneNameByDeviceIds(List<Long> deviceIds); |
| | | |
| | | /** |
| | | * 根据设备ID判断是否绑定区域 |
| | | * |
| | | * @param deviceId |
| | | * @return |
| | | */ |
| | | boolean existsAreaByDeviceId(Long deviceId); |
| | | |
| | | /** |
| | | * 统计分页 |
| | | * |
| | | * @param page |
| | |
| | | } |
| | | |
| | | @Override |
| | | public boolean existsAreaByDeviceId(Long deviceId) { |
| | | if (deviceId == null) { |
| | | return false; |
| | | } |
| | | Integer count = baseMapper.selectAreaCountByDeviceId(deviceId); |
| | | return count != null && count > 0; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<FwAreaDivideStatisticsVO> selectFwAreaDivideStatisticsPage(IPage<FwAreaDivideStatisticsVO> page, |
| | | FwAreaDivideStatisticsDTO fwAreaDivideStatistics) { |
| | | return page.setRecords(baseMapper.selectFwAreaDivideStatisticsPage(page, fwAreaDivideStatistics)); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 设备区域绑定校验 |
| | | */ |
| | | @GetMapping("/checkAreaBind") |
| | | @ApiOperationSupport(order = 9) |
| | | @ApiOperation(value = "设备区域绑定校验", notes = "传入deviceId") |
| | | public R<Boolean> checkAreaBind(@ApiParam(value = "设备ID", required = true) @RequestParam Long deviceId) { |
| | | FwDeviceEntity device = fwDeviceService.getById(deviceId); |
| | | if (device == null || (device.getIsDeleted() != null && device.getIsDeleted() != 0)) { |
| | | return R.fail("该设备不存在"); |
| | | } |
| | | return R.data(fwDeviceService.existsAreaBindByDeviceId(deviceId)); |
| | | } |
| | | |
| | | /** |
| | | * 导出数据 |
| | | */ |
| | | @GetMapping("/export-fwDevice") |
| | |
| | | * @return |
| | | */ |
| | | Map<Long, String> selectSceneNameByDeviceIds(List<Long> deviceIds); |
| | | |
| | | /** |
| | | * 判断设备是否绑定区域 |
| | | * |
| | | * @param deviceId |
| | | * @return |
| | | */ |
| | | boolean existsAreaBindByDeviceId(Long deviceId); |
| | | } |
| | |
| | | public Map<Long, String> selectSceneNameByDeviceIds(List<Long> deviceIds) { |
| | | return fwAreaDivideService.selectSceneNameByDeviceIds(deviceIds); |
| | | } |
| | | |
| | | @Override |
| | | public boolean existsAreaBindByDeviceId(Long deviceId) { |
| | | return fwAreaDivideService.existsAreaByDeviceId(deviceId); |
| | | } |
| | | } |