yangjunfeng hai 1 ano
pai
achega
49d2ff2096

+ 174 - 0
snws-monitor/snws-monitor-boot/src/main/java/com/tofly/monitor/screenDisplay/entity/TfDayStatistics.java

@@ -64,71 +64,239 @@ public class TfDayStatistics extends Model<TfDayStatistics> {
      */
     @ApiModelProperty(value = "入口累计流量")
     private Double inCumulativeFlow;
+    /**
+     * 入口累计流量环比
+     */
+    @ApiModelProperty(value = "入口累计流量环比")
+    @TableField(exist = false)
+    private Float inCumulativeFlowMoM;
+    /**
+     * 入口累计流量同比
+     */
+    @ApiModelProperty(value = "入口累计流量同比")
+    @TableField(exist = false)
+    private Float inCumulativeFlowYoY;
     /**
      * 入口COD
      */
     @ApiModelProperty(value = "入口COD")
     private Double inCod;
+    /**
+     * 入口COD环比
+     */
+    @ApiModelProperty(value = "入口COD环比")
+    @TableField(exist = false)
+    private Float inCodMoM;
+    /**
+     * 入口COD同比
+     */
+    @ApiModelProperty(value = "入口COD同比")
+    @TableField(exist = false)
+    private Float inCodYoY;
     /**
      * 入口SS
      */
     @ApiModelProperty(value = "入口SS")
     private Double inSs;
+    /**
+     * 入口SS环比
+     */
+    @ApiModelProperty(value = "入口SS环比")
+    @TableField(exist = false)
+    private Float inSsMoM;
+    /**
+     * 入口SS同比
+     */
+    @ApiModelProperty(value = "入口SS同比")
+    @TableField(exist = false)
+    private Float inSsYoY;
     /**
      * 入口PH
      */
     @ApiModelProperty(value = "入口PH")
     private Double inPh;
+    /**
+     * 入口PH环比
+     */
+    @ApiModelProperty(value = "入口PH环比")
+    @TableField(exist = false)
+    private Float inPhMoM;
+    /**
+     * 入口PH同比
+     */
+    @ApiModelProperty(value = "入口PH同比")
+    @TableField(exist = false)
+    private Float inPhYoY;
     /**
      * 入口氨氮
      */
     @ApiModelProperty(value = "入口氨氮")
     private Double inNh3n;
+    /**
+     * 入口氨氮环比
+     */
+    @ApiModelProperty(value = "入口氨氮环比")
+    @TableField(exist = false)
+    private Float inNh3nMoM;
+    /**
+     * 入口氨氮同比
+     */
+    @ApiModelProperty(value = "入口氨氮同比")
+    @TableField(exist = false)
+    private Float inNh3nYoY;
     /**
      * 入口总磷
      */
     @ApiModelProperty(value = "入口总磷")
     private Double inTp;
+    /**
+     * 入口总磷环比
+     */
+    @ApiModelProperty(value = "入口总磷环比")
+    @TableField(exist = false)
+    private Float inTpMoM;
+    /**
+     * 入口总磷同比
+     */
+    @ApiModelProperty(value = "入口总磷同比")
+    @TableField(exist = false)
+    private Float inTpYoY;
     /**
      * 入口总氮
      */
     @ApiModelProperty(value = "入口总氮")
     private Double inTn;
+    /**
+     * 入口总氮环比
+     */
+    @ApiModelProperty(value = "入口总氮环比")
+    @TableField(exist = false)
+    private Float inTnMoM;
+    /**
+     * 入口总氮同比
+     */
+    @ApiModelProperty(value = "入口总氮同比")
+    @TableField(exist = false)
+    private Float inTnYoY;
                 /**
      * 出口累计流量
      */
             @ApiModelProperty(value = "出口累计流量")
                 private Double outCumulativeFlow;
+    /**
+     * 出口累计流量环比
+     */
+    @ApiModelProperty(value = "出口累计流量环比")
+    @TableField(exist = false)
+    private Float outCumulativeFlowMoM;
+    /**
+     * 出口累计流量同比
+     */
+    @ApiModelProperty(value = "出口累计流量同比")
+    @TableField(exist = false)
+    private Float outCumulativeFlowYoY;
                 /**
      * 出口COD
      */
             @ApiModelProperty(value = "出口COD")
                 private Double outCod;
+    /**
+     * 出口COD环比
+     */
+    @ApiModelProperty(value = "出口COD环比")
+    @TableField(exist = false)
+    private Float outCodMoM;
+    /**
+     * 出口COD同比
+     */
+    @ApiModelProperty(value = "出口COD同比")
+    @TableField(exist = false)
+    private Float outCodYoY;
                 /**
      * 出口SS
      */
             @ApiModelProperty(value = "出口SS")
                 private Double outSs;
+    /**
+     * 出口SS环比
+     */
+    @ApiModelProperty(value = "出口SS环比")
+    @TableField(exist = false)
+    private Float outSsMoM;
+    /**
+     * 出口SS同比
+     */
+    @ApiModelProperty(value = "出口SS同比")
+    @TableField(exist = false)
+    private Float outSsYoY;
                 /**
      * 出口PH
      */
             @ApiModelProperty(value = "出口PH")
                 private Double outPh;
+    /**
+     * 出口PH环比
+     */
+    @ApiModelProperty(value = "出口PH环比")
+    @TableField(exist = false)
+    private Float outPhMoM;
+    /**
+     * 出口PH同比
+     */
+    @ApiModelProperty(value = "出口PH同比")
+    @TableField(exist = false)
+    private Float outPhYoY;
                 /**
      * 出口氨氮
      */
             @ApiModelProperty(value = "出口氨氮")
                 private Double outNh3n;
+    /**
+     * 出口氨氮环比
+     */
+    @ApiModelProperty(value = "出口氨氮环比")
+    @TableField(exist = false)
+    private Float outNh3nMoM;
+    /**
+     * 出口氨氮同比
+     */
+    @ApiModelProperty(value = "出口氨氮同比")
+    @TableField(exist = false)
+    private Float outNh3nYoY;
                 /**
      * 出口总磷
      */
             @ApiModelProperty(value = "出口总磷")
                 private Double outTp;
+    /**
+     * 出口总磷环比
+     */
+    @ApiModelProperty(value = "出口总磷环比")
+    @TableField(exist = false)
+    private Float outTpMoM;
+    /**
+     * 出口总磷同比
+     */
+    @ApiModelProperty(value = "出口总磷同比")
+    @TableField(exist = false)
+    private Float outTpYoY;
                 /**
      * 出口总氮
      */
             @ApiModelProperty(value = "出口总氮")
                 private Double outTn;
+    /**
+     * 出口总氮环比
+     */
+    @ApiModelProperty(value = "出口总氮环比")
+    @TableField(exist = false)
+    private Float outTnMoM;
+    /**
+     * 出口总氮同比
+     */
+    @ApiModelProperty(value = "出口总氮同比")
+    @TableField(exist = false)
+    private Float outTnYoY;
                 /**
      * 指标报警次数
      */
@@ -188,6 +356,12 @@ public class TfDayStatistics extends Model<TfDayStatistics> {
     @ApiModelProperty(value = "污泥含水率(%)")
     @TableField(exist = false)
     private Float sludgeWaterRate;
+    /**
+     * 污泥处置量(吨)
+     */
+    @ApiModelProperty(value = "污泥处置量(吨)")
+    @TableField(exist = false)
+    private Double sludgeDispose;
     /**
      * 耗能(kw·h)
      */

+ 36 - 0
snws-monitor/snws-monitor-boot/src/main/java/com/tofly/monitor/screenDisplay/entity/vo/IndexValCensusVo.java

@@ -5,6 +5,8 @@ import lombok.Data;
 
 import java.io.Serializable;
 import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
 
 /**
  *
@@ -28,6 +30,9 @@ public class IndexValCensusVo implements Serializable {
     @ApiModelProperty(value = "本月污水处理量")
     private BigDecimal sewageWaterThisM;
 
+    @ApiModelProperty(value = "本月污泥处理量")
+    private BigDecimal sludgeHandleThisM;
+
     @ApiModelProperty(value = "本季度污水处理量")
     private BigDecimal sewageWaterQuarter;
 
@@ -37,6 +42,15 @@ public class IndexValCensusVo implements Serializable {
     @ApiModelProperty(value = "今年污水处理量")
     private BigDecimal sewageWaterThisY;
 
+    @ApiModelProperty(value = "今年污水处理量同比")
+    private Float sewageWaterThisYYoY;
+
+    @ApiModelProperty(value = "今年污泥处理量")
+    private BigDecimal sludgeHandleThisY;
+
+    @ApiModelProperty(value = "今年污泥处理量同比")
+    private Float sludgeHandleThisYYOY;
+
     @ApiModelProperty(value = "污水处理量年度占比")
     private Float sewageWaterPropY;
 
@@ -57,4 +71,26 @@ public class IndexValCensusVo implements Serializable {
 
     @ApiModelProperty(value = "在建污水厂总数")
     private Integer buildSewageStationNum;
+
+    @ApiModelProperty(value = "公司总数")
+    private Integer deptCount;
+
+    @ApiModelProperty(value = "人员总数")
+    private Integer userCount;
+
+    @ApiModelProperty(value = "污水厂总数")
+    private Integer sewageCount;
+
+    @ApiModelProperty(value = "污泥厂总数")
+    private Integer sludgeCount;
+
+    @ApiModelProperty(value = "泵站总数")
+    private Integer pumpCount;
+
+    @ApiModelProperty(value = "设备总数")
+    private Integer deviceCount;
+
+    @ApiModelProperty(value = "污水厂指标报警总数列表")
+    private List<Map<String, Object>> sewageReportNumList;
+
 }

+ 13 - 1
snws-monitor/snws-monitor-boot/src/main/java/com/tofly/monitor/screenDisplay/mapper/CustomDisplayMapper.java

@@ -48,7 +48,7 @@ public interface CustomDisplayMapper {
 
     Map<String, Object> getIndexValThisM(@Param("stationIds") Set<Long> stationIds);
 
-    Map<String, Object> getIndexValTotal(@Param("censusYear") String censusYear, @Param("censusMonth") String censusMonth, @Param("stationIds") Set<Long> stationIds);
+    Map<String, Object> getIndexValTotal(@Param("startMonth") String startMonth, @Param("endMonth") String endMonth, @Param("censusYear") String censusYear, @Param("censusMonth") String censusMonth, @Param("stationIds") Set<Long> stationIds);
 
     List<TfDayStatistics> getIndexValGroupM(WisdomDisplayDto wis);
 
@@ -94,6 +94,8 @@ public interface CustomDisplayMapper {
 
     Double getFillStcDayTotal(@Param("censusDay") String censusDay, @Param("censusMonth") String censusMonth, @Param("censusQuarter") String censusQuarter, @Param("stationIds") Set<Long> stationIds);
 
+    Double getFillSludgeDayTotal(@Param("censusDay") String censusDay, @Param("censusMonth") String censusMonth, @Param("censusQuarter") String censusQuarter, @Param("stationIds") Set<Long> stationIds);
+
     List<TfDayStatistics> getFillIndexValSludgeDay(WisdomDisplayDto wisdomDisplayDto);
 
     List<TfDayStatistics> getFillIndexValEcDay(WisdomDisplayDto wisdomDisplayDto);
@@ -106,4 +108,14 @@ public interface CustomDisplayMapper {
 
     List<TfDayStatistics> getFillIndexValYear(WisdomDisplayDto wisdomDisplayDto);
 
+    Integer getDeptUserCount(@Param("deptIdList") List<Long> deptIdList);
+
+    Integer getDeptSewageCount(@Param("category") String category, @Param("deptIdList") List<Long> deptIdList);
+
+    Integer getDeptPumpCount(@Param("deptIdList") List<Long> deptIdList);
+
+    Integer viewSewageDeviceNum(@Param("stationIds") Set<Long> stationIds, @Param("category") Long category);
+
+    List<Map<String, Object>> viewSewageReportNum(@Param("stationIds") Set<Long> stationIds, @Param("censusDay") String censusDay);
+
 }

+ 86 - 5
snws-monitor/snws-monitor-boot/src/main/java/com/tofly/monitor/screenDisplay/service/impl/CustomDisplayServiceImpl.java

@@ -387,10 +387,15 @@ public class CustomDisplayServiceImpl implements CustomDisplayService {
 
     @Override
     public IndexValCensusVo indexValCensus(Long deptId, Long category) {
+        IndexValCensusVo vo = new IndexValCensusVo();
         Set<Long> stationIds = null;
         if (deptId != null && category != null) {
             List<Long> deptIdList = departmentClient.getDepartmentPage(deptId,"1").getResult()
                     .stream().map(Department::getId).collect(Collectors.toList());
+            vo.setUserCount(customDisplayMapper.getDeptUserCount(deptIdList));
+            vo.setSewageCount(customDisplayMapper.getDeptSewageCount("1", deptIdList));
+            vo.setSludgeCount(customDisplayMapper.getDeptSewageCount("2", deptIdList));
+            vo.setPumpCount(customDisplayMapper.getDeptPumpCount(deptIdList));
             if (category == 50701) {
                 List<TfDeptSewage> deptSewages = deptSewageService.list(new QueryWrapper<TfDeptSewage>()
                         .lambda().in(TfDeptSewage::getDeptId, deptIdList));
@@ -408,10 +413,18 @@ public class CustomDisplayServiceImpl implements CustomDisplayService {
                 stationIds = new HashSet<>();
                 stationIds.add(1000000000000000000L);
             }
+
+            List<Department> deptCounts = departmentClient.getDepartmentPage(deptId,"0").getResult();
+            if (CollUtil.isNotEmpty(deptCounts)) {
+                vo.setDeptCount(deptCounts.size());
+            } else {
+                vo.setDeptCount(0);
+            }
         }
-        IndexValCensusVo vo = new IndexValCensusVo();
+
         BigDecimal sewageWaterLastM = new BigDecimal(String.valueOf(customDisplayMapper.getIndexValLastM(stationIds).get("sewageWater")));
         BigDecimal sewageWaterThisM = BigDecimal.valueOf(customDisplayMapper.getFillStcDayTotal(null, DateUtil.format(new Date(), "yyyy-MM"), null, stationIds));
+        BigDecimal sludgeHandleThisM = BigDecimal.valueOf(customDisplayMapper.getFillSludgeDayTotal(null, DateUtil.format(new Date(), "yyyy-MM"), null, stationIds));
         BigDecimal sewageWaterToday = BigDecimal.valueOf(customDisplayMapper.getFillStcDayTotal(DateUtil.format(new Date(), "yyyy-MM-dd"), null, null, stationIds));
         vo.setSewageWaterToday(sewageWaterToday);
 
@@ -433,24 +446,42 @@ public class CustomDisplayServiceImpl implements CustomDisplayService {
         c.add(Calendar.DATE, +1);
         String thisYear = sdfYear.format(c.getTime());
         String thisYearMonth = sdfMonth.format(c.getTime());
-        BigDecimal sewageWaterThisY = new BigDecimal(String.valueOf(customDisplayMapper.getIndexValTotal(thisYear, null, stationIds).get("sewageWater")));
-        BigDecimal sewageWaterThisYM = new BigDecimal(String.valueOf(customDisplayMapper.getIndexValTotal(null, thisYearMonth, stationIds).get("sewageWater")));
+        BigDecimal sewageWaterThisY = new BigDecimal(String.valueOf(customDisplayMapper.getIndexValTotal(null, null, thisYear, null, stationIds).get("sewageWater")));
+        BigDecimal sludgeHandleThisY = new BigDecimal(String.valueOf(customDisplayMapper.getIndexValTotal(null, null, thisYear, null, stationIds).get("sludgeHandle")));
+        BigDecimal sewageWaterThisYM = new BigDecimal(String.valueOf(customDisplayMapper.getIndexValTotal(null, null, null, thisYearMonth, stationIds).get("sewageWater")));
         c.add(Calendar.YEAR, -1);
         String lastYear = sdfYear.format(c.getTime());
         String lastYearMonth  = sdfMonth.format(c.getTime());
-        BigDecimal sewageWaterLastY = new BigDecimal(String.valueOf(customDisplayMapper.getIndexValTotal(lastYear, null, stationIds).get("sewageWater")));
-        BigDecimal sewageWaterLastYM = new BigDecimal(String.valueOf(customDisplayMapper.getIndexValTotal(null, lastYearMonth, stationIds).get("sewageWater")));
+        BigDecimal sewageWaterLastY = new BigDecimal(String.valueOf(customDisplayMapper.getIndexValTotal(null, null, lastYear, null, stationIds).get("sewageWater")));
+        BigDecimal sewageWaterLastYM = new BigDecimal(String.valueOf(customDisplayMapper.getIndexValTotal(null, null, null, lastYearMonth, stationIds).get("sewageWater")));
         vo.setSewageWaterLastM(sewageWaterLastM);
         vo.setSewageWaterThisM(sewageWaterThisM);
+        vo.setSludgeHandleThisM(sludgeHandleThisM);
         vo.setSewageWaterLastY(sewageWaterLastY);
         vo.setAvgSewageWater(sewageWaterLastY.divide(BigDecimal.valueOf(365), 2, RoundingMode.HALF_UP).doubleValue());
         vo.setSewageWaterThisY(sewageWaterThisY);
+        vo.setSludgeHandleThisY(sludgeHandleThisY);
         vo.setSewageWaterPropY(getIndexValRate(sewageWaterLastM,sewageWaterThisYM));
         vo.setYearOnYearSewageWaterRate(getYoyOrMomRate(sewageWaterThisYM,sewageWaterLastYM));
         vo.setLinkRatioSewageWaterRate(getYoyOrMomRate(sewageWaterThisM,sewageWaterLastM));
         vo.setDesignSewageWaterAll(customDisplayMapper.getDesignSewageWaterAll(stationIds));
         vo.setBuildSewageStationNum(customDisplayMapper.getSewageStationNum("1", stationIds));
         vo.setOperateSewageStationNum(customDisplayMapper.getSewageStationNum("0", stationIds));
+
+        // 计算年度污水污泥处理量同比
+        Calendar calendar = Calendar.getInstance();
+        calendar.add(Calendar.YEAR, -1);
+        calendar.add(Calendar.MONTH, -1);
+        String endTime = DateUtil.format(calendar.getTime(), "yyyy-MM");
+        calendar.set(Calendar.MONTH, 1);
+        String startTime = DateUtil.format(calendar.getTime(), "yyyy-MM");
+        BigDecimal sewageWaterLast = new BigDecimal(String.valueOf(customDisplayMapper.getIndexValTotal(startTime, endTime, null, null, stationIds).get("sewageWater")));
+        BigDecimal sludgeHandleLast = new BigDecimal(String.valueOf(customDisplayMapper.getIndexValTotal(startTime, endTime, null, null, stationIds).get("sludgeHandle")));
+        vo.setSewageWaterThisYYoY(getYoyOrMomRate(sewageWaterThisY,sewageWaterLast));
+        vo.setSludgeHandleThisYYOY(getYoyOrMomRate(sludgeHandleThisY,sludgeHandleLast));
+
+        vo.setSewageReportNumList(customDisplayMapper.viewSewageReportNum(stationIds, DateUtil.format(new Date(), "yyyy-MM-dd")));
+        vo.setDeviceCount(customDisplayMapper.viewSewageDeviceNum(stationIds, category));
         return vo;
     }
 
@@ -472,6 +503,7 @@ public class CustomDisplayServiceImpl implements CustomDisplayService {
             info.setEnergy(0.0);
             info.setSludgeHandle(0.0);
             info.setSludgeWaterRate(0f);
+            info.setSludgeDispose(0.0);
             info.setSewageWater(0.0);
             info.setEnergyWater(0.0);
             info.setEnergyWaterThousand(0.0);
@@ -483,6 +515,7 @@ public class CustomDisplayServiceImpl implements CustomDisplayService {
                 info.setSludgeHandle(dayStatisticsFinal.get(0).getSludgeHandle());
                 info.setEnergy(dayStatisticsFinal.get(0).getEnergy());
                 info.setSludgeWaterRate(dayStatisticsFinal.get(0).getSludgeWaterRate());
+                info.setSludgeDispose(dayStatisticsFinal.get(0).getSludgeDispose());
             }
             if (info.getSewageWater() != null && info.getEnergy() != null && info.getSewageWater() != 0) {
                 BigDecimal energy = BigDecimal.valueOf(info.getEnergy());
@@ -591,6 +624,22 @@ public class CustomDisplayServiceImpl implements CustomDisplayService {
                         info.setEnergyMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getEnergy()), BigDecimal.valueOf(statistics.getEnergy())));
                         info.setEnergyWaterMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getEnergyWater()), BigDecimal.valueOf(statistics.getEnergyWater())));
                         info.setEnergySludgeMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getEnergySludge()), BigDecimal.valueOf(statistics.getEnergySludge())));
+
+                        info.setInCumulativeFlowMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getInCumulativeFlow()), BigDecimal.valueOf(statistics.getInCumulativeFlow())));
+                        info.setInCodMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getInCod()), BigDecimal.valueOf(statistics.getInCod())));
+                        info.setInSsMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getInSs()), BigDecimal.valueOf(statistics.getInSs())));
+                        info.setInNh3nMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getInNh3n()), BigDecimal.valueOf(statistics.getInNh3n())));
+                        info.setInPhMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getInPh()), BigDecimal.valueOf(statistics.getInPh())));
+                        info.setInTnMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getInTn()), BigDecimal.valueOf(statistics.getInTn())));
+                        info.setInTpMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getInTp()), BigDecimal.valueOf(statistics.getInTp())));
+
+                        info.setOutCumulativeFlowMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getOutCumulativeFlow()), BigDecimal.valueOf(statistics.getOutCumulativeFlow())));
+                        info.setOutCodMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getOutCod()), BigDecimal.valueOf(statistics.getOutCod())));
+                        info.setOutSsMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getOutSs()), BigDecimal.valueOf(statistics.getOutSs())));
+                        info.setOutNh3nMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getOutNh3n()), BigDecimal.valueOf(statistics.getOutNh3n())));
+                        info.setOutPhMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getOutPh()), BigDecimal.valueOf(statistics.getOutPh())));
+                        info.setOutTnMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getOutTn()), BigDecimal.valueOf(statistics.getOutTn())));
+                        info.setOutTpMoM(getYoyOrMomRate(BigDecimal.valueOf(info.getOutTp()), BigDecimal.valueOf(statistics.getOutTp())));
                     }
                     // 计算同比
                     calendar.add(Calendar.YEAR, -1);
@@ -609,6 +658,22 @@ public class CustomDisplayServiceImpl implements CustomDisplayService {
                     info.setEnergyYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getEnergy()), BigDecimal.valueOf(statistics.getEnergy())));
                     info.setEnergyWaterYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getEnergyWater()), BigDecimal.valueOf(statistics.getEnergyWater())));
                     info.setEnergySludgeYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getEnergySludge()), BigDecimal.valueOf(statistics.getEnergySludge())));
+
+                    info.setInCumulativeFlowYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInCumulativeFlow()), BigDecimal.valueOf(statistics.getInCumulativeFlow())));
+                    info.setInCodYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInCod()), BigDecimal.valueOf(statistics.getInCod())));
+                    info.setInSsYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInSs()), BigDecimal.valueOf(statistics.getInSs())));
+                    info.setInNh3nYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInNh3n()), BigDecimal.valueOf(statistics.getInNh3n())));
+                    info.setInPhYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInPh()), BigDecimal.valueOf(statistics.getInPh())));
+                    info.setInTnYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInTn()), BigDecimal.valueOf(statistics.getInTn())));
+                    info.setInTpYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInTp()), BigDecimal.valueOf(statistics.getInTp())));
+
+                    info.setOutCumulativeFlowYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutCumulativeFlow()), BigDecimal.valueOf(statistics.getOutCumulativeFlow())));
+                    info.setOutCodYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutCod()), BigDecimal.valueOf(statistics.getOutCod())));
+                    info.setOutSsYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutSs()), BigDecimal.valueOf(statistics.getOutSs())));
+                    info.setOutNh3nYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutNh3n()), BigDecimal.valueOf(statistics.getOutNh3n())));
+                    info.setOutPhYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutPh()), BigDecimal.valueOf(statistics.getOutPh())));
+                    info.setOutTnYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutTn()), BigDecimal.valueOf(statistics.getOutTn())));
+                    info.setOutTpYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutTp()), BigDecimal.valueOf(statistics.getOutTp())));
                 });
                 break;
 //            case "3":// 季
@@ -641,6 +706,22 @@ public class CustomDisplayServiceImpl implements CustomDisplayService {
                     info.setEnergyYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getEnergy()), BigDecimal.valueOf(statistics.getEnergy())));
                     info.setEnergyWaterYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getEnergyWater()), BigDecimal.valueOf(statistics.getEnergyWater())));
                     info.setEnergySludgeYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getEnergySludge()), BigDecimal.valueOf(statistics.getEnergySludge())));
+
+                    info.setInCumulativeFlowYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInCumulativeFlow()), BigDecimal.valueOf(statistics.getInCumulativeFlow())));
+                    info.setInCodYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInCod()), BigDecimal.valueOf(statistics.getInCod())));
+                    info.setInSsYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInSs()), BigDecimal.valueOf(statistics.getInSs())));
+                    info.setInNh3nYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInNh3n()), BigDecimal.valueOf(statistics.getInNh3n())));
+                    info.setInPhYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInPh()), BigDecimal.valueOf(statistics.getInPh())));
+                    info.setInTnYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInTn()), BigDecimal.valueOf(statistics.getInTn())));
+                    info.setInTpYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getInTp()), BigDecimal.valueOf(statistics.getInTp())));
+
+                    info.setOutCumulativeFlowYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutCumulativeFlow()), BigDecimal.valueOf(statistics.getOutCumulativeFlow())));
+                    info.setOutCodYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutCod()), BigDecimal.valueOf(statistics.getOutCod())));
+                    info.setOutSsYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutSs()), BigDecimal.valueOf(statistics.getOutSs())));
+                    info.setOutNh3nYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutNh3n()), BigDecimal.valueOf(statistics.getOutNh3n())));
+                    info.setOutPhYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutPh()), BigDecimal.valueOf(statistics.getOutPh())));
+                    info.setOutTnYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutTn()), BigDecimal.valueOf(statistics.getOutTn())));
+                    info.setOutTpYoY(getYoyOrMomRate(BigDecimal.valueOf(info.getOutTp()), BigDecimal.valueOf(statistics.getOutTp())));
                 });
                 break;
         }

+ 136 - 12
snws-monitor/snws-monitor-boot/src/main/resources/mapper/screenDisplay/CustomDisplayMapper.xml

@@ -617,13 +617,12 @@
     </select>
 
     <select id="getIndexValThisM" resultType="map">
-        select ISNULL(SUM ( convert(decimal(18, 5), a.MONTH_DEAL_WQ) ), 0) sewage_Water
-        from tf_fill_month_w a
-        left join tf_ywpn_monitor_stationsiteinfo_w b on a.BELONG_STATION_ID = b.id
+        select ISNULL(SUM ( convert(decimal(18, 5), MONTH_DEAL_WQ) ), 0) sewage_Water
+        from tf_fill_month_w
         WHERE
-            DATEDIFF(month, a.RECORD_TIME, GETDATE()) = 0
+            DATEDIFF(month, RECORD_TIME, GETDATE()) = 0
         <if test="stationIds != null">
-            AND a.BELONG_STATION_ID in
+            AND BELONG_STATION_ID in
             <foreach item="item" index="index" collection="stationIds" separator="," open="(" close=")">
                 #{item}
             </foreach>
@@ -631,19 +630,22 @@
     </select>
 
     <select id="getIndexValTotal" resultType="map">
-        select ISNULL(SUM ( convert(decimal(18, 5), a.MONTH_DEAL_WQ) ), 0) sewage_Water
-        from tf_fill_month_w a
-        left join tf_ywpn_monitor_stationsiteinfo_w b on a.BELONG_STATION_ID = b.id
+        select  ISNULL(SUM ( convert(decimal(18, 5), MONTH_DEAL_WQ) ), 0) sewage_Water,
+                ISNULL(SUM ( convert(decimal(18, 5), MONTH_DS_PC) ), 0) sludge_handle
+        from tf_fill_month_w
         WHERE
             1=1
         <if test="censusMonth != null and censusMonth.trim() != ''">
-            AND datename(yyyy, a.RECORD_TIME)+ '-' + datename(m, a.RECORD_TIME) = #{censusMonth}
+            AND datename(yyyy, RECORD_TIME)+ '-' + datename(m, RECORD_TIME) = #{censusMonth}
         </if>
         <if test="censusYear != null and censusYear.trim() != ''">
-            AND datename(yyyy, a.RECORD_TIME) = #{censusYear}
+            AND datename(yyyy, RECORD_TIME) = #{censusYear}
+        </if>
+        <if test="startMonth != null and endMonth.trim() != ''">
+            AND datename(yyyy, RECORD_TIME)+ '-' + datename(m, RECORD_TIME) between #{startMonth} and #{endMonth}
         </if>
         <if test="stationIds != null">
-            AND b.id in
+            AND BELONG_STATION_ID in
             <foreach item="item" index="index" collection="stationIds" separator="," open="(" close=")">
                 #{item}
             </foreach>
@@ -1139,6 +1141,28 @@
         ORDER BY scada_Time
     </select>
 
+    <select id="getFillSludgeDayTotal" resultType="Double">
+        select  ISNULL(SUM ( convert(decimal(18, 5), DAY_SLUDGE_DEHYDRATION) ), 0) sludge_Handle
+        from tf_fill_sludge_deal_w
+        WHERE
+        1=1
+        <if test="censusDay != null and censusDay.trim() != ''">
+            AND CONVERT(VARCHAR(100), RECORD_TIME, 23) = #{censusDay}
+        </if>
+        <if test="censusMonth != null and censusMonth.trim() != ''">
+            AND datename(yyyy,RECORD_TIME) + '-' + datename(m,RECORD_TIME) = #{censusMonth}
+        </if>
+        <if test="censusQuarter != null and censusQuarter.trim() != ''">
+            AND datename(yyyy,RECORD_TIME) + '-' + datename(q,RECORD_TIME) = #{censusQuarter}
+        </if>
+        <if test="stationIds != null">
+            AND BELONG_STATION_ID in
+            <foreach item="item" index="index" collection="stationIds" separator="," open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+    </select>
+
     <select id="getFillIndexValEcDay" resultType="com.tofly.monitor.screenDisplay.entity.TfDayStatistics">
         select  CONVERT(VARCHAR(100), a.RECORD_TIME, 20) scada_Time,
                 f.ID station_Id,
@@ -1175,13 +1199,20 @@
                 ISNULL(SUM ( convert(decimal(18, 5), MONTH_DEAL_WQ) ), 0) sewage_Water,
                 ISNULL(SUM ( convert(decimal(18, 5), MONTH_EC) ), 0) energy,
                 ISNULL(SUM ( convert(decimal(18, 5), MONTH_DS_PC) ), 0) sludge_Handle,
-                case WHEN(ISNULL(COUNT(*), 0)) != 0 THEN round(SUM( convert(decimal(18, 5), PC_CUT_RATE) ) / COUNT(*),2) ELSE 0 END sludge_Water_Rate
+                case WHEN(ISNULL(COUNT(*), 0)) != 0 THEN round(SUM( convert(decimal(18, 5), PC_CUT_RATE) ) / COUNT(*),2) ELSE 0 END sludge_Water_Rate,
+                ISNULL(SUM ( convert(decimal(18, 5), MONTH_PC) ), 0) sludge_Dispose
         from tf_fill_month_w
         WHERE
         1=1
         <if test="startDate != null and endDate != null">
             AND datename(yyyy,RECORD_TIME) + '-' + datename(m,RECORD_TIME) between #{startDate} and #{endDate}
         </if>
+        <if test="deptStationIds != null">
+            AND BELONG_STATION_ID in
+            <foreach item="item" index="index" collection="deptStationIds" separator="," open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
         GROUP BY datename(yyyy,RECORD_TIME) + '-' + datename(m,RECORD_TIME)
         ORDER BY scada_Time
     </select>
@@ -1220,4 +1251,97 @@
         ORDER BY scada_Time
     </select>
 
+    <select id="getDeptUserCount" resultType="Integer">
+        select COUNT (*)
+        from tf_smpn_user_x
+        WHERE
+            1=1
+        <if test="deptIdList != null">
+            AND DEPARTMENT_ID in
+            <foreach item="item" index="index" collection="deptIdList" separator="," open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+    </select>
+
+    <select id="getDeptSewageCount" resultType="Integer">
+        select COUNT (*)
+        from tf_ywpn_monitor_stationsiteinfo_w a
+        left join tf_dept_sewage b on a.id = b.SEWAGE_STATION_ID
+        WHERE
+            1=1
+        <if test="category != null and category.trim() != ''">
+            AND a.category = #{category}
+        </if>
+        <if test="deptIdList != null">
+            AND b.DEPT_ID in
+            <foreach item="item" index="index" collection="deptIdList" separator="," open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+    </select>
+
+    <select id="getDeptPumpCount" resultType="Integer">
+        select COUNT (*)
+        from tf_monitor_pump_station_w a
+        left join tf_dept_pump b on a.id = b.PUMP_STATION_ID
+        WHERE
+            1=1
+        <if test="deptIdList != null">
+            AND b.DEPT_ID in
+            <foreach item="item" index="index" collection="deptIdList" separator="," open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+    </select>
+
+    <select id="viewSewageReportNum" resultType="map">
+        select ISNULL(SUM ( convert(decimal(18, 5), a.ERROR_COUNT) ), 0) report_Num,
+               f.id sewage_id,
+               f.name sewage_name
+        from STATISTICS_SCADA a
+        LEFT JOIN tf_ywpn_monitor_index_w b ON b.code = a.CODE
+        LEFT JOIN tf_ywpn_device_index_w c ON b.id = c.index_id
+        LEFT JOIN tf_ywpn_monitor_device_w g ON g.id = c.device_id
+        LEFT JOIN tf_ywpn_monitor_stationsiteinfo_w f ON f.id = g.belong_station_id
+        WHERE
+            g.del_flag = '0'
+            and f.del_flag = '0'
+            and (g.name like CONCAT ('%','出口','%')
+                or g.name like CONCAT ('%','入口','%'))
+        <if test="stationIds != null">
+            AND f.id in
+            <foreach item="item" index="index" collection="stationIds" separator="," open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="censusDay != null and censusDay.trim() != ''">
+            AND CONVERT(VARCHAR(100), a.START_TIME, 23) = #{censusDay}
+        </if>
+        GROUP BY f.id,f.name
+    </select>
+
+    <select id="viewSewageDeviceNum" resultType="Integer">
+        select COUNT (*)
+        from tf_ywpn_monitor_device_w
+        WHERE
+            del_flag = '0'
+        <if test="category != null and stationIds != null">
+            <choose>
+                <when test='category == 50701'>
+                    AND belong_station_id in
+                    <foreach item="item" index="index" collection="stationIds" separator="," open="(" close=")">
+                        #{item}
+                    </foreach>
+                </when>
+                <when test='category == 50702'>
+                    AND belong_pump_id in
+                    <foreach item="item" index="index" collection="stationIds" separator="," open="(" close=")">
+                        #{item}
+                    </foreach>
+                </when>
+            </choose>
+        </if>
+    </select>
+
 </mapper>