| | |
| | | GunStatusStatisticsVO gunStatusStatisticsVO = new GunStatusStatisticsVO(); |
| | | |
| | | if(CollectionUtils.isEmpty(siteIds)){ |
| | | Map<Integer, Integer> modeStatisticsNull = new HashMap<>(); |
| | | modeStatisticsNull.put(1, 0); |
| | | modeStatisticsNull.put(2, 0); |
| | | modeStatisticsNull.put(3, 0); |
| | | List<Map<Integer, Integer>> modeStatisticsNull = new ArrayList<>(); |
| | | modeStatisticsNull.add(new HashMap<>(1,0)); |
| | | modeStatisticsNull.add(new HashMap<>(2,0)); |
| | | modeStatisticsNull.add(new HashMap<>(3,0)); |
| | | gunStatusStatisticsVO.setModeStatistics(modeStatisticsNull); |
| | | Map<Integer, Integer> statusStatisticsNull = new HashMap<>(); |
| | | statusStatisticsNull.put(1, 0); |
| | |
| | | gunStatusStatisticsVO.setStatusModeStatistics(statusModeStatistics); |
| | | } |
| | | |
| | | Map<Integer, Integer> modeStatistics = this.baseMapper.getModeStatistics(siteIds); |
| | | List<Map<Integer, Integer>> modeStatistics = this.baseMapper.getModeStatistics(siteIds); |
| | | gunStatusStatisticsVO.setModeStatistics(modeStatistics); |
| | | |
| | | Map<Integer, Integer> statusStatistics = new HashMap<>(); |
| | | List<Map<Integer, Integer>> statusStatistics = new ArrayList<>(); |
| | | // 离线 |
| | | Long count = this.baseMapper.selectCount(Wrappers.lambdaQuery(TChargingGun.class) |
| | | .eq(TChargingGun::getStatus, 1)); |
| | | statusStatistics.put(1, count.intValue()); |
| | | statusStatistics.add(new HashMap<>(1,count.intValue())); |
| | | // statusStatistics.put(1, count.intValue()); |
| | | // 故障 |
| | | count = this.baseMapper.selectCount(Wrappers.lambdaQuery(TChargingGun.class) |
| | | .eq(TChargingGun::getStatus, 7)); |
| | | statusStatistics.put(2, count.intValue()); |
| | | statusStatistics.add(new HashMap<>(2,count.intValue())); |
| | | |
| | | // statusStatistics.put(2, count.intValue()); |
| | | // 充电中 |
| | | count = this.baseMapper.selectCount(Wrappers.lambdaQuery(TChargingGun.class) |
| | | .in(TChargingGun::getStatus, Arrays.asList(3,4,5,6))); |
| | | statusStatistics.put(3, count.intValue()); |
| | | statusStatistics.add(new HashMap<>(3,count.intValue())); |
| | | |
| | | // statusStatistics.put(3, count.intValue()); |
| | | gunStatusStatisticsVO.setModeStatistics(statusStatistics); |
| | | |
| | | List<StatusModeStatisticsVO> statusModeStatisticsVOS = new ArrayList<>(); |