Browse Source

报表统计优化

ch 2 weeks ago
parent
commit
1a8d526db8
16 changed files with 419 additions and 258 deletions
  1. 2 2
      xrtyCallCenter/src/main/java/com/tofly/callcenter/controller/StatisController.java
  2. 1 1
      xrtyCallCenter/src/main/java/com/tofly/callcenter/mapper/PltCalllist1000Mapper.java
  3. 3 2
      xrtyCallCenter/src/main/java/com/tofly/callcenter/service/PltCalllist1000Service.java
  4. 4 3
      xrtyCallCenter/src/main/java/com/tofly/callcenter/service/impl/PltCalllist1000ServiceImpl.java
  5. 2 6
      xrtyCallCenter/src/main/resources/mapper/PltCalllist1000Mapper.xml
  6. 18 22
      xrtyGis/src/main/java/com/tofly/xrtygis/custom/controller/CostOfWaterReportController.java
  7. 11 3
      xrtyGis/src/main/java/com/tofly/xrtygis/custom/mapper/CostOfWaterReportMapper.java
  8. 36 12
      xrtyGis/src/main/java/com/tofly/xrtygis/custom/service/CostOfWaterReportService.java
  9. 225 149
      xrtyGis/src/main/java/com/tofly/xrtygis/custom/service/impl/CostOfWaterReportServiceImpl.java
  10. 80 43
      xrtyGis/src/main/resources/custom/CostOfWaterReportMapper.xml
  11. 2 2
      xrtyMeter/src/main/java/com/tofly/watermeter/controller/MeterReadingAccuracyController.java
  12. 4 2
      xrtyMeter/src/main/java/com/tofly/watermeter/mapper/MeterReadingAccuracyMapper.java
  13. 1 1
      xrtyMeter/src/main/java/com/tofly/watermeter/service/MeterReadingAccuracyService.java
  14. 3 4
      xrtyMeter/src/main/java/com/tofly/watermeter/service/impl/MeterReadingAccuracyServiceImpl.java
  15. 12 0
      xrtyMeter/src/main/java/com/tofly/watermeter/service/impl/QfcbplandetailsServiceImpl.java
  16. 15 6
      xrtyMeter/src/main/resources/mapper/MeterReadingAccuracyMapper.xml

+ 2 - 2
xrtyCallCenter/src/main/java/com/tofly/callcenter/controller/StatisController.java

@@ -68,8 +68,8 @@ public class StatisController {
 
     @GetMapping("/inTimeCount")
     @ApiOperation("热线呼叫接通及时率统计")
-    public ResultRespone<List<Map<String, Object>>> inTimeCount(String year){
-        return ResultRespone.success(pltCalllist1000Service.inTimeCount(year));
+    public ResultRespone<List<Map<String, Object>>> inTimeCount(String startMonth, String endMonth){
+        return ResultRespone.success(pltCalllist1000Service.inTimeCount(startMonth,endMonth));
     }
 
     @GetMapping("/getUserScoreInfo")

+ 1 - 1
xrtyCallCenter/src/main/java/com/tofly/callcenter/mapper/PltCalllist1000Mapper.java

@@ -48,7 +48,7 @@ public interface PltCalllist1000Mapper extends BaseMapper<PltCalllist1000> {
 
     List<Satisfaction> getSatisfactionStatisList(@Param("start") Date start,@Param("end") Date end);
 
-    List<Map<String,Object>> inTimeCount(@Param("year") String year);
+    List<Map<String,Object>> inTimeCount(@Param("start") String start, @Param("end") String end);
 
     IPage<Map> getSatisfactionStatisInfo(Page page, @Param("search") CallSearch search);
 

+ 3 - 2
xrtyCallCenter/src/main/java/com/tofly/callcenter/service/PltCalllist1000Service.java

@@ -48,10 +48,11 @@ public interface PltCalllist1000Service extends IService<PltCalllist1000> {
 
     /**
      * 及时率统计
-     * @param year 年份
+     * @param startMonth 月份
+     * @param endMonth 月份
      * @return list
      */
-    List<Map<String,Object>> inTimeCount(String year);
+    List<Map<String,Object>> inTimeCount(String startMonth, String endMonth);
 
     IPage<Map> getStateStatis(HttpServletResponse response,Page page, CallSearch search);
 

+ 4 - 3
xrtyCallCenter/src/main/java/com/tofly/callcenter/service/impl/PltCalllist1000ServiceImpl.java

@@ -252,12 +252,13 @@ public class PltCalllist1000ServiceImpl extends ServiceImpl<PltCalllist1000Mappe
     /**
      * 及时率统计
      *
-     * @param year 年份
+     * @param startMonth 月份
+     * @param endMonth 月份
      * @return list
      */
     @Override
-    public List<Map<String, Object>> inTimeCount(String year) {
-        return baseMapper.inTimeCount(year);
+    public List<Map<String, Object>> inTimeCount(String startMonth, String endMonth) {
+        return baseMapper.inTimeCount(startMonth,endMonth);
     }
 
     @Override

+ 2 - 6
xrtyCallCenter/src/main/resources/mapper/PltCalllist1000Mapper.xml

@@ -223,21 +223,17 @@
         notInTime,
         inTime,
         callNumber,
-        month,
         round(inTime / callNumber * 100, 2) inTimeRate
         from (select sum(TIMESTAMPDIFF(SECOND, b.CALL_TIME, b.CONNECT_TIME)) second,
         sum(TIMESTAMPDIFF(SECOND, b.CALL_TIME, b.CONNECT_TIME) > 15) notInTime,
         sum(TIMESTAMPDIFF(SECOND, b.CALL_TIME, b.CONNECT_TIME) &lt;= 15) inTime,
-        count(*) callNumber,
-        date_format(b.CALL_TIME, '%Y-%m')                       month
+        count(*) callNumber
         from PLT_CALLLIST1000 a
         left join PLT_SERVICE_LIST1000 b
         on a.CONNECTIONID = b.CONNECTIONID
         WHERE a.CALL_RESULT = '1'
         AND b.TRANSFER_RESULT = '1'
-        and date_format(b.CALL_TIME, '%Y') = #{year}
-        group by date_format(b.CALL_TIME, '%Y-%m')
-        order by month) callCount
+        and date_format(b.CALL_TIME, '%Y%m%d') between #{start} and #{end}) callCount
     </select>
 
     <select id="getUserScoreInfo" resultType="java.util.Map">

+ 18 - 22
xrtyGis/src/main/java/com/tofly/xrtygis/custom/controller/CostOfWaterReportController.java

@@ -47,8 +47,8 @@ public class CostOfWaterReportController {
 
     @GetMapping("/productionAndSalesCount")
     @ApiOperation("产销差统计")
-    public ResultRespone<Map<String, ProductionAndSalesVo>> productionAndSalesCount(String year) {
-        return ResultRespone.success(costOfWaterReportService.productionAndSalesCount(year));
+    public ResultRespone<Map<String, ProductionAndSalesVo>> productionAndSalesCount(String startMonth, String endMonth) {
+        return ResultRespone.success(costOfWaterReportService.productionAndSalesCount(startMonth,endMonth));
     }
 
     @PostMapping("/administrativeAreaSave")
@@ -66,10 +66,8 @@ public class CostOfWaterReportController {
 
     @GetMapping("/administrativeAreaQuery")
     @ApiOperation("行政区域划分数据查询")
-    public ResultRespone<List<AdministrativeArea>> administrativeAreaQuery(String yearMonth){
-        List<AdministrativeArea> adminList = administrativeAreaService.list(Wrappers.<AdministrativeArea>lambdaQuery()
-                .eq(AdministrativeArea::getMonthPlan, yearMonth).orderByAsc(AdministrativeArea::getStreet));
-        return ResultRespone.success(adminList);
+    public ResultRespone<List<AdministrativeArea>> administrativeAreaQuery(String startMonth, String endMonth){
+        return ResultRespone.success(costOfWaterReportService.administrativeAreaCount(startMonth, endMonth));
     }
 
     @ApiOperation("行政类型数据填报")
@@ -86,10 +84,8 @@ public class CostOfWaterReportController {
 
     @ApiOperation("行政类型数据查询")
     @GetMapping("/administrativeTypeQuery")
-    public ResultRespone<List<AdminstrativeType>> administrativeTypeQuery(String yearMonth){
-        List<AdminstrativeType> adminList = adminstrativeTypeService.list(Wrappers.<AdminstrativeType>lambdaQuery()
-                .eq(AdminstrativeType::getMonthPlan, yearMonth).orderByAsc(AdminstrativeType::getTypeName));
-        return ResultRespone.success(adminList);
+    public ResultRespone<List<AdminstrativeType>> administrativeTypeQuery(String startMonth, String endMonth){
+        return ResultRespone.success(costOfWaterReportService.administrativeTypeCount(startMonth, endMonth));
     }
 
     @PostMapping("/countPlanValueSave")
@@ -110,11 +106,12 @@ public class CostOfWaterReportController {
     @GetMapping("/marketingStatistics")
     @ApiOperation("营销统计")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "yearMonth", value = "年月yyyy-MM", required = true, dataType = "String"),
+            @ApiImplicitParam(name = "startMonth", value = "年月", required = true, dataType = "String"),
+            @ApiImplicitParam(name = "endMonth", value = "年月", required = true, dataType = "String"),
             @ApiImplicitParam(name = "type", value = "1 用水性质分售水量完成情况 2 售水均价 3 水费回收", required = true, dataType = "Integer")
     })
-    public ResultRespone<Map<String, MarketingStatisticsVo>> marketingStatistics(String yearMonth, Integer type){
-        return ResultRespone.success(costOfWaterReportService.marketingStatistics(yearMonth, type));
+    public ResultRespone<Map<String, MarketingStatisticsVo>> marketingStatistics(String startMonth, String endMonth, Integer type){
+        return ResultRespone.success(costOfWaterReportService.marketingStatistics(startMonth,endMonth, type));
     }
 
     @PostMapping("/satisfactionSave")
@@ -138,27 +135,26 @@ public class CostOfWaterReportController {
 
     @GetMapping("/satisfactionStatistics")
     @ApiOperation("满意度统计")
-    @ApiImplicitParam(name = "yearMonth", value = "年月yyyy-MM", required = true, dataType = "String")
-    public ResultRespone<Map<String, List<Satisfaction>>> satisfactionStatistics(String yearMonth){
-        return ResultRespone.success(costOfWaterReportService.satisfactionStatistics(yearMonth));
+    public ResultRespone<Map<String, List<Satisfaction>>> satisfactionStatistics(String startMonth, String endMonth){
+        return ResultRespone.success(costOfWaterReportService.satisfactionStatistics(startMonth, endMonth));
     }
 
     @GetMapping("/businessTicketsCount")
     @ApiOperation(value = "业务工单统计")
-    public ResultRespone<List<BusinessTicketsCount>> businessTicketsCount(String yearMonth){
-        return ResultRespone.success(costOfWaterReportService.businessTicketsCount(yearMonth));
+    public ResultRespone<List<BusinessTicketsCount>> businessTicketsCount(String startMonth, String endMonth){
+        return ResultRespone.success(costOfWaterReportService.businessTicketsCount(startMonth, endMonth));
     }
 
     @GetMapping("/unitCost")
     @ApiOperation("单位成本")
-    public ResultRespone<List<UnitCost>> unitCost(String yearMonth){
-        return ResultRespone.success(costOfWaterReportService.unitCost(yearMonth));
+    public ResultRespone<List<UnitCost>> unitCost(String startMonth,String endMonth){
+        return ResultRespone.success(costOfWaterReportService.unitCost(startMonth,endMonth));
     }
 
     @GetMapping("/unitConsumption")
     @ApiOperation("单耗")
-    public ResultRespone<List<UnitCost>> unitConsumption(String yearMonth){
-        return ResultRespone.success(costOfWaterReportService.unitConsumption(yearMonth));
+    public ResultRespone<List<UnitCost>> unitConsumption(String startMonth,String endMonth){
+        return ResultRespone.success(costOfWaterReportService.unitConsumption(startMonth,endMonth));
     }
 
     @GetMapping("/pipeNetworksCount")

+ 11 - 3
xrtyGis/src/main/java/com/tofly/xrtygis/custom/mapper/CostOfWaterReportMapper.java

@@ -1,6 +1,8 @@
 package com.tofly.xrtygis.custom.mapper;
 
 import com.tofly.xrtygis.custom.entity.dto.*;
+import com.tofly.xrtygis.entity.AdministrativeArea;
+import com.tofly.xrtygis.entity.AdminstrativeType;
 import com.tofly.xrtygis.entity.CountPlanValue;
 import com.tofly.xrtygis.entity.Satisfaction;
 import org.apache.ibatis.annotations.Mapper;
@@ -46,13 +48,13 @@ public interface CostOfWaterReportMapper {
 
     BigDecimal ticketsInTimeCompute(@Param("start") Date start,@Param("end") Date end);
 
-    List<WaterCostCalDto> waterCostCalData(@Param("yearMonth") List<String> yearMonth);
+    List<WaterCostCalDto> waterCostCalData(@Param("startMonth") String startMonth, @Param("endMonth") String endMonth);
 
-    List<WaterUnitCalDto> waterUnitCalData(@Param("yearMonth") List<String> yearMonth);
+    List<WaterUnitCalDto> waterUnitCalData(@Param("startMonth") String startMonth, @Param("endMonth") String endMonth);
 
     Integer tableIsExist(@Param("tableName") String tableName);
 
-    List<ScadaAvg> getScadaAvgValue(@Param("tableName") String tableName);
+    List<ScadaAvg> getScadaAvgValue(@Param("start")Date start,@Param("end") Date end);
 
     List<ConstructionDamage> constructionDamageCount(@Param("start") Date start, @Param("end") Date end);
 
@@ -67,4 +69,10 @@ public interface CostOfWaterReportMapper {
     List<SelfExaminationOfLeaks> statisticsOfInspectionPoints(@Param("start") Date start, @Param("end") Date end);
 
     List<SelfExaminationOfLeaks> maintenanceSchedules(@Param("start") Date start, @Param("end") Date end);
+
+    List<AdminstrativeType> administrativeTypeCount(@Param("startMonth") String startMonth, @Param("endMonth") String endMonth);
+
+    List<AdministrativeArea> administrativeAreaCount(@Param("startMonth") String startMonth, @Param("endMonth") String endMonth);
+
+    List<Satisfaction> satisfactionStatistics(@Param("startMonth") String startMonth, @Param("endMonth") String endMonth);
 }

+ 36 - 12
xrtyGis/src/main/java/com/tofly/xrtygis/custom/service/CostOfWaterReportService.java

@@ -4,6 +4,8 @@ import com.tofly.xrtygis.custom.entity.dto.BusinessTicketsCount;
 import com.tofly.xrtygis.custom.entity.dto.PipeNetworks;
 import com.tofly.xrtygis.custom.entity.dto.UnitCost;
 import com.tofly.xrtygis.custom.entity.vo.ProductionAndSalesVo;
+import com.tofly.xrtygis.entity.AdministrativeArea;
+import com.tofly.xrtygis.entity.AdminstrativeType;
 import com.tofly.xrtygis.entity.Satisfaction;
 import com.tofly.xrtygis.entity.vo.MarketingStatisticsVo;
 
@@ -17,46 +19,52 @@ public interface CostOfWaterReportService {
 
     /**
      * 产销差统计
-     * @param year 年份 默认当前年份
+     * @param startMonth 月份
+     * @param endMonth 月份
      * @return map
      */
-    Map<String, ProductionAndSalesVo> productionAndSalesCount(String year);
+    Map<String, ProductionAndSalesVo> productionAndSalesCount(String startMonth, String endMonth);
 
     /**
      * 营销数据统计
      * @param type 类型 1:用水性质分售水量完成情况 2:(四)售水均价 3 水费回收
-     * @param yearMonth 年月
+     * @param startMonth 月份
+     * @param endMonth 月份
      * @return map
      */
-    Map<String, MarketingStatisticsVo> marketingStatistics(String yearMonth, Integer type);
+    Map<String, MarketingStatisticsVo> marketingStatistics(String startMonth,String endMonth, Integer type);
 
     /**
      * 满意度统计
-     * @param yearMonth 年月 yyyy-MM
+     * @param startMonth 月份
+     * @param endMonth 月份
      * @return map
      */
-    Map<String, List<Satisfaction>> satisfactionStatistics(String yearMonth);
+    Map<String, List<Satisfaction>> satisfactionStatistics(String startMonth, String endMonth);
 
     /**
      * 业务工单统计
-     * @param yearMonth 年月 yyyy-MM
+     * @param startMonth 月份
+     * @param endMonth 月份
      * @return map
      */
-    List<BusinessTicketsCount> businessTicketsCount(String yearMonth);
+    List<BusinessTicketsCount> businessTicketsCount(String startMonth, String endMonth);
 
     /**
      * 单位成本
-     * @param yearMonth 年月 yyyy-MM
+     * @param startMonth 年月 yyyy-MM
+     * @param endMonth 年月 yyyy-MM
      * @return map
      */
-    List<UnitCost> unitCost(String yearMonth);
+    List<UnitCost> unitCost(String startMonth, String endMonth);
 
     /**
      * 单耗
-     * @param yearMonth yearMonth
+     * @param startMonth 月份
+     * @param endMonth 月份
      * @return map
      */
-    List<UnitCost> unitConsumption(String yearMonth);
+    List<UnitCost> unitConsumption(String startMonth, String endMonth);
 
     /**
      * 管网统计
@@ -65,4 +73,20 @@ public interface CostOfWaterReportService {
      */
     List<PipeNetworks> pipeNetworksCount(String yearMonth);
 
+    /**
+     * 售水量-按行政类型统计
+     * @param startMonth 开始月份
+     * @param endMonth 结束月份
+     * @return list
+     */
+    List<AdminstrativeType> administrativeTypeCount(String startMonth,String endMonth);
+
+    /**
+     * 售水量-按行政区域划分统计
+     * @param startMonth
+     * @param endMonth
+     * @return
+     */
+    List<AdministrativeArea> administrativeAreaCount(String startMonth, String endMonth);
+
 }

+ 225 - 149
xrtyGis/src/main/java/com/tofly/xrtygis/custom/service/impl/CostOfWaterReportServiceImpl.java

@@ -4,7 +4,6 @@ import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateUtil;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.tofly.common.core.util.StringUtil;
 import com.tofly.xrtygis.config.CallCenterFeign;
 import com.tofly.xrtygis.custom.entity.dto.*;
 import com.tofly.xrtygis.custom.entity.vo.ProductionAndSalesVo;
@@ -13,6 +12,8 @@ import com.tofly.xrtygis.custom.service.CostOfWaterReportService;
 import com.tofly.xrtygis.em.WaterBills;
 import com.tofly.xrtygis.em.WaterSold;
 import com.tofly.xrtygis.em.WaterSoldPrice;
+import com.tofly.xrtygis.entity.AdministrativeArea;
+import com.tofly.xrtygis.entity.AdminstrativeType;
 import com.tofly.xrtygis.entity.CountPlanValue;
 import com.tofly.xrtygis.entity.Satisfaction;
 import com.tofly.xrtygis.entity.vo.MarketingStatisticsVo;
@@ -52,59 +53,68 @@ public class CostOfWaterReportServiceImpl implements CostOfWaterReportService {
     /**
      * 产销差统计
      *
-     * @param year 年份 默认当前年份
+     * @param startMonth 月份
+     * @param endMonth 月份
      * @return map
      */
     @Override
-    public Map<String, ProductionAndSalesVo> productionAndSalesCount(String year) {
+    public Map<String, ProductionAndSalesVo> productionAndSalesCount(String startMonth, String endMonth) {
         Map<String, ProductionAndSalesVo> returnMap = new HashMap<>(3);
-        Date now = new Date();
-        if (StringUtil.isEmpty(year)) {
-            year = String.valueOf(DateUtil.year(now));
-        }
-        String nowMonth = year + "-" + DateUtil.format(now, "MM");
-        List<ProductionAndSalesDto> budgetProductionAndSalesData = costOfWaterReportMapper.getBudgetProductionAndSalesData(year);
+        //年度预算表
+        List<ProductionAndSalesDto> budgetProductionAndSalesData = costOfWaterReportMapper.getBudgetProductionAndSalesData(startMonth.substring(0, 4));
         BigDecimal budgetWaterSupplySum = null;
         BigDecimal budgetSellWaterSum = null;
-        ProductionAndSalesDto budget = null;
+        List<ProductionAndSalesDto> budget = new ArrayList<>();
         if (CollectionUtil.isNotEmpty(budgetProductionAndSalesData)) {
             //预算累计值
             budgetWaterSupplySum = BigDecimal.valueOf(budgetProductionAndSalesData.stream().mapToDouble(ProductionAndSalesDto::getWaterSupply).sum());
             budgetSellWaterSum = BigDecimal.valueOf(budgetProductionAndSalesData.stream().mapToDouble(ProductionAndSalesDto::getSellWater).sum());
-            budget = budgetProductionAndSalesData.stream().filter(i -> i.getMonth().equals(nowMonth)).collect(Collectors.toList()).get(0);
+            budget = budgetProductionAndSalesData.stream().filter(i -> i.getMonth().compareTo(startMonth) >= 0 && i.getMonth().compareTo(endMonth) <= 0).collect(Collectors.toList());
         }
 
-        List<ProductionAndSalesDto> actualProductionAndSalesData = costOfWaterReportMapper.getActualProductionAndSalesData(year);
+        List<ProductionAndSalesDto> actualProductionAndSalesData = costOfWaterReportMapper.getActualProductionAndSalesData(startMonth.substring(0, 4));
 
         BigDecimal actualWaterSupplySum = null;
         BigDecimal actualSellWaterSum = null;
-        ProductionAndSalesDto actual = null;
+        List<ProductionAndSalesDto> actual = new ArrayList<>();
         if (CollectionUtil.isNotEmpty(actualProductionAndSalesData)) {
             actualWaterSupplySum = BigDecimal.valueOf(budgetProductionAndSalesData.stream().mapToDouble(ProductionAndSalesDto::getWaterSupply).sum());
             actualSellWaterSum = BigDecimal.valueOf(budgetProductionAndSalesData.stream().mapToDouble(ProductionAndSalesDto::getSellWater).sum());
-            actual = budgetProductionAndSalesData.stream().filter(i -> i.getMonth().equals(nowMonth)).collect(Collectors.toList()).get(0);
+            actual = budgetProductionAndSalesData.stream().filter(i -> i.getMonth().compareTo(startMonth) >= 0 && i.getMonth().compareTo(endMonth) <= 0).collect(Collectors.toList());
         }
-        returnMap.put("waterSupply", ProductionAndSalesVo.builder()
-                .budgetSum(budgetWaterSupplySum).budgetMonth(Objects.nonNull(budget) ? BigDecimal.valueOf(budget.getWaterSupply()) : null)
-                .actualSum(actualWaterSupplySum).actualMonth(Objects.nonNull(actual) ? BigDecimal.valueOf(actual.getWaterSupply()) : null)
+
+        BigDecimal supplyBudgetMonth = CollectionUtil.isNotEmpty(budget) ? BigDecimal.valueOf(budget.stream().mapToDouble(ProductionAndSalesDto::getWaterSupply).sum()) : null;
+        BigDecimal supplyActualMonth = CollectionUtil.isNotEmpty(actual) ? BigDecimal.valueOf(actual.stream().mapToDouble(ProductionAndSalesDto::getWaterSupply).sum()) : null;
+
+        ProductionAndSalesVo waterSupply = ProductionAndSalesVo.builder()
+                .budgetSum(budgetWaterSupplySum).budgetMonth(supplyBudgetMonth)
+                .actualSum(actualWaterSupplySum)
+                .actualMonth(supplyActualMonth)
                 .differ(Objects.nonNull(budgetWaterSupplySum) && Objects.nonNull(actualWaterSupplySum) ?
                         actualWaterSupplySum.subtract(budgetWaterSupplySum).divide(budgetWaterSupplySum, 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : null)
-                .build());
-
-        returnMap.put("sellWater", ProductionAndSalesVo.builder()
-                .budgetSum(budgetSellWaterSum).budgetMonth(Objects.nonNull(budget) ? BigDecimal.valueOf(budget.getSellWater()) : null)
-                .actualSum(actualSellWaterSum).actualMonth(Objects.nonNull(actual) ? BigDecimal.valueOf(actual.getSellWater()) : null)
+                .build();
+        returnMap.put("waterSupply", waterSupply);
+
+        BigDecimal sellBudgetMonth = CollectionUtil.isNotEmpty(budget) ? BigDecimal.valueOf(budget.stream().mapToDouble(ProductionAndSalesDto::getSellWater).sum()) : null;
+        BigDecimal sellActualMonth = CollectionUtil.isNotEmpty(actual) ? BigDecimal.valueOf(actual.stream().mapToDouble(ProductionAndSalesDto::getSellWater).sum()) : null;
+        ProductionAndSalesVo sellWater = ProductionAndSalesVo.builder()
+                .budgetSum(budgetSellWaterSum).budgetMonth(sellBudgetMonth)
+                .actualSum(actualSellWaterSum).actualMonth(sellActualMonth)
                 .differ(Objects.nonNull(budgetSellWaterSum) && Objects.nonNull(actualSellWaterSum) ?
                         actualSellWaterSum.subtract(budgetSellWaterSum).divide(budgetSellWaterSum, 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : null)
-                .build());
+                .build();
+
+        returnMap.put("sellWater", sellWater);
 
         BigDecimal budgetSum = Objects.nonNull(budgetWaterSupplySum) ? budgetWaterSupplySum.subtract(budgetSellWaterSum).divide(budgetWaterSupplySum, 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : null;
         BigDecimal actualSum = Objects.nonNull(actualWaterSupplySum) ? actualWaterSupplySum.subtract(actualSellWaterSum).divide(actualWaterSupplySum, 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : null;
+        BigDecimal budgetMonth = Objects.nonNull(supplyBudgetMonth) && Objects.nonNull(sellBudgetMonth) ? supplyBudgetMonth.subtract(sellBudgetMonth).divide(supplyBudgetMonth, 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : null;
+        BigDecimal actualMonth = Objects.nonNull(supplyActualMonth) && Objects.nonNull(sellActualMonth) ? supplyActualMonth.subtract(sellActualMonth).divide(supplyActualMonth, 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : null;
         returnMap.put("productionAndSales", ProductionAndSalesVo.builder()
                 .budgetSum(budgetSum)
-                .budgetMonth(Objects.nonNull(budget) ? BigDecimal.valueOf(budget.getProduction()) : null)
+                .budgetMonth(budgetMonth)
                 .actualSum(actualSum)
-                .actualMonth(Objects.nonNull(actual) ? BigDecimal.valueOf(actual.getProduction()) : null)
+                .actualMonth(actualMonth)
                 .differ(Objects.nonNull(budgetSum) && Objects.nonNull(actualSum) ? actualSum.subtract(budgetSum).divide(budgetSum, 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : null)
                 .build());
 
@@ -115,15 +125,16 @@ public class CostOfWaterReportServiceImpl implements CostOfWaterReportService {
      * 按用水性质分售水量完成情况
      *
      * @param type      类型 1:用水性质分售水量完成情况 2:(四)售水均价 3 水费回收
-     * @param yearMonth 年月
+     * @param startMonth 开始年月
+     * @param endMonth 结束年月
      * @return map
      */
     @Override
-    public Map<String, MarketingStatisticsVo> marketingStatistics(String yearMonth, Integer type) {
+    public Map<String, MarketingStatisticsVo> marketingStatistics(String startMonth,String endMonth, Integer type) {
         Map<String, MarketingStatisticsVo> result = new HashMap<>();
 
-        String nowYear = yearMonth.substring(0, 4);
-        String lastYear = DateUtil.format(DateUtil.offsetMonth(DateUtil.parse(yearMonth, "yyyy-MM"), -12), "yyyy");
+        String nowYear = startMonth.substring(0, 4);
+        String lastYear = DateUtil.format(DateUtil.offsetMonth(DateUtil.parse(startMonth, "yyyyMM"), -12), "yyyy");
 
         //当年与去年填报值
         List<CountPlanValue> nowValueList = countPlanValueService.list(Wrappers.<CountPlanValue>lambdaQuery().eq(CountPlanValue::getOneType, type).like(CountPlanValue::getYearMonth, nowYear));
@@ -133,32 +144,47 @@ public class CostOfWaterReportServiceImpl implements CostOfWaterReportService {
             List<CountPlanValue> nowDataList = costOfWaterReportMapper.getWaterCostSoldWaterData(nowYear);
             List<CountPlanValue> lastDataList = costOfWaterReportMapper.getWaterCostSoldWaterData(lastYear);
             //售水量
-            result.put("waterSold", dateCompute(nowDataList, lastDataList, yearMonth, null, true));
+            result.put("waterSold", dateCompute(nowDataList, lastDataList, startMonth,endMonth, null, true));
             for (WaterSold value : WaterSold.values()) {
-                result.put(value.getKey(), dateCompute(nowValueList, lastValueList, yearMonth, value.getType(), true));
+                result.put(value.getKey(), dateCompute(nowValueList, lastValueList, startMonth,endMonth, value.getType(), true));
             }
         } else if (2 == type) {
 
             for (WaterSoldPrice value : WaterSoldPrice.values()) {
-                result.put(value.getKey(), dateCompute(nowValueList, lastValueList, yearMonth, value.getType(), false));
+                result.put(value.getKey(), dateCompute(nowValueList, lastValueList, startMonth,endMonth, value.getType(), false));
             }
 
         } else if (3 == type) {
 
             for (WaterBills value : WaterBills.values()) {
-                result.put(value.getKey(), dateCompute(nowValueList, lastValueList, yearMonth, value.getType(), true));
+                result.put(value.getKey(), dateCompute(nowValueList, lastValueList, startMonth,endMonth, value.getType(), true));
             }
             MarketingStatisticsVo planCharges = result.get("planCharges");
             MarketingStatisticsVo actualCharges = result.get("actualCharges");
 
+            BigDecimal yearPlanNumber = actualCharges.getYearPlanNumber();
+            BigDecimal yearPlanNumber1 = planCharges.getYearPlanNumber();
+            BigDecimal actualNumber = actualCharges.getActualNumber();
+            BigDecimal actualNumber1 = planCharges.getActualNumber();
+            BigDecimal sumActualNumber = actualCharges.getSumActualNumber();
+            BigDecimal sumActualNumber1 = planCharges.getSumActualNumber();
+            BigDecimal sumPlanNumber = actualCharges.getSumPlanNumber();
+            BigDecimal sumPlanNumber1 = planCharges.getSumPlanNumber();
+            BigDecimal difference = actualCharges.getDifference();
+            BigDecimal difference1 = planCharges.getDifference();
+            BigDecimal lastYearSumActualNumber = actualCharges.getLastYearSumActualNumber();
+            BigDecimal lastYearSumActualNumber1 = planCharges.getLastYearSumActualNumber();
+            BigDecimal lastYearDifference = actualCharges.getLastYearDifference();
+            BigDecimal lastYearDifference1 = planCharges.getLastYearDifference();
+
             result.put("recoveryRate", MarketingStatisticsVo.builder()
-                    .yearPlanNumber(actualCharges.getYearPlanNumber() != null && planCharges.getYearPlanNumber() != null ? actualCharges.getYearPlanNumber().divide(planCharges.getYearPlanNumber(), 4, BigDecimal.ROUND_HALF_UP) : null)
-                    .actualNumber(actualCharges.getActualNumber() != null && planCharges.getActualNumber() != null ? actualCharges.getActualNumber().divide(planCharges.getActualNumber(), 4, BigDecimal.ROUND_HALF_UP) : null)
-                    .sumActualNumber(actualCharges.getSumActualNumber() != null && planCharges.getSumActualNumber() != null ? actualCharges.getSumActualNumber().divide(planCharges.getSumActualNumber(), 4, BigDecimal.ROUND_HALF_UP) : null)
-                    .sumPlanNumber(actualCharges.getSumPlanNumber() != null && planCharges.getSumPlanNumber() != null ? actualCharges.getSumPlanNumber().divide(planCharges.getSumPlanNumber(), 4, BigDecimal.ROUND_HALF_UP) : null)
-                    .difference(actualCharges.getDifference() != null && planCharges.getDifference() != null ? actualCharges.getDifference().divide(planCharges.getDifference(), 4, BigDecimal.ROUND_HALF_UP) : null)
-                    .lastYearSumActualNumber(actualCharges.getLastYearSumActualNumber() != null && planCharges.getLastYearSumActualNumber() != null ? actualCharges.getLastYearSumActualNumber().divide(planCharges.getLastYearSumActualNumber(), 4, BigDecimal.ROUND_HALF_UP) : null)
-                    .lastYearDifference(actualCharges.getLastYearDifference() != null && planCharges.getLastYearDifference() != null ? actualCharges.getLastYearDifference().divide(planCharges.getLastYearDifference(), 4, BigDecimal.ROUND_HALF_UP) : null)
+                    .yearPlanNumber(yearPlanNumber != null && yearPlanNumber1 != null && yearPlanNumber1.compareTo(BigDecimal.ZERO) != 0 ? yearPlanNumber.divide(yearPlanNumber1, 4, BigDecimal.ROUND_HALF_UP) : null)
+                    .actualNumber(actualNumber != null && actualNumber1 != null && actualNumber1.compareTo(BigDecimal.ZERO) != 0 ? actualNumber.divide(actualNumber1, 4, BigDecimal.ROUND_HALF_UP) : null)
+                    .sumActualNumber(sumActualNumber != null && sumActualNumber1 != null && sumActualNumber1.compareTo(BigDecimal.ZERO) != 0 ? sumActualNumber.divide(sumActualNumber1, 4, BigDecimal.ROUND_HALF_UP) : null)
+                    .sumPlanNumber(sumPlanNumber != null && sumPlanNumber1 != null && sumPlanNumber1.compareTo(BigDecimal.ZERO) != 0 ? sumPlanNumber.divide(sumPlanNumber1, 4, BigDecimal.ROUND_HALF_UP) : null)
+                    .difference(difference != null && difference1 != null && difference1.compareTo(BigDecimal.ZERO) != 0 ? difference.divide(difference1, 4, BigDecimal.ROUND_HALF_UP) : null)
+                    .lastYearSumActualNumber(lastYearSumActualNumber != null && lastYearSumActualNumber1 != null && lastYearSumActualNumber1.compareTo(BigDecimal.ZERO) != 0 ? lastYearSumActualNumber.divide(lastYearSumActualNumber1, 4, BigDecimal.ROUND_HALF_UP) : null)
+                    .lastYearDifference(lastYearDifference != null && lastYearDifference1 != null && lastYearDifference1.compareTo(BigDecimal.ZERO) != 0 ? lastYearDifference.divide(lastYearDifference1, 4, BigDecimal.ROUND_HALF_UP) : null)
                     .build());
         }
         return result;
@@ -167,20 +193,22 @@ public class CostOfWaterReportServiceImpl implements CostOfWaterReportService {
     /**
      * 满意度统计
      *
-     * @param yearMonth 年月 yyyy-MM
+     * @param startMonth 年月 yyyyMM
+     * @param endMonth 年月 yyyyMM
      * @return map
      */
     @Override
-    public Map<String, List<Satisfaction>> satisfactionStatistics(String yearMonth) {
+    public Map<String, List<Satisfaction>> satisfactionStatistics(String startMonth, String endMonth) {
         List<Satisfaction> sumList = new ArrayList<>();
-        DateTime monthDate = DateUtil.parse(yearMonth, "yyyy-MM");
-        DateTime start = DateUtil.beginOfMonth(monthDate);
-        DateTime end = DateUtil.endOfMonth(monthDate);
+        DateTime startData = DateUtil.parse(startMonth, "yyyyMM");
+        DateTime endData = DateUtil.parse(endMonth, "yyyyMM");
+        DateTime start = DateUtil.beginOfMonth(startData);
+        DateTime end = DateUtil.endOfMonth(endData);
         Map<String, List<Satisfaction>> result = new HashMap<>(3);
         List<Satisfaction> hotline = callCenterFeign.getSatisfactionStatis(DateUtil.format(start, "yyyy-MM-dd HH:mm:ss"), DateUtil.format(end, "yyyy-MM-dd HH:mm:ss")).getResult().stream().filter(Objects::nonNull).collect(Collectors.toList());
-        List<Satisfaction> frontDesk = satisfactionService.list(Wrappers.<Satisfaction>lambdaQuery().eq(Satisfaction::getMonthPlan, yearMonth)).stream().filter(Objects::nonNull).collect(Collectors.toList());
+        List<Satisfaction> frontDesk = costOfWaterReportMapper.satisfactionStatistics(startMonth,endMonth);
         List<Satisfaction> afterSales = costOfWaterReportMapper.returnVisitTickets(start, end).stream().filter(Objects::nonNull).collect(Collectors.toList());
-        result.put("frontDesk", frontDesk);
+        result.put("frontDesk", CollectionUtil.isNotEmpty(frontDesk) ? frontDesk : new ArrayList<>());
         result.put("hotline", CollectionUtil.isNotEmpty(hotline) ? hotline : new ArrayList<>());
         result.put("afterSales", CollectionUtil.isNotEmpty(afterSales) ? afterSales : new ArrayList<>());
 
@@ -194,11 +222,11 @@ public class CostOfWaterReportServiceImpl implements CostOfWaterReportService {
 
             Satisfaction sum = new Satisfaction();
 
-            BigDecimal verySatisfied = sumList.stream().map(Satisfaction::getVerySatisfied).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-            BigDecimal satisfied = sumList.stream().map(Satisfaction::getSatisfied).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-            BigDecimal general = sumList.stream().map(Satisfaction::getGeneral).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-            BigDecimal dissatisfied = sumList.stream().map(Satisfaction::getDissatisfied).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
-            BigDecimal total = sumList.stream().map(Satisfaction::getTotal).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+            BigDecimal verySatisfied = sumList.stream().filter(Objects::nonNull).map(Satisfaction::getVerySatisfied).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+            BigDecimal satisfied = sumList.stream().filter(Objects::nonNull).map(Satisfaction::getSatisfied).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+            BigDecimal general = sumList.stream().filter(Objects::nonNull).map(Satisfaction::getGeneral).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+            BigDecimal dissatisfied = sumList.stream().filter(Objects::nonNull).map(Satisfaction::getDissatisfied).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
+            BigDecimal total = sumList.stream().filter(Objects::nonNull).map(Satisfaction::getTotal).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
 
             BigDecimal scores = (total.compareTo(BigDecimal.ZERO) != 0 ? verySatisfied.add(satisfied.multiply(BigDecimal.valueOf(0.85))).add(general.multiply(BigDecimal.valueOf(0.7))).add(dissatisfied.multiply(BigDecimal.valueOf(0.5))).divide(total, 4, BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)) : BigDecimal.ZERO);
 
@@ -217,21 +245,23 @@ public class CostOfWaterReportServiceImpl implements CostOfWaterReportService {
     /**
      * 业务工单统计
      *
-     * @param yearMonth 年月 yyyy-MM
+     * @param startMonth 年月 yyyyMM
+     * @param endMonth 年月 yyyyMM
      * @return map
      */
     @Override
-    public List<BusinessTicketsCount> businessTicketsCount(String yearMonth) {
+    public List<BusinessTicketsCount> businessTicketsCount(String startMonth, String endMonth) {
         List<BusinessTicketsCount> result = new ArrayList<>(2);
-        DateTime monthTime = DateUtil.parse(yearMonth, "yyyy-MM");
-        DateTime beginMonth = DateUtil.beginOfMonth(monthTime);
-        DateTime endMonth = DateUtil.endOfMonth(monthTime);
+        DateTime startTime = DateUtil.parse(startMonth, "yyyy-MM");
+        DateTime endTIme = DateUtil.parse(endMonth, "yyyy-MM");
+        DateTime beginTime = DateUtil.beginOfMonth(startTime);
+        DateTime endTime = DateUtil.endOfMonth(endTIme);
 
         //话后处理时长
-        BigDecimal afterCallProcessingTime = callCenterFeign.afterCallProcessingTime(DateUtil.format(beginMonth, "yyyy-MM-dd HH:mm:ss"), DateUtil.format(endMonth, "yyyy-MM-dd HH:mm:ss"));
+        BigDecimal afterCallProcessingTime = callCenterFeign.afterCallProcessingTime(DateUtil.format(beginTime, "yyyy-MM-dd HH:mm:ss"), DateUtil.format(endTime, "yyyy-MM-dd HH:mm:ss"));
 
         //热线工单总数
-        BigDecimal hotlineTickets = costOfWaterReportMapper.hotlineTicketsCount(beginMonth, endMonth);
+        BigDecimal hotlineTickets = costOfWaterReportMapper.hotlineTicketsCount(beginTime, endTime);
 
         BigDecimal hotLineAvgTime = hotlineTickets.compareTo(BigDecimal.ZERO) != 0 && afterCallProcessingTime.compareTo(BigDecimal.ZERO) != 0 ? afterCallProcessingTime.divide(hotlineTickets, 2, BigDecimal.ROUND_HALF_UP) : BigDecimal.ZERO;
 
@@ -242,8 +272,8 @@ public class CostOfWaterReportServiceImpl implements CostOfWaterReportService {
                 .inTimeRate(minutes <= 1 ? "合格" : "不合格").build());
         result.add(BusinessTicketsCount.builder()
                 .name("售后服务")
-                .averageTime(costOfWaterReportMapper.afterTicketsCount(beginMonth, endMonth))
-                .inTimeRate(costOfWaterReportMapper.ticketsInTimeCompute(beginMonth, endMonth).toString()).build());
+                .averageTime(costOfWaterReportMapper.afterTicketsCount(beginTime, endTIme))
+                .inTimeRate(costOfWaterReportMapper.ticketsInTimeCompute(beginTime, endTime).toString()).build());
         return result;
     }
 
@@ -251,173 +281,185 @@ public class CostOfWaterReportServiceImpl implements CostOfWaterReportService {
     /**
      * 单位成本
      *
-     * @param yearMonth 年月 yyyy-MM
+     * @param startMonth 年月 yyyy-MM
+     * @param endMonth 年月 yyyy-MM
      * @return map
      */
     @Override
-    public List<UnitCost> unitCost(String yearMonth) {
+    public List<UnitCost> unitCost(String startMonth, String endMonth) {
+
+        DateTime nowStart = DateUtil.parse(startMonth, "yyyyMM");
+        DateTime nowEnd = DateUtil.parse(endMonth, "yyyyMM");
+//        String lastMonth = DateUtil.format(DateUtil.offsetMonth(parse, -1), "yyyy-MM");
+        String lastYearStart = DateUtil.format(DateUtil.offsetMonth(nowStart, -12), "yyyyMM");
+        String lastYearEnd = DateUtil.format(DateUtil.offsetMonth(nowEnd, -12), "yyyyMM");
+
+        long between = DateUtil.betweenMonth(nowStart, nowEnd, true);
+        DateTime lastEnd = DateUtil.offsetMonth(nowStart, -1);
+        DateTime lastStart = DateUtil.offsetMonth(lastEnd, Math.toIntExact(-between));
+
+
+//        List<WaterCostCalDto> waterCostCal = costOfWaterReportMapper.waterCostCalData(startMonth,endMonth);
+        List<WaterCostCalDto> nowList = costOfWaterReportMapper.waterCostCalData(startMonth,endMonth);
+        List<WaterCostCalDto> lastMonthList = costOfWaterReportMapper.waterCostCalData(DateUtil.format(lastStart,"yyyyMM"),DateUtil.format(lastEnd,"yyyyMM"));
+        List<WaterCostCalDto> lastYearList = costOfWaterReportMapper.waterCostCalData(lastYearStart,lastYearEnd);
 
-        DateTime parse = DateUtil.parse(yearMonth, "yyyy-MM");
-        String lastMonth = DateUtil.format(DateUtil.offsetMonth(parse, -1), "yyyy-MM");
-        String lastYearMonth = DateUtil.format(DateUtil.offsetMonth(parse, -12), "yyyy-MM");
-
-        List<String> yearMonthList = new ArrayList<>();
-        yearMonthList.add(yearMonth);
-        yearMonthList.add(lastMonth);
-        yearMonthList.add(lastYearMonth);
-
-        List<WaterCostCalDto> waterCostCal = costOfWaterReportMapper.waterCostCalData(yearMonthList);
-        List<WaterCostCalDto> nowList = null;
-        List<WaterCostCalDto> lastMonthList = null;
-        List<WaterCostCalDto> lastYearList = null;
-
-        if (CollectionUtil.isNotEmpty(waterCostCal)) {
-            nowList = waterCostCal.stream().filter(item -> yearMonth.equals(item.getMonth())).collect(Collectors.toList());
-            lastMonthList = waterCostCal.stream().filter(item -> lastMonth.equals(item.getMonth())).collect(Collectors.toList());
-            lastYearList = waterCostCal.stream().filter(item -> lastYearMonth.equals(item.getMonth())).collect(Collectors.toList());
-        }
 
         List<UnitCost> result = new ArrayList<>();
         result.add(UnitCost.builder().name("供水量")
                 .value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getGslTotal() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getGslTotal().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getGslTotal().subtract(lastYearList.get(0).getGslTotal()).divide(lastYearList.get(0).getGslTotal(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getGslTotal().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getGslTotal().subtract(lastMonthList.get(0).getGslTotal()).divide(lastMonthList.get(0).getGslTotal(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getGslTotal().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getGslTotal().subtract(lastMonthList.get(0).getGslTotal()).divide(lastMonthList.get(0).getGslTotal(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("售水量")
                 .value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getSslTotal() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getSslTotal().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getSslTotal().subtract(lastYearList.get(0).getSslTotal()).divide(lastYearList.get(0).getSslTotal(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getSslTotal().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getSslTotal().subtract(lastMonthList.get(0).getSslTotal()).divide(lastMonthList.get(0).getSslTotal(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getSslTotal().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getSslTotal().subtract(lastMonthList.get(0).getSslTotal()).divide(lastMonthList.get(0).getSslTotal(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("产销差")
                 .value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getCxc() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getCxc().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getCxc().subtract(lastYearList.get(0).getCxc()).divide(lastYearList.get(0).getCxc(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getCxc().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getCxc().subtract(lastMonthList.get(0).getCxc()).divide(lastMonthList.get(0).getCxc(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getCxc().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getCxc().subtract(lastMonthList.get(0).getCxc()).divide(lastMonthList.get(0).getCxc(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("漏损率")
                 .value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getLsl() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getLsl().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getLsl().subtract(lastYearList.get(0).getLsl()).divide(lastYearList.get(0).getLsl(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getLsl().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getLsl().subtract(lastMonthList.get(0).getLsl()).divide(lastMonthList.get(0).getLsl(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getLsl().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getLsl().subtract(lastMonthList.get(0).getLsl()).divide(lastMonthList.get(0).getLsl(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("单位变动成本(元/千吨)")
                 .value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getZscb() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getZscb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getZscb().subtract(lastYearList.get(0).getZscb()).divide(lastYearList.get(0).getZscb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getZscb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getZscb().subtract(lastMonthList.get(0).getZscb()).divide(lastMonthList.get(0).getZscb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getZscb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getZscb().subtract(lastMonthList.get(0).getZscb()).divide(lastMonthList.get(0).getZscb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("制水药剂成本")
                 .value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getZsyjcb() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getZsyjcb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getZsyjcb().subtract(lastYearList.get(0).getZsyjcb()).divide(lastYearList.get(0).getZsyjcb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getZsyjcb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getZsyjcb().subtract(lastMonthList.get(0).getZsyjcb()).divide(lastMonthList.get(0).getZsyjcb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getZsyjcb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getZsyjcb().subtract(lastMonthList.get(0).getZsyjcb()).divide(lastMonthList.get(0).getZsyjcb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("常用制水药剂成本")
                 .value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getCyzsyj() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getCyzsyj().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getCyzsyj().subtract(lastYearList.get(0).getCyzsyj()).divide(lastYearList.get(0).getCyzsyj(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getCyzsyj().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getCyzsyj().subtract(lastMonthList.get(0).getCyzsyj()).divide(lastMonthList.get(0).getCyzsyj(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getCyzsyj().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getCyzsyj().subtract(lastMonthList.get(0).getCyzsyj()).divide(lastMonthList.get(0).getCyzsyj(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("PAC")
                 .value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getPaccb() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getPaccb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getPaccb().subtract(lastYearList.get(0).getPaccb()).divide(lastYearList.get(0).getPaccb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getPaccb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getPaccb().subtract(lastMonthList.get(0).getPaccb()).divide(lastMonthList.get(0).getPaccb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getPaccb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getPaccb().subtract(lastMonthList.get(0).getPaccb()).divide(lastMonthList.get(0).getPaccb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("食盐")
                 .value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getSycb() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getSycb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getSycb().subtract(lastYearList.get(0).getSycb()).divide(lastYearList.get(0).getSycb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getSycb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getSycb().subtract(lastMonthList.get(0).getSycb()).divide(lastMonthList.get(0).getSycb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getSycb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getSycb().subtract(lastMonthList.get(0).getSycb()).divide(lastMonthList.get(0).getSycb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("成品次钠")
                 .value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getCncb() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getCncb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getCncb().subtract(lastYearList.get(0).getCncb()).divide(lastYearList.get(0).getCncb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getCncb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getCncb().subtract(lastMonthList.get(0).getCncb()).divide(lastMonthList.get(0).getCncb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getCncb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getCncb().subtract(lastMonthList.get(0).getCncb()).divide(lastMonthList.get(0).getCncb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("应急制水药剂")
                 .value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getYjzsyj() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getYjzsyj().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getYjzsyj().subtract(lastYearList.get(0).getYjzsyj()).divide(lastYearList.get(0).getYjzsyj(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getYjzsyj().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getYjzsyj().subtract(lastMonthList.get(0).getYjzsyj()).divide(lastMonthList.get(0).getYjzsyj(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getYjzsyj().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getYjzsyj().subtract(lastMonthList.get(0).getYjzsyj()).divide(lastMonthList.get(0).getYjzsyj(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("制水PAM")
                 .value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getPamzscbTwo() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getPamzscbTwo().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getPamzscbTwo().subtract(lastYearList.get(0).getPamzscbTwo()).divide(lastYearList.get(0).getPamzscbTwo(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getPamzscbTwo().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getPamzscbTwo().subtract(lastMonthList.get(0).getPamzscbTwo()).divide(lastMonthList.get(0).getPamzscbTwo(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getPamzscbTwo().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getPamzscbTwo().subtract(lastMonthList.get(0).getPamzscbTwo()).divide(lastMonthList.get(0).getPamzscbTwo(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("复合盐")
                 .value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getGmsjcb() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getGmsjcb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getGmsjcb().subtract(lastYearList.get(0).getGmsjcb()).divide(lastYearList.get(0).getGmsjcb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getGmsjcb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getGmsjcb().subtract(lastMonthList.get(0).getGmsjcb()).divide(lastMonthList.get(0).getGmsjcb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getGmsjcb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getGmsjcb().subtract(lastMonthList.get(0).getGmsjcb()).divide(lastMonthList.get(0).getGmsjcb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("活性炭")
                 .value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getFtcb() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getFtcb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getFtcb().subtract(lastYearList.get(0).getFtcb()).divide(lastYearList.get(0).getGslTotal(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getFtcb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getFtcb().subtract(lastMonthList.get(0).getFtcb()).divide(lastMonthList.get(0).getGslTotal(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getFtcb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getFtcb().subtract(lastMonthList.get(0).getFtcb()).divide(lastMonthList.get(0).getGslTotal(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("制泥PAM")
                 .value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getWnpamcb() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getWnpamcb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getWnpamcb().subtract(lastYearList.get(0).getWnpamcb()).divide(lastYearList.get(0).getWnpamcb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getWnpamcb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getWnpamcb().subtract(lastMonthList.get(0).getWnpamcb()).divide(lastMonthList.get(0).getWnpamcb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getWnpamcb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getWnpamcb().subtract(lastMonthList.get(0).getWnpamcb()).divide(lastMonthList.get(0).getWnpamcb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("能耗")
                 .value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getDfcb() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getDfcb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getDfcb().subtract(lastYearList.get(0).getDfcb()).divide(lastYearList.get(0).getDfcb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getDfcb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getDfcb().subtract(lastMonthList.get(0).getDfcb()).divide(lastMonthList.get(0).getDfcb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getDfcb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getDfcb().subtract(lastMonthList.get(0).getDfcb()).divide(lastMonthList.get(0).getDfcb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("水费")
                 .value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getSfcb() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getSfcb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getSfcb().subtract(lastYearList.get(0).getSfcb()).divide(lastYearList.get(0).getSfcb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getSfcb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getSfcb().subtract(lastMonthList.get(0).getSfcb()).divide(lastMonthList.get(0).getSfcb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getSfcb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getSfcb().subtract(lastMonthList.get(0).getSfcb()).divide(lastMonthList.get(0).getSfcb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("水资源费")
                 .value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getSzysfcb() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getSzysfcb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getSzysfcb().subtract(lastYearList.get(0).getSzysfcb()).divide(lastYearList.get(0).getSzysfcb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getSzysfcb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getSzysfcb().subtract(lastMonthList.get(0).getSzysfcb()).divide(lastMonthList.get(0).getSzysfcb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getSzysfcb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getSzysfcb().subtract(lastMonthList.get(0).getSzysfcb()).divide(lastMonthList.get(0).getSzysfcb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("原水费")
                 .value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getYsfcb() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getYsfcb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getYsfcb().subtract(lastYearList.get(0).getYsfcb()).divide(lastYearList.get(0).getYsfcb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getYsfcb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getYsfcb().subtract(lastMonthList.get(0).getYsfcb()).divide(lastMonthList.get(0).getYsfcb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getYsfcb().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getYsfcb().subtract(lastMonthList.get(0).getYsfcb()).divide(lastMonthList.get(0).getYsfcb(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
         return result;
     }
 
     /**
      * 单耗
      *
-     * @param yearMonth yearMonth
+     * @param startMonth startMonth
+     * @param endMonth startMonth
      * @return map
      */
     @Override
-    public List<UnitCost> unitConsumption(String yearMonth) {
+    public List<UnitCost> unitConsumption(String startMonth, String endMonth) {
 
-        DateTime parse = DateUtil.parse(yearMonth, "yyyy-MM");
-        DateTime lastDateTime = DateUtil.offsetMonth(parse, -1);
-        String lastMonth = DateUtil.format(lastDateTime, "yyyy-MM");
-        DateTime lastYear = DateUtil.offsetMonth(parse, -12);
-        String lastYearMonth = DateUtil.format(lastYear, "yyyy-MM");
-
-        List<String> yearMonthList = new ArrayList<>();
-        yearMonthList.add(yearMonth);
-        yearMonthList.add(lastMonth);
-        yearMonthList.add(lastYearMonth);
-
-        List<WaterUnitCalDto> waterUnitCal = costOfWaterReportMapper.waterUnitCalData(yearMonthList);
-
-        List<WaterUnitCalDto> nowList = null;
-        List<WaterUnitCalDto> lastMonthList = null;
-        List<WaterUnitCalDto> lastYearList = null;
-
-        if (CollectionUtil.isNotEmpty(waterUnitCal)) {
-            nowList = waterUnitCal.stream().filter(item -> yearMonth.equals(item.getMonth())).collect(Collectors.toList());
-            lastMonthList = waterUnitCal.stream().filter(item -> lastMonth.equals(item.getMonth())).collect(Collectors.toList());
-            lastYearList = waterUnitCal.stream().filter(item -> lastYearMonth.equals(item.getMonth())).collect(Collectors.toList());
-        }
+        DateTime startTime = DateUtil.parse(startMonth, "yyyyMM");
+        DateTime endTIme = DateUtil.parse(endMonth, "yyyyMM");
+
+        DateTime lastStart = DateUtil.offsetMonth(startTime, -12);
+        DateTime lastEnd = DateUtil.offsetMonth(endTIme, -12);
+        String lastYearStart = DateUtil.format(lastStart, "yyyyMM");
+        String lastYearEnd = DateUtil.format(lastEnd, "yyyyMM");
+
+        long between = DateUtil.betweenMonth(startTime, endTIme, true);
+        DateTime lastMonthEnd = DateUtil.offsetMonth(startTime, -1);
+        DateTime lastMonthStart = DateUtil.offsetMonth(lastEnd, Math.toIntExact(-between));
+
+        List<WaterUnitCalDto> nowList = costOfWaterReportMapper.waterUnitCalData(startMonth,endMonth);
+        List<WaterUnitCalDto> lastMonthList = costOfWaterReportMapper.waterUnitCalData(DateUtil.format(lastMonthStart,"yyyyMM"),DateUtil.format(lastMonthEnd,"yyyyMM"));
+        List<WaterUnitCalDto> lastYearList = costOfWaterReportMapper.waterUnitCalData(lastYearStart,lastYearEnd);
 
-        String nowTable = "TF_YWPN_SCADAHISTORY_R_" + DateUtil.format(parse, "yyyyMM");
-        String lastTable = "TF_YWPN_SCADAHISTORY_R_" + DateUtil.format(lastDateTime, "yyyyMM");
-        String lastYearTable = "TF_YWPN_SCADAHISTORY_R_" + DateUtil.format(lastYear, "yyyyMM");
+        DateTime nowStart = DateUtil.beginOfMonth(startTime);
+        DateTime nowEnd = DateUtil.endOfMonth(endTIme);
+        List<ScadaAvg> nowValue = costOfWaterReportMapper.getScadaAvgValue(nowStart,nowEnd);
 
-        Integer nowCount = costOfWaterReportMapper.tableIsExist(nowTable);
-        Integer lastCount = costOfWaterReportMapper.tableIsExist(lastTable);
-        Integer lastYearCount = costOfWaterReportMapper.tableIsExist(lastYearTable);
+        DateTime lastStartTime = DateUtil.beginOfMonth(lastMonthStart);
+        DateTime lastEndTime = DateUtil.endOfMonth(lastMonthEnd);
+        List<ScadaAvg> lastValue = costOfWaterReportMapper.getScadaAvgValue(lastStartTime,lastEndTime);
 
-        List<ScadaAvg> nowValue = nowCount == 0 ? new ArrayList<>() : costOfWaterReportMapper.getScadaAvgValue(nowTable);
-        List<ScadaAvg> lastValue = lastCount == 0 ? new ArrayList<>() : costOfWaterReportMapper.getScadaAvgValue(lastTable);
-        List<ScadaAvg> lastYearValue = lastYearCount == 0 ? new ArrayList<>() : costOfWaterReportMapper.getScadaAvgValue(lastYearTable);
+        DateTime startLastYear = DateUtil.beginOfMonth(lastStart);
+        DateTime endLastYear = DateUtil.beginOfMonth(lastEnd);
+
+        List<ScadaAvg> lastYearValue = costOfWaterReportMapper.getScadaAvgValue(startLastYear,endLastYear);
 
         BigDecimal nowTurbidity =  CollectionUtil.isNotEmpty(nowValue) ? nowValue.stream().filter(s->s.getItcd().equals(TURBIDITY)).collect(Collectors.toList()).get(0).getAvgNum() : BigDecimal.ZERO;
         BigDecimal lastTurbidity = CollectionUtil.isNotEmpty(lastValue) ? lastValue.stream().filter(s->s.getItcd().equals(TURBIDITY)).collect(Collectors.toList()).get(0).getAvgNum() : BigDecimal.ZERO;
@@ -439,39 +481,48 @@ public class CostOfWaterReportServiceImpl implements CostOfWaterReportService {
 
         result.add(UnitCost.builder().name("PAC").value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getPacdh() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getPacdh().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getPacdh().subtract(lastYearList.get(0).getPacdh()).divide(lastYearList.get(0).getPacdh(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getPacdh().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getPacdh().subtract(lastMonthList.get(0).getPacdh()).divide(lastMonthList.get(0).getPacdh(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getPacdh().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getPacdh().subtract(lastMonthList.get(0).getPacdh()).divide(lastMonthList.get(0).getPacdh(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("食盐").value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getSydh() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getSydh().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getSydh().subtract(lastYearList.get(0).getSydh()).divide(lastYearList.get(0).getSydh(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getSydh().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getSydh().subtract(lastMonthList.get(0).getSydh()).divide(lastMonthList.get(0).getSydh(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getSydh().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getSydh().subtract(lastMonthList.get(0).getSydh()).divide(lastMonthList.get(0).getSydh(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("成品次钠").value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getCndh() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getCndh().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getCndh().subtract(lastYearList.get(0).getCndh()).divide(lastYearList.get(0).getCndh(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getCndh().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getCndh().subtract(lastMonthList.get(0).getCndh()).divide(lastMonthList.get(0).getCndh(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getCndh().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getCndh().subtract(lastMonthList.get(0).getCndh()).divide(lastMonthList.get(0).getCndh(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("制水PAM").value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getPamdh() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getPamdh().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getPamdh().subtract(lastYearList.get(0).getPamdh()).divide(lastYearList.get(0).getPamdh(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getPamdh().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getPamdh().subtract(lastMonthList.get(0).getPamdh()).divide(lastMonthList.get(0).getPamdh(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getPamdh().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getPamdh().subtract(lastMonthList.get(0).getPamdh()).divide(lastMonthList.get(0).getPamdh(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("复合盐").value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getFhydh() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getFhydh().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getFhydh().subtract(lastYearList.get(0).getFhydh()).divide(lastYearList.get(0).getFhydh(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getFhydh().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getFhydh().subtract(lastMonthList.get(0).getFhydh()).divide(lastMonthList.get(0).getFhydh(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getFhydh().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getFhydh().subtract(lastMonthList.get(0).getFhydh()).divide(lastMonthList.get(0).getFhydh(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("活性炭").value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getFtdh() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getFtdh().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getFtdh().subtract(lastYearList.get(0).getFtdh()).divide(lastYearList.get(0).getFtdh(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getFtdh().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getFtdh().subtract(lastMonthList.get(0).getFtdh()).divide(lastMonthList.get(0).getFtdh(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getFtdh().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getFtdh().subtract(lastMonthList.get(0).getFtdh()).divide(lastMonthList.get(0).getFtdh(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("制泥PAM").value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getPamwndh() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getPamwndh().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getPamwndh().subtract(lastYearList.get(0).getPamwndh()).divide(lastYearList.get(0).getPamwndh(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getPamwndh().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getPamwndh().subtract(lastMonthList.get(0).getPamwndh()).divide(lastMonthList.get(0).getPamwndh(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getPamwndh().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getPamwndh().subtract(lastMonthList.get(0).getPamwndh()).divide(lastMonthList.get(0).getPamwndh(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("能耗").value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getNhdh() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getNhdh().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getNhdh().subtract(lastYearList.get(0).getNhdh()).divide(lastYearList.get(0).getNhdh(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getNhdh().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getNhdh().subtract(lastMonthList.get(0).getNhdh()).divide(lastMonthList.get(0).getNhdh(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getNhdh().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getNhdh().subtract(lastMonthList.get(0).getNhdh()).divide(lastMonthList.get(0).getNhdh(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
 
         result.add(UnitCost.builder().name("自用水率").value(CollectionUtil.isNotEmpty(nowList) ? nowList.get(0).getZysl() : BigDecimal.ZERO)
                 .yearOnYear(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastYearList) && lastYearList.get(0).getZysl().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getZysl().subtract(lastYearList.get(0).getZysl()).divide(lastYearList.get(0).getZysl(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
-                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getZysl().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getZysl().subtract(lastMonthList.get(0).getZysl()).divide(lastMonthList.get(0).getZysl(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO).build());
+                .annulus(CollectionUtil.isNotEmpty(nowList) && CollectionUtil.isNotEmpty(lastMonthList) && lastMonthList.get(0).getZysl().compareTo(BigDecimal.ZERO) != 0 ? nowList.get(0).getZysl().subtract(lastMonthList.get(0).getZysl()).divide(lastMonthList.get(0).getZysl(), 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : BigDecimal.ZERO)
+                .build());
         return result;
     }
 
@@ -575,10 +626,34 @@ public class CostOfWaterReportServiceImpl implements CostOfWaterReportService {
         return result;
     }
 
+    /**
+     * 售水量-按行政类型统计
+     *
+     * @param startMonth 开始月份
+     * @param endMonth   结束月份
+     * @return list
+     */
+    @Override
+    public List<AdminstrativeType> administrativeTypeCount(String startMonth, String endMonth) {
+        return costOfWaterReportMapper.administrativeTypeCount(startMonth, endMonth);
+    }
+
+    /**
+     * 售水量-按行政区域划分统计
+     *
+     * @param startMonth 开始月份
+     * @param endMonth  结束月份
+     * @return list
+     */
+    @Override
+    public List<AdministrativeArea> administrativeAreaCount(String startMonth, String endMonth) {
+        return costOfWaterReportMapper.administrativeAreaCount(startMonth, endMonth);
+    }
+
 
     /*-------------------------------------计算-------------------------------------*/
 
-    private MarketingStatisticsVo dateCompute(List<CountPlanValue> nowDataList, List<CountPlanValue> lastDataList, String yearMonth, Integer type, Boolean isSum) {
+    private MarketingStatisticsVo dateCompute(List<CountPlanValue> nowDataList, List<CountPlanValue> lastDataList, String startMonth,String endMonth, Integer type, Boolean isSum) {
         if (type != null) {
             nowDataList = nowDataList.stream().filter(c -> c.getTwoType().equals(type)).collect(Collectors.toList());
             lastDataList = lastDataList.stream().filter(c -> c.getTwoType().equals(type)).collect(Collectors.toList());
@@ -613,10 +688,10 @@ public class CostOfWaterReportServiceImpl implements CostOfWaterReportService {
                     waterSoldYearPlan = BigDecimal.valueOf(waterSoldYearPlanCollect.stream().mapToDouble(c -> c.getPlanNumber().doubleValue()).average().getAsDouble()).setScale(4, BigDecimal.ROUND_HALF_UP);
                 }
             }
-            waterSoldMonthActualList = nowDataList.stream().filter(c -> c.getYearMonth().equals(yearMonth) && c.getActualNumber() != null).collect(Collectors.toList());
+            waterSoldMonthActualList = nowDataList.stream().filter(c ->c.getYearMonth().compareTo(startMonth) >= 0 && c.getYearMonth().compareTo(endMonth) <= 0 && c.getActualNumber() != null).collect(Collectors.toList());
 
-            List<CountPlanValue> waterSoldSumActualValueCollect = nowDataList.stream().filter(c -> c.getYearMonth().compareTo(yearMonth) <= 0 && c.getActualNumber() != null).collect(Collectors.toList());
-            List<CountPlanValue> waterSoldSumPlanValueCollect = nowDataList.stream().filter(c -> c.getYearMonth().compareTo(yearMonth) <= 0 && c.getActualNumber() != null).collect(Collectors.toList());
+            List<CountPlanValue> waterSoldSumActualValueCollect = nowDataList.stream().filter(c -> c.getYearMonth().compareTo(endMonth) <= 0 && c.getActualNumber() != null).collect(Collectors.toList());
+            List<CountPlanValue> waterSoldSumPlanValueCollect = nowDataList.stream().filter(c -> c.getYearMonth().compareTo(endMonth) <= 0 && c.getActualNumber() != null).collect(Collectors.toList());
 
             if (CollectionUtil.isNotEmpty(waterSoldSumActualValueCollect)) {
                 if (isSum) {
@@ -636,7 +711,7 @@ public class CostOfWaterReportServiceImpl implements CostOfWaterReportService {
         waterSoldDifference = waterSoldSumActualValue != null && waterSoldSumPlanValue != null ? waterSoldSumActualValue.subtract(waterSoldSumPlanValue) : null;
         waterSoldDifferenceRate = waterSoldDifference != null ? waterSoldDifference.divide(waterSoldSumPlanValue, 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : null;
 
-        List<CountPlanValue> lastYearWaterSoldSumActualValueCollect = lastDataList.stream().filter(c -> c.getYearMonth().compareTo(yearMonth) <= 0 && c.getActualNumber() != null).collect(Collectors.toList());
+        List<CountPlanValue> lastYearWaterSoldSumActualValueCollect = lastDataList.stream().filter(c -> c.getYearMonth().compareTo(endMonth) <= 0 && c.getActualNumber() != null).collect(Collectors.toList());
         if (CollectionUtil.isNotEmpty(lastYearWaterSoldSumActualValueCollect)) {
             if (isSum) {
                 lastYearWaterSoldSumActualValue = BigDecimal.valueOf(lastYearWaterSoldSumActualValueCollect.stream().mapToDouble(c -> c.getActualNumber().doubleValue()).sum());
@@ -648,7 +723,8 @@ public class CostOfWaterReportServiceImpl implements CostOfWaterReportService {
         lastYearWaterSoldDifferenceRate = lastYearWaterSoldDifference != null ? lastYearWaterSoldDifference.divide(lastYearWaterSoldSumActualValue, 4, BigDecimal.ROUND_HALF_UP).multiply(HUNDRED) : null;
 
         return MarketingStatisticsVo.builder()
-                .yearPlanNumber(waterSoldYearPlan).actualNumber(CollectionUtil.isNotEmpty(waterSoldMonthActualList) ? Objects.requireNonNull(waterSoldMonthActualList).get(0).getActualNumber() : null)
+                .yearPlanNumber(waterSoldYearPlan)
+                .actualNumber(waterSoldMonthActualList.stream().map(CountPlanValue::getActualNumber).filter(Objects::nonNull).reduce(BigDecimal.ZERO,BigDecimal::add))
                 .sumActualNumber(waterSoldSumActualValue).sumPlanNumber(waterSoldSumPlanValue)
                 .difference(waterSoldDifference).differenceRate(waterSoldDifferenceRate)
                 .lastYearSumActualNumber(lastYearWaterSoldSumActualValue).lastYearDifference(lastYearWaterSoldDifference)

+ 80 - 43
xrtyGis/src/main/resources/custom/CostOfWaterReportMapper.xml

@@ -96,40 +96,36 @@
     </select>
 
     <select id="waterCostCalData" resultType="com.tofly.xrtygis.custom.entity.dto.WaterCostCalDto">
-        select to_char(a.UP_DATE,'yyyy-mm') month,
-        nvl(round(GSL_TOTAL,4),0) gslTotal ,
-        nvl(round(SSL_TOTAL,4),0) sslTotal,
-        nvl(round(CXC,0),0) cxc,
-        nvl(round(LSL,0),0) lsl,
-        nvl(round((PACZFY_ONE + PACZFY_TWO + SYZFY_ONE + nvl(SYZFY_TWO,0) + CNZFY_TWO + CNZFY + PAMZSZFY + GMSJFHYZFY +
-        FTZFY + PAMWNZFY + SZYSF_ONE + SZYSF_TWO + YSF + DF_ONE_TOTAL + DF_TWO_TOTAL) / GSL_TOTAL * 1000,4),0) zscb,
+        select
+        nvl(round(sum(GSL_TOTAL),4),0) gslTotal ,
+        nvl(round(sum(SSL_TOTAL),4),0) sslTotal,
+        nvl(round((sum(GSL_TOTAL) + sum(GSL_QBJ) - sum(SSL_TOTAL)) / (sum(GSL_TOTAL) + sum(GSL_QBJ)),4) * 100,0) cxc,
+        nvl(round((sum(GSL_TOTAL) + sum(GSL_QBJ) - sum(SSL_TOTAL) - sum(WSPSL)) / (sum(GSL_TOTAL) + sum(GSL_QBJ)),4) * 100,0) lsl,
+        nvl(round((sum(PACZFY_ONE) + sum(PACZFY_TWO) + sum(SYZFY_ONE) + nvl(sum(SYZFY_TWO),0) + sum(CNZFY_TWO) + sum(CNZFY) + sum(PAMZSZFY) + sum(GMSJFHYZFY) +
+        sum(FTZFY) + sum(PAMWNZFY) + sum(SZYSF_ONE) + sum(SZYSF_TWO) + sum(YSF) + sum(DF_ONE_TOTAL) + sum(DF_TWO_TOTAL)) / sum(GSL_TOTAL) * 1000,4),0) zscb,
         --制水药剂成本
-        nvl(round((PACZFY_ONE + PACZFY_TWO + SYZFY_ONE + nvl(SYZFY_TWO,0) + CNZFY_TWO + CNZFY + PAMZSZFY + GMSJFHYZFY +
-        FTZFY + PAMWNZFY) / GSL_TOTAL * 1000,4),0) zsyjcb,
+        nvl(round((sum(PACZFY_ONE) + sum(PACZFY_TWO) + sum(SYZFY_ONE) + nvl(sum(SYZFY_TWO),0) + sum(CNZFY_TWO) + sum(CNZFY) + sum(PAMZSZFY) + sum(GMSJFHYZFY) +
+        sum(FTZFY) + sum(PAMWNZFY)) / sum(GSL_TOTAL) * 1000,4),0) zsyjcb,
         --常用制水药剂
-        nvl(round((PACZFY_ONE + PACZFY_TWO + SYZFY_ONE + nvl(SYZFY_TWO,0) + CNZFY_TWO) / GSL_TOTAL * 1000,4),0) cyzsyj,
-        nvl(round((PACZFY_ONE + PACZFY_TWO) / nullif(GSL_TOTAL,0) * 1000,4),0) paccb,
-        nvl(round((SYZFY_ONE + nvl(SYZFY_TWO,0)) / nullif(GSL_TOTAL,0) * 1000,4),0) sycb,
-        nvl(round((CNZFY + CNZFY_TWO) / nullif(GSL_TOTAL,0) * 1000,4),0) cncb,
+        nvl(round((sum(PACZFY_ONE) + sum(PACZFY_TWO) + sum(SYZFY_ONE) + nvl(sum(SYZFY_TWO),0) + sum(CNZFY_TWO)) / sum(GSL_TOTAL) * 1000,4),0) cyzsyj,
+        nvl(round((sum(PACZFY_ONE) + sum(PACZFY_TWO)) / nullif(sum(GSL_TOTAL),0) * 1000,4),0) paccb,
+        nvl(round((sum(SYZFY_ONE) + nvl(sum(SYZFY_TWO),0)) / nullif(sum(GSL_TOTAL),0) * 1000,4),0) sycb,
+        nvl(round((sum(CNZFY) + sum(CNZFY_TWO)) / nullif(sum(GSL_TOTAL),0) * 1000,4),0) cncb,
         --应急制水药剂成本
-        nvl(round((CNZFY + PAMZSZFY + GMSJFHYZFY + FTZFY) / nullif(GSL_TOTAL,0) * 1000,4),0) yjzsyj,
-        nvl(round(PAMZSCB_TWO,4),0) pamzscbTwo,
-        nvl(round(GMSJFHYCB_TWO,4),0) gmsjcb,
-        nvl(round(FTCB_TWO,4),0) ftcb,
-        nvl(round(PAMWNCB_TWO,4),0) wnpamcb,
-        nvl(round(DFCB_TOTAL,4),0) dfcb,
-        nvl(round((SZYSF_ONE + SZYSF_TWO + YSF) / nullif(GSL_TOTAL,0) * 1000,4),0) sfcb,
-        nvl(round(SZYSFCB_TOTAL,4),0) szysfcb,
-        nvl(round(YSFCB,4),0) ysfcb
+        nvl(round((sum(CNZFY) + sum(PAMZSZFY) + sum(GMSJFHYZFY) + sum(FTZFY)) / nullif(sum(GSL_TOTAL),0) * 1000,4),0) yjzsyj,
+        nvl(round(sum(PAMZSZFY) / sum(GSL_TOTAL),4),0) pamzscbTwo,
+        nvl(round(sum(GMSJFHYZFY) / sum(GSL_TOTAL),4),0) gmsjcb,
+        nvl(round(sum(FTZFY) / sum(GSL_TOTAL),4),0) ftcb,
+        nvl(round(sum(PAMWNZFY) / sum(GSL_TOTAL),4),0) wnpamcb,
+        nvl(round(sum(DLDF_TOTAL) / sum(GSL_TOTAL),4),0) dfcb,
+        nvl(round((sum(SZYSF_ONE) + sum(SZYSF_TWO) + sum(YSF)) / nullif(sum(GSL_TOTAL),0) * 1000,4),0) sfcb,
+        nvl(round(sum(SZYSF_TOTAL) / sum(GSL_TOTAL),4),0) szysfcb,
+        nvl(round(sum(YSF) / sum(GSL_TOTAL),4),0) ysfcb
         from TF_YWPN_COSTRLWATER_W a
         left join TF_YWPN_COSTRLFIXED_W b on to_char(a.UP_DATE,'yyyy-mm') = to_char(b.UP_DATE,'yyyy-mm') and a.MARK =
         b.MARK
         where a.MARK = 1
-        and to_char(a.UP_DATE, 'yyyy-mm') in
-        <foreach collection="yearMonth" item="month" open="(" separator="," close=")">
-            #{month}
-        </foreach>
-        order by month
+        and to_char(a.UP_DATE, 'yyyymm') between #{startMonth} and #{endMonth}
     </select>
 
     <select id="tableIsExist" resultType="integer">
@@ -139,30 +135,27 @@
     </select>
 
     <select id="waterUnitCalData" resultType="com.tofly.xrtygis.custom.entity.dto.WaterUnitCalDto">
-        select nvl(round((PAC_ONE + PAC_TWO) / (nvl(ZSL_TOTAL, 0) * 10), 4), 0) pacdh,
-        nvl(round((SY_ONE + nvl(SY_TWO,0)) / (nvl(ZSL_TOTAL, 0) * 10), 4), 0) sydh,
-        nvl(round((CN + CN_TWO) / (nvl(ZSL_TOTAL, 0) * 10), 4), 0) cndh,
-        nvl(round((PAM) / (nvl(ZSL_TOTAL, 0) * 10), 4), 0) pamdh,
-        nvl(round((GMSJFHY) / (nvl(ZSL_TOTAL, 0) * 10), 4), 0) fhydh,
-        nvl(round((FT) / (nvl(ZSL_TOTAL, 0) * 10), 4), 0) ftdh,
-        nvl(round((PAM_WY) / (nvl(ZSL_TOTAL, 0) * 10), 4), 0) pamwndh,
-        nvl(round((DLDL_TOTAL) / (nvl(ZSL_TOTAL, 0) * 10), 4), 0) nhdh,
-        nvl(round(ZYSLL_TOTAL,2), 0) zysl,
-        to_char(UP_DATE,'yyyy-mm') month
+        select nvl(round((sum(PAC_ONE) + sum(PAC_TWO)) / (nvl(sum(ZSL_TOTAL), 0) * 10), 4), 0) pacdh,
+        nvl(round((sum(SY_ONE) + nvl(sum(SY_TWO),0)) / (nvl(sum(ZSL_TOTAL), 0) * 10), 4), 0) sydh,
+        nvl(round((sum(CN) + sum(CN_TWO)) / (nvl(sum(ZSL_TOTAL), 0) * 10), 4), 0) cndh,
+        nvl(round((sum(PAM)) / (nvl(sum(ZSL_TOTAL), 0) * 10), 4), 0) pamdh,
+        nvl(round(sum(GMSJFHY) / (nvl(sum(ZSL_TOTAL), 0) * 10), 4), 0) fhydh,
+        nvl(round(sum(FT) / (nvl(sum(ZSL_TOTAL), 0) * 10), 4), 0) ftdh,
+        nvl(round(sum(PAM_WY) / (nvl(sum(ZSL_TOTAL), 0) * 10), 4), 0) pamwndh,
+        nvl(round(sum(DLDL_TOTAL) / (nvl(sum(ZSL_TOTAL), 0) * 10), 4), 0) nhdh,
+        nvl(round((sum(ZSL_TOTAL) - sum(GSL_TOTAL)) / sum(ZSL_TOTAL),4) * 100 , 0) zysl
         from TF_YWPN_COSTRLWATER_W a
         where MARK = 1
-        and to_char(a.UP_DATE, 'yyyy-mm') in
-        <foreach collection="yearMonth" item="month" open="(" separator="," close=")">
-            #{month}
-        </foreach>
+        and to_char(a.UP_DATE, 'yyyymm') between #{startMonth} and #{endMonth}
     </select>
 
     <select id="getScadaAvgValue" resultType="com.tofly.xrtygis.custom.entity.dto.ScadaAvg">
-        select round(avg(ITNUM_VAL),4) avgNum,
+        select round(avg(ITNUM_VAL), 2) avgNum,
                itcd
-        from ${tableName}
+        from TF_YWPN_SCADAHISTORY_R_VIEW
         where itcd in ('净水厂\yszd.PV', '自来水二厂\取水头\AnDan.PV')
           and ITNUM_VAL not in (9999, -99999, 99999, -9999)
+        and SCADA_TIME between #{start} and #{end}
         group by itcd
     </select>
 
@@ -245,4 +238,48 @@
           and CREATE_TIME between #{start} and #{end}
         group by to_char(CREATE_TIME, 'yyyy-mm')
     </select>
+
+    <select id="administrativeTypeCount" resultType="com.tofly.xrtygis.entity.AdminstrativeType">
+        select type_name,
+               sum(water_number)  as water_number,
+               sum(total_client)  as total_client,
+               sum(residents)     as residents,
+               sum(non_residents) as non_residents,
+               sum(special)       as special
+        from TF_YWPN_ADMINSTRATIVETYPE_W
+        where MONTH_PLAN between #{startMonth} and #{endMonth}
+        group by type_name
+        order by type_name
+    </select>
+
+    <select id="administrativeAreaCount" resultType="com.tofly.xrtygis.entity.AdministrativeArea">
+        select street,
+               sum(water_number) as water_number,
+               sum(client_number) as client_number,
+               sum(town_add_client) as town_add_client,
+               sum(rural_add_client) as rural_add_client,
+               sum(account_closure) as account_closure,
+               sum(in_net) as in_net
+        from TF_YWPN_ADMINISTRATIVEAREA_W
+        where MONTH_PLAN between #{startMonth} and #{endMonth}
+        group by street
+        order by STREET
+    </select>
+
+    <select id="satisfactionStatistics" resultType="com.tofly.xrtygis.entity.Satisfaction">
+        select verySatisfied,
+               satisfied,
+               general,
+               dissatisfied,
+               total,
+               round(((verySatisfied * 1 + satisfied * 0.85 + general * 0.7 + dissatisfied * 0.5) / nullif(total, 0)) * 100,
+                     2) scores
+        from (select sum(very_satisfied) as verySatisfied,
+                     sum(satisfied)      as satisfied,
+                     sum(general)        as general,
+                     sum(dissatisfied)   as dissatisfied,
+                     sum(total)          as total
+              from TF_YWPN_SATISFACTION_W
+              where MONTH_PLAN between #{startMonth} and #{endMonth})
+    </select>
 </mapper>

+ 2 - 2
xrtyMeter/src/main/java/com/tofly/watermeter/controller/MeterReadingAccuracyController.java

@@ -48,8 +48,8 @@ public class MeterReadingAccuracyController {
 
     @GetMapping("/meterReadingAccuracyServiceCount")
     @ApiOperation("抄表准确率统计")
-    public ResultRespone<Map<String, MeterReadingAccuracy>> meterReadingAccuracyServiceCount(String yearMonth){
-        return ResultRespone.success(meterReadingAccuracyService.meterReadingAccuracyServiceCount(yearMonth));
+    public ResultRespone<Map<String, MeterReadingAccuracy>> meterReadingAccuracyServiceCount(String startMonth, String endMonth){
+        return ResultRespone.success(meterReadingAccuracyService.meterReadingAccuracyServiceCount(startMonth, endMonth));
     }
 
 }

+ 4 - 2
xrtyMeter/src/main/java/com/tofly/watermeter/mapper/MeterReadingAccuracyMapper.java

@@ -14,11 +14,13 @@ public interface MeterReadingAccuracyMapper extends BaseMapper<MeterReadingAccur
 
     /**
      * 机械表统计
-     * @param yearMonth 月份
+     * @param startMonth 月份
+     * @param endMonth 月份
      * @return MeterReadingAccuracy
      */
-    MeterReadingAccuracy mechanicalWatchesCount(@Param("yearMonth") String yearMonth);
+    MeterReadingAccuracy mechanicalWatchesCount(@Param("startMonth") String startMonth, @Param("endMonth") String endMonth);
 
+    MeterReadingAccuracy waterMeterCount(@Param("startMonth") String startMonth, @Param("endMonth") String endMonth);
 }
 
 

+ 1 - 1
xrtyMeter/src/main/java/com/tofly/watermeter/service/MeterReadingAccuracyService.java

@@ -17,6 +17,6 @@ public interface MeterReadingAccuracyService extends IService<MeterReadingAccura
      * @param yearMonth 年月yyyyMM
      * @return map
      */
-    Map<String, MeterReadingAccuracy> meterReadingAccuracyServiceCount(String yearMonth);
+    Map<String, MeterReadingAccuracy> meterReadingAccuracyServiceCount(String startMonth, String endMonth);
 
 }

+ 3 - 4
xrtyMeter/src/main/java/com/tofly/watermeter/service/impl/MeterReadingAccuracyServiceImpl.java

@@ -1,6 +1,5 @@
 package com.tofly.watermeter.service.impl;
 
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.tofly.watermeter.entity.MeterReadingAccuracy;
 import com.tofly.watermeter.mapper.MeterReadingAccuracyMapper;
@@ -26,11 +25,11 @@ public class MeterReadingAccuracyServiceImpl extends ServiceImpl<MeterReadingAcc
      * @return map
      */
     @Override
-    public Map<String, MeterReadingAccuracy> meterReadingAccuracyServiceCount(String yearMonth) {
+    public Map<String, MeterReadingAccuracy> meterReadingAccuracyServiceCount(String startMonth, String endMonth) {
         Map<String, MeterReadingAccuracy> result = new HashMap<>(2);
-        MeterReadingAccuracy meterReadingAccuracy = baseMapper.mechanicalWatchesCount(yearMonth);
+        MeterReadingAccuracy meterReadingAccuracy = baseMapper.mechanicalWatchesCount(startMonth, endMonth);
         result.put("machinery", meterReadingAccuracy);
-        result.put("remote",getOne(Wrappers.<MeterReadingAccuracy>lambdaQuery().eq(MeterReadingAccuracy::getMonthPlan, yearMonth)));
+        result.put("remote", baseMapper.waterMeterCount(startMonth, endMonth));
         return result;
     }
 }

+ 12 - 0
xrtyMeter/src/main/java/com/tofly/watermeter/service/impl/QfcbplandetailsServiceImpl.java

@@ -7,6 +7,7 @@ package com.tofly.watermeter.service.impl;
 import cn.hutool.core.collection.CollectionUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -103,6 +104,17 @@ public class QfcbplandetailsServiceImpl extends ServiceImpl<QfcbplandetailsMappe
         } catch (Exception e) {
             e.printStackTrace();
         }
+        if (CollectionUtil.isNotEmpty(result)){
+            for (Qfkhjbxx qfkhjbxx : result) {
+                String lxdh = qfkhjbxx.getLxdh();
+                String lxsj = qfkhjbxx.getLxsj();
+                if (StringUtils.isBlank(lxdh) || "0".equals(lxdh)){
+                    if (StringUtils.isNotBlank(lxsj) || !"0".equals(lxsj)){
+                        qfkhjbxx.setLxdh(lxsj);
+                    }
+                }
+            }
+        }
         return result;
     }
 

+ 15 - 6
xrtyMeter/src/main/resources/mapper/MeterReadingAccuracyMapper.xml

@@ -15,18 +15,27 @@
     <select id="mechanicalWatchesCount" resultType="com.tofly.watermeter.entity.MeterReadingAccuracy">
         with gd as (select count(*) mistake, to_char(DJSJ, 'yyyymm') monthPlan
                     from TF_YWPN_GDINFO_W
-                    where GDXF2 in (1)
-                      and to_char(DJSJ, 'yyyymm') = #{yearMonth}
+                    where GDXF2 in (506, 507)
+                      and to_char(DJSJ, 'yyyymm') between #{startMonth} and #{endMonth}
                     group by to_char(DJSJ, 'yyyymm'))
         select materRead,
-               MONTH_PLAN monthPlan,
-               nvl(mistake,0) mistake,
-               round((materRead - nvl(mistake,0)) / materRead * 100, 2) accuracy
+               MONTH_PLAN                                                monthPlan,
+               nvl(mistake, 0)                                           mistake,
+               round((materRead - nvl(mistake, 0)) / materRead * 100, 2) accuracy
         from (select count(*) materRead, MONTH_PLAN
               from TF_YWPN_READMETERHIS_W
-              where MONTH_PLAN = #{yearMonth}
+              where MONTH_PLAN between #{startMonth} and #{endMonth}
               group by MONTH_PLAN) a
                  left join gd b on a.MONTH_PLAN = b.monthPlan
     </select>
 
+    <select id="waterMeterCount" resultType="com.tofly.watermeter.entity.MeterReadingAccuracy">
+        with countNum as (select nvl(sum(MATER_READ), 0) materRead,
+                                 nvl(sum(MISTAKE), 0)    mistake
+                          from TF_YWPN_METERREADINGACCURACY_W
+                          where MONTH_PLAN between #{startMonth} and #{endMonth})
+        select materRead, mistake, nvl(round((materRead - mistake) / nullif(materRead, 0), 4) * 100, 0) accuracy
+        from countNum
+    </select>
+
 </mapper>