|
@@ -343,28 +343,25 @@ public class StatMeterReadRateByBuildingServiceImpl implements StatMeterReadRate
|
|
|
|
|
|
List<CustomerRateDto> customerRateDtoList = newArrayList();
|
|
|
List<WaterReadRateListDto> waterReadRateListDtoList = newArrayList();
|
|
|
+ String tableName = "";
|
|
|
|
|
|
if (period == 2) { // 昨天,查询天表
|
|
|
- //PageHelper.startPage(pageNum, pageSize);
|
|
|
- customerRateDtoList = statMeterReadRateByBuildingMapper.getRateListByCustomerV2("sc_stat_meter_read_rate_by_building",loginUser.getSiteId(), startDate, buildingIds,channelId,customerIds);
|
|
|
+ tableName = "sc_stat_meter_read_rate_by_building";
|
|
|
+ customerRateDtoList = statMeterReadRateByBuildingMapper.getRateListByCustomerV2(tableName,loginUser.getSiteId(), startDate, buildingIds,channelId,customerIds);
|
|
|
} else if (period == 7) { // 近7天,查询7天表
|
|
|
- //PageHelper.startPage(pageNum, pageSize);
|
|
|
- customerRateDtoList = statMeterReadRateByBuildingMapper.getRateListByCustomerV2("sc_stat_meter_read_rate_by_building_7day",loginUser.getSiteId(), startDate, buildingIds,channelId,customerIds);
|
|
|
+ tableName = "sc_stat_meter_read_rate_by_building_7day";
|
|
|
+ customerRateDtoList = statMeterReadRateByBuildingMapper.getRateListByCustomerV2(tableName,loginUser.getSiteId(), startDate, buildingIds,channelId,customerIds);
|
|
|
} else if (period == 15) {// 近15天,查询15天表
|
|
|
- //PageHelper.startPage(pageNum, pageSize);
|
|
|
- customerRateDtoList = statMeterReadRateByBuildingMapper.getRateListByCustomerV2("sc_stat_meter_read_rate_by_building_15day",loginUser.getSiteId(), startDate, buildingIds,channelId,customerIds);
|
|
|
+ tableName = "sc_stat_meter_read_rate_by_building_15day";
|
|
|
+ customerRateDtoList = statMeterReadRateByBuildingMapper.getRateListByCustomerV2(tableName,loginUser.getSiteId(), startDate, buildingIds,channelId,customerIds);
|
|
|
}else if (period == 99) {// 上个月,查询15天表
|
|
|
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyyMM");
|
|
|
startDate = Integer.parseInt(LocalDateTime.now().plusMonths(-1).format(df));
|
|
|
- //PageHelper.startPage(pageNum, pageSize);
|
|
|
- customerRateDtoList = statMeterReadRateByBuildingMapper.getRateListByCustomerV2("sc_stat_meter_read_rate_by_building_month",loginUser.getSiteId(), startDate, buildingIds,channelId,customerIds);
|
|
|
+ tableName = "sc_stat_meter_read_rate_by_building_month";
|
|
|
+ customerRateDtoList = statMeterReadRateByBuildingMapper.getRateListByCustomerV2(tableName,loginUser.getSiteId(), startDate, buildingIds,channelId,customerIds);
|
|
|
}
|
|
|
- /*if (customerRateDtoList != null && customerRateDtoList.size()>0) {
|
|
|
- for (CustomerRateDto customerRateDto : customerRateDtoList) {
|
|
|
- customerRateDto.setList(statMeterReadRateByBuildingMapper.getRateListByCustomerV2AndDeviceType("sc_stat_meter_read_rate_by_building_month",loginUser.getSiteId(), startDate, buildingIds,channelId,customerRateDto.getCustomerId()));
|
|
|
- }
|
|
|
- }*/
|
|
|
- List<WaterReadRateListDto> dataList = statMeterReadRateByBuildingMapper.getRateListByCustomerV2AndDeviceType("sc_stat_meter_read_rate_by_building_month",loginUser.getSiteId(), startDate, buildingIds,channelId,null);
|
|
|
+
|
|
|
+ List<WaterReadRateListDto> dataList = statMeterReadRateByBuildingMapper.getRateListByCustomerV2AndDeviceType(tableName,loginUser.getSiteId(), startDate, buildingIds,channelId,null);
|
|
|
if (dataList != null && dataList.size() > 0) {
|
|
|
for (WaterReadRateListDto waterReadRateListDto : dataList) {
|
|
|
if (customerRateDtoList != null && customerRateDtoList.size() > 0) {
|
|
@@ -434,25 +431,29 @@ public class StatMeterReadRateByBuildingServiceImpl implements StatMeterReadRate
|
|
|
List<Integer> buildingIds = buildingService.getIdsByDataPermission();
|
|
|
|
|
|
List<Integer> customerIds = newArrayList();
|
|
|
- if (channelId != null) {
|
|
|
+ if (customerId != null) {
|
|
|
customerIds = customerService.findAllSubIds(customerId);
|
|
|
}
|
|
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
|
|
Integer startDate = Integer.valueOf(LocalDate.now().plusDays(-1).format(formatter));
|
|
|
//Integer startDate = 20200317;
|
|
|
-
|
|
|
+ String tableName = "";
|
|
|
|
|
|
if (period == 2) {
|
|
|
- return statMeterReadRateByBuildingMapper.getCountByCustomerV2("sc_stat_meter_read_rate_by_building",loginUser.getSiteId(), startDate, buildingIds, channelId, customerIds);
|
|
|
+ tableName = "sc_stat_meter_read_rate_by_building";
|
|
|
+ return statMeterReadRateByBuildingMapper.getCountByCustomerV2(tableName,loginUser.getSiteId(), startDate, buildingIds, channelId, customerIds);
|
|
|
} else if (period == 7) {
|
|
|
- return statMeterReadRateByBuildingMapper.getCountByCustomerV2("sc_stat_meter_read_rate_by_building_7day",loginUser.getSiteId(), startDate, buildingIds, channelId, customerIds);
|
|
|
+ tableName = "sc_stat_meter_read_rate_by_building_7day";
|
|
|
+ return statMeterReadRateByBuildingMapper.getCountByCustomerV2(tableName,loginUser.getSiteId(), startDate, buildingIds, channelId, customerIds);
|
|
|
} else if (period == 15) {
|
|
|
- return statMeterReadRateByBuildingMapper.getCountByCustomerV2("sc_stat_meter_read_rate_by_building_15day",loginUser.getSiteId(), startDate, buildingIds, channelId, customerIds);
|
|
|
+ tableName = "sc_stat_meter_read_rate_by_building_15day";
|
|
|
+ return statMeterReadRateByBuildingMapper.getCountByCustomerV2(tableName,loginUser.getSiteId(), startDate, buildingIds, channelId, customerIds);
|
|
|
} else if (period == 99) {
|
|
|
+ tableName = "sc_stat_meter_read_rate_by_building_month";
|
|
|
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyyMM");
|
|
|
startDate = Integer.parseInt(LocalDateTime.now().plusMonths(-1).format(df));
|
|
|
- return statMeterReadRateByBuildingMapper.getCountByCustomerV2("sc_stat_meter_read_rate_by_building_month",loginUser.getSiteId(), startDate, buildingIds, channelId, customerIds);
|
|
|
+ return statMeterReadRateByBuildingMapper.getCountByCustomerV2(tableName,loginUser.getSiteId(), startDate, buildingIds, channelId, customerIds);
|
|
|
}
|
|
|
return null;
|
|
|
}
|