Explorar el Código

修改停机记录列表接口

shilin hace 4 años
padre
commit
0d47ce5887
Se han modificado 23 ficheros con 687 adiciones y 187 borrados
  1. 1 1
      src/main/java/com/gyee/frame/controller/powersaturation/PowerSaturationAmonutController.java
  2. 11 4
      src/main/java/com/gyee/frame/controller/singleanalysis/SingleAnalysisController.java
  3. 9 1
      src/main/java/com/gyee/frame/mapper/auto/InputoroutputspeedtotalMapper.java
  4. 8 0
      src/main/java/com/gyee/frame/mapper/auto/WindTurbineInfoDay2Mapper.java
  5. 9 1
      src/main/java/com/gyee/frame/mapper/auto/WindTurbineInfoDayMapper.java
  6. 5 1
      src/main/java/com/gyee/frame/mapper/auto/WindturbinecurvefittingMapper.java
  7. 10 1
      src/main/java/com/gyee/frame/mapper/auto/Windturbineinfoday3Mapper.java
  8. 5 0
      src/main/java/com/gyee/frame/mapper/auto/WindturbinethewindinfoMapper.java
  9. 37 1
      src/main/java/com/gyee/frame/service/InputoroutputspeedtotalService.java
  10. 35 0
      src/main/java/com/gyee/frame/service/WindTurbineInfoDay2Service.java
  11. 14 0
      src/main/java/com/gyee/frame/service/WindturbinecurvefittingService.java
  12. 34 0
      src/main/java/com/gyee/frame/service/Windturbineinfoday3Service.java
  13. 38 1
      src/main/java/com/gyee/frame/service/WindturbineinfodayService.java
  14. 19 0
      src/main/java/com/gyee/frame/service/WindturbinethewindinfoService.java
  15. 245 137
      src/main/java/com/gyee/frame/service/singleanalysis/SingleAnalysisService.java
  16. 18 0
      src/main/resources/mybatis/auto/InputoroutputspeedtotalMapper.xml
  17. 15 0
      src/main/resources/mybatis/auto/WindTurbineInfoDay2Mapper.xml
  18. 30 0
      src/main/resources/mybatis/auto/WindTurbineInfoDayMapper.xml
  19. 8 0
      src/main/resources/mybatis/auto/WindturbinecurvefittingMapper.xml
  20. 18 0
      src/main/resources/mybatis/auto/Windturbineinfoday3Mapper.xml
  21. 9 0
      src/main/resources/mybatis/auto/WindturbinethewindinfoMapper.xml
  22. 91 0
      src/test/java/test/PowerSaturationTest.java
  23. 18 39
      src/test/java/test/SingleAnalysisTest.java

+ 1 - 1
src/main/java/com/gyee/frame/controller/powersaturation/PowerSaturationAmonutController.java

@@ -58,7 +58,7 @@ public class PowerSaturationAmonutController {
         if (StringUtils.notEmp(wtId) )
         {
 
-            List<Windturbinecurvefitting> wcls=windturbinecurvefittingService.getWindturbinecurvefitting(wtId);
+            List<Windturbinecurvefitting> wcls=windturbinecurvefittingService.getWindturbinecurvefittingByWtId(wtId);
 
             if (!wcls.isEmpty()) {
 //				Collections.sort(wcls, new Comparator<Windturbinepowercurvefitting>() {

+ 11 - 4
src/main/java/com/gyee/frame/controller/singleanalysis/SingleAnalysisController.java

@@ -34,12 +34,13 @@ public class SingleAnalysisController {
             cal.set(Calendar.HOUR_OF_DAY, 0);
             cal.set(Calendar.MINUTE, 0);
             cal.set(Calendar.SECOND, 0);
+            cal.set(Calendar.MILLISECOND,0);
 
             cal.set(Calendar.YEAR, Integer.valueOf(year));
             cal.set(Calendar.MONTH, Integer.valueOf(month) - 1);
             cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
             Date beginDate = cal.getTime();
-            cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
+            cal.add(Calendar.MONTH, 1);
             Date endDate = cal.getTime();
 
             vos =singleAnalysisService.SingleAnalysisList(tablepar, wpId,beginDate,endDate);
@@ -67,22 +68,28 @@ public class SingleAnalysisController {
             cal.set(Calendar.HOUR_OF_DAY, 0);
             cal.set(Calendar.MINUTE, 0);
             cal.set(Calendar.SECOND, 0);
+            cal.set(Calendar.MILLISECOND,0);
 
             cal.set(Calendar.YEAR, Integer.valueOf(year));
             cal.set(Calendar.MONTH, Integer.valueOf(month) - 1);
             cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
             Date beginDate = cal.getTime();
-            cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
+            cal.add(Calendar.MONTH, 1);
             Date endDate = cal.getTime();
 
+
             SingleAnalysisVo  byzb =singleAnalysisService.SingleAnalysisListByWtId(wtId,beginDate,endDate);
-            cal.set(Calendar.YEAR, Integer.valueOf(year)-1);
+
+
+            cal.set(Calendar.YEAR, Integer.valueOf(year));
             cal.set(Calendar.MONTH, Integer.valueOf(month) - 1);
+            cal.add(Calendar.YEAR, -1);
             cal.set(Calendar.DAY_OF_MONTH, cal.getActualMinimum(Calendar.DAY_OF_MONTH));
             beginDate = cal.getTime();
-            cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
+            cal.add(Calendar.MONTH, 1);
             endDate = cal.getTime();
 
+
             SingleAnalysisVo  tqzb =singleAnalysisService.SingleAnalysisListByWtId(wtId,beginDate,endDate);
 
             SingleAnalysisVo  tbzb =singleAnalysisService.SingleAnalysisListByWtId(byzb,tqzb);

+ 9 - 1
src/main/java/com/gyee/frame/mapper/auto/InputoroutputspeedtotalMapper.java

@@ -2,9 +2,12 @@ package com.gyee.frame.mapper.auto;
 
 import com.gyee.frame.model.auto.Inputoroutputspeedtotal;
 import com.gyee.frame.model.auto.InputoroutputspeedtotalExample;
-import java.util.List;
+import com.gyee.frame.model.custom.SingleAnalysisVo;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.Date;
+import java.util.List;
+
 public interface InputoroutputspeedtotalMapper {
     /**
      * This method was generated by MyBatis Generator.
@@ -93,4 +96,9 @@ public interface InputoroutputspeedtotalMapper {
      * @mbg.generated
      */
     int updateByPrimaryKey(Inputoroutputspeedtotal record);
+
+    List<SingleAnalysisVo> getInputoroutputspeedtotal(@Param("wpId") String wpId, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+
+    List<SingleAnalysisVo> getInputoroutputspeedtotalByWtId(@Param("wtId") String wtId, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+
 }

+ 8 - 0
src/main/java/com/gyee/frame/mapper/auto/WindTurbineInfoDay2Mapper.java

@@ -2,8 +2,10 @@ package com.gyee.frame.mapper.auto;
 
 import com.gyee.frame.model.auto.WindTurbineInfoDay2;
 import com.gyee.frame.model.auto.WindTurbineInfoDay2Example;
+import com.gyee.frame.model.custom.SingleAnalysisVo;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.Date;
 import java.util.List;
 
 public interface WindTurbineInfoDay2Mapper {
@@ -94,4 +96,10 @@ public interface WindTurbineInfoDay2Mapper {
      * @mbg.generated
      */
     int updateByPrimaryKey(WindTurbineInfoDay2 record);
+
+    List<SingleAnalysisVo> getWindTurbineInfoDay2(@Param("wpId") String wpId, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+
+    List<SingleAnalysisVo> getWindTurbineInfoDay2ByWtId(@Param("wtId") String wtId, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+
+
 }

+ 9 - 1
src/main/java/com/gyee/frame/mapper/auto/WindTurbineInfoDayMapper.java

@@ -2,9 +2,12 @@ package com.gyee.frame.mapper.auto;
 
 import com.gyee.frame.model.auto.WindTurbineInfoDay;
 import com.gyee.frame.model.auto.WindTurbineInfoDayExample;
-import java.util.List;
+import com.gyee.frame.model.custom.SingleAnalysisVo;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.Date;
+import java.util.List;
+
 public interface WindTurbineInfoDayMapper {
     /**
      * This method was generated by MyBatis Generator.
@@ -93,4 +96,9 @@ public interface WindTurbineInfoDayMapper {
      * @mbg.generated
      */
     int updateByPrimaryKey(WindTurbineInfoDay record);
+
+    List<SingleAnalysisVo> getWindTurbineInfoDay(@Param("wpId") String wpId, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+
+    List<SingleAnalysisVo> getWindTurbineInfoDayByWtId(@Param("wtId") String wtId, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+
 }

+ 5 - 1
src/main/java/com/gyee/frame/mapper/auto/WindturbinecurvefittingMapper.java

@@ -2,9 +2,10 @@ package com.gyee.frame.mapper.auto;
 
 import com.gyee.frame.model.auto.Windturbinecurvefitting;
 import com.gyee.frame.model.auto.WindturbinecurvefittingExample;
-import java.util.List;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 public interface WindturbinecurvefittingMapper {
     /**
      * This method was generated by MyBatis Generator.
@@ -93,4 +94,7 @@ public interface WindturbinecurvefittingMapper {
      * @mbg.generated
      */
     int updateByPrimaryKey(Windturbinecurvefitting record);
+
+    List<Windturbinecurvefitting> getWindturbinecurvefittingByWtId(@Param("wtId") String wtId);
+
 }

+ 10 - 1
src/main/java/com/gyee/frame/mapper/auto/Windturbineinfoday3Mapper.java

@@ -2,9 +2,12 @@ package com.gyee.frame.mapper.auto;
 
 import com.gyee.frame.model.auto.Windturbineinfoday3;
 import com.gyee.frame.model.auto.Windturbineinfoday3Example;
-import java.util.List;
+import com.gyee.frame.model.custom.SingleAnalysisVo;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.Date;
+import java.util.List;
+
 public interface Windturbineinfoday3Mapper {
     /**
      * This method was generated by MyBatis Generator.
@@ -93,4 +96,10 @@ public interface Windturbineinfoday3Mapper {
      * @mbg.generated
      */
     int updateByPrimaryKey(Windturbineinfoday3 record);
+
+
+    List<SingleAnalysisVo> getWindTurbineInfoDay3(@Param("wpId") String wpId, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+
+    List<SingleAnalysisVo> getWindTurbineInfoDay3ByWtId(@Param("wtId") String wtId, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+
 }

+ 5 - 0
src/main/java/com/gyee/frame/mapper/auto/WindturbinethewindinfoMapper.java

@@ -2,8 +2,10 @@ package com.gyee.frame.mapper.auto;
 
 import com.gyee.frame.model.auto.Windturbinethewindinfo;
 import com.gyee.frame.model.auto.WindturbinethewindinfoExample;
+import com.gyee.frame.model.custom.SingleAnalysisVo;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.Date;
 import java.util.List;
 
 public interface WindturbinethewindinfoMapper {
@@ -94,4 +96,7 @@ public interface WindturbinethewindinfoMapper {
      * @mbg.generated
      */
     int updateByPrimaryKey(Windturbinethewindinfo record);
+
+    List<SingleAnalysisVo> getWindturbinethewindinfoByWtId(@Param("wtId") String wtId, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+
 }

+ 37 - 1
src/main/java/com/gyee/frame/service/InputoroutputspeedtotalService.java

@@ -5,6 +5,7 @@ import com.gyee.frame.common.support.Convert;
 import com.gyee.frame.mapper.auto.InputoroutputspeedtotalMapper;
 import com.gyee.frame.model.auto.Inputoroutputspeedtotal;
 import com.gyee.frame.model.auto.InputoroutputspeedtotalExample;
+import com.gyee.frame.model.custom.SingleAnalysisVo;
 import com.gyee.frame.model.custom.Tablepar;
 import com.gyee.frame.util.DateUtils;
 import com.gyee.frame.util.StringUtils;
@@ -169,7 +170,7 @@ public class InputoroutputspeedtotalService implements BaseService<Inputoroutput
 		if (StringUtils.notEmp(wpId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
 
 			InputoroutputspeedtotalExample example = new InputoroutputspeedtotalExample();
-			example.setOrderByClause(" windturbineidasc");
+			example.setOrderByClause(" windturbineid asc");
 
 			InputoroutputspeedtotalExample.Criteria criteria =example.createCriteria();
 			criteria.andWindpowerstationidEqualTo(wpId);
@@ -245,4 +246,39 @@ public class InputoroutputspeedtotalService implements BaseService<Inputoroutput
 		return list;
 
 	}
+
+	public List<SingleAnalysisVo>  getInputoroutputspeedtotalMapper(String wpId,Date beginDate,Date endDate) {
+
+		List<SingleAnalysisVo>   list =  new ArrayList<>();
+
+
+		if (StringUtils.notEmp(wpId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
+
+
+			list = inputoroutputspeedtotalMapper.getInputoroutputspeedtotal(wpId,beginDate,endDate);
+
+
+		}
+		return list;
+
+	}
+
+
+	public List<SingleAnalysisVo>  getInputoroutputspeedtotalMapperByWtId(String wtId,Date beginDate,Date endDate) {
+
+		List<SingleAnalysisVo>   list =  new ArrayList<>();
+
+
+		if (StringUtils.notEmp(wtId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
+
+
+			list = inputoroutputspeedtotalMapper.getInputoroutputspeedtotalByWtId(wtId,beginDate,endDate);
+
+
+		}
+		return list;
+
+	}
+
+
 }

+ 35 - 0
src/main/java/com/gyee/frame/service/WindTurbineInfoDay2Service.java

@@ -5,6 +5,7 @@ import com.gyee.frame.common.support.Convert;
 import com.gyee.frame.mapper.auto.WindTurbineInfoDay2Mapper;
 import com.gyee.frame.model.auto.WindTurbineInfoDay2;
 import com.gyee.frame.model.auto.WindTurbineInfoDay2Example;
+import com.gyee.frame.model.custom.SingleAnalysisVo;
 import com.gyee.frame.util.DateUtils;
 import com.gyee.frame.util.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -167,4 +168,38 @@ public class WindTurbineInfoDay2Service implements BaseService<WindTurbineInfoDa
 		return list;
 
 	}
+
+
+	public List<SingleAnalysisVo>  getWindTurbineInfoDay2Mapper(String wpId,Date beginDate,Date endDate) {
+
+		List<SingleAnalysisVo>   list =  new ArrayList<>();
+
+
+		if (StringUtils.notEmp(wpId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
+
+
+			list = windTurbineInfoDay2Mapper.getWindTurbineInfoDay2(wpId,beginDate,endDate);
+
+
+		}
+		return list;
+
+	}
+
+
+	public List<SingleAnalysisVo>  getWindTurbineInfoDayMapper2ByWtId(String wtId, Date beginDate, Date endDate) {
+
+		List<SingleAnalysisVo>   list =  new ArrayList<>();
+
+
+		if (StringUtils.notEmp(wtId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
+
+
+			list = windTurbineInfoDay2Mapper.getWindTurbineInfoDay2ByWtId(wtId,beginDate,endDate);
+
+
+		}
+		return list;
+
+	}
 }

+ 14 - 0
src/main/java/com/gyee/frame/service/WindturbinecurvefittingService.java

@@ -143,6 +143,20 @@ public class WindturbinecurvefittingService implements BaseService<Windturbinecu
 
 	}
 
+	public List<Windturbinecurvefitting> getWindturbinecurvefittingByWtId(String windturbineid)  {
+
+
+		List<Windturbinecurvefitting> list =new ArrayList<>();
+
+		if(StringUtils.notEmp(windturbineid))
+		{
+			list= windturbinecurvefittingMapper.getWindturbinecurvefittingByWtId(windturbineid);
+		}
+
+		return list;
+
+	}
+
 	public PageInfo<Windturbinecurvefitting>  getWindturbinecurvefitting(Tablepar tablepar, String wtId)  {
 
 

+ 34 - 0
src/main/java/com/gyee/frame/service/Windturbineinfoday3Service.java

@@ -7,6 +7,7 @@ import com.gyee.frame.common.spring.InitialRunner;
 import com.gyee.frame.common.support.Convert;
 import com.gyee.frame.mapper.auto.Windturbineinfoday3Mapper;
 import com.gyee.frame.model.auto.*;
+import com.gyee.frame.model.custom.SingleAnalysisVo;
 import com.gyee.frame.model.custom.Tablepar;
 import com.gyee.frame.util.StringUtils;
 import org.springframework.stereotype.Service;
@@ -1465,4 +1466,37 @@ public class Windturbineinfoday3Service implements BaseService<Windturbineinfoda
         return list;
 
     }
+
+    public List<SingleAnalysisVo>  getWindTurbineInfoDay3Mapper(String wpId,Date beginDate,Date endDate) {
+
+        List<SingleAnalysisVo>   list =  new ArrayList<>();
+
+
+        if (StringUtils.notEmp(wpId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
+
+
+            list = windturbineinfoday3Mapper.getWindTurbineInfoDay3(wpId,beginDate,endDate);
+
+
+        }
+        return list;
+
+    }
+
+
+    public List<SingleAnalysisVo>  getWindTurbineInfoDayMapper3ByWtId(String wtId, Date beginDate, Date endDate) {
+
+        List<SingleAnalysisVo>   list =  new ArrayList<>();
+
+
+        if (StringUtils.notEmp(wtId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
+
+
+            list = windturbineinfoday3Mapper.getWindTurbineInfoDay3ByWtId(wtId,beginDate,endDate);
+
+
+        }
+        return list;
+
+    }
 }

+ 38 - 1
src/main/java/com/gyee/frame/service/WindturbineinfodayService.java

@@ -6,7 +6,11 @@ import com.gyee.frame.common.base.BaseService;
 import com.gyee.frame.common.spring.InitialRunner;
 import com.gyee.frame.common.support.Convert;
 import com.gyee.frame.mapper.auto.WindTurbineInfoDayMapper;
-import com.gyee.frame.model.auto.*;
+import com.gyee.frame.model.auto.WindTurbineInfoDay;
+import com.gyee.frame.model.auto.WindTurbineInfoDayExample;
+import com.gyee.frame.model.auto.Windpowerstation;
+import com.gyee.frame.model.auto.Windturbine;
+import com.gyee.frame.model.custom.SingleAnalysisVo;
 import com.gyee.frame.model.custom.StatisticalAnalysisTopVo;
 import com.gyee.frame.model.custom.Tablepar;
 import com.gyee.frame.util.DateUtils;
@@ -297,4 +301,37 @@ public class WindturbineinfodayService implements BaseService<WindTurbineInfoDay
 		return list;
 
 	}
+
+	public List<SingleAnalysisVo>  getWindTurbineInfoDayMapper(String wpId,Date beginDate,Date endDate) {
+
+		List<SingleAnalysisVo>   list =  new ArrayList<>();
+
+
+		if (StringUtils.notEmp(wpId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
+
+
+			list = windTurbineInfoDayMapper.getWindTurbineInfoDay(wpId,beginDate,endDate);
+
+
+		}
+		return list;
+
+	}
+
+
+	public List<SingleAnalysisVo>  getWindTurbineInfoDayMapperByWtId(String wtId, Date beginDate, Date endDate) {
+
+		List<SingleAnalysisVo>   list =  new ArrayList<>();
+
+
+		if (StringUtils.notEmp(wtId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
+
+
+			list = windTurbineInfoDayMapper.getWindTurbineInfoDayByWtId(wtId,beginDate,endDate);
+
+
+		}
+		return list;
+
+	}
 }

+ 19 - 0
src/main/java/com/gyee/frame/service/WindturbinethewindinfoService.java

@@ -5,6 +5,7 @@ import com.gyee.frame.common.support.Convert;
 import com.gyee.frame.mapper.auto.WindturbinethewindinfoMapper;
 import com.gyee.frame.model.auto.Windturbinethewindinfo;
 import com.gyee.frame.model.auto.WindturbinethewindinfoExample;
+import com.gyee.frame.model.custom.SingleAnalysisVo;
 import com.gyee.frame.util.DateUtils;
 import com.gyee.frame.util.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -141,4 +142,22 @@ public class WindturbinethewindinfoService implements BaseService<Windturbinethe
 
 	}
 
+
+
+	public List<SingleAnalysisVo>  getWindturbinethewindinfoMapperByWtId(String wtId, Date beginDate, Date endDate) {
+
+		List<SingleAnalysisVo>   list =  new ArrayList<>();
+
+
+		if (StringUtils.notEmp(wtId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
+
+
+			list = windturbinethewindinfoMapper.getWindturbinethewindinfoByWtId(wtId,beginDate,endDate);
+
+
+		}
+		return list;
+
+	}
+
 }

+ 245 - 137
src/main/java/com/gyee/frame/service/singleanalysis/SingleAnalysisService.java

@@ -38,10 +38,10 @@ public class SingleAnalysisService {
 
         if (StringUtils.notEmp(wpId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
 
-            Map<String, List<Inputoroutputspeedtotal>> iomap=getInputoroutputspeedtotalMap(wpId, beginDate, endDate);
-            Map<String, List<WindTurbineInfoDay>> wtdaymap=getWindturbineinfodayMap(wpId, beginDate, endDate);
-            Map<String, List<WindTurbineInfoDay2>> wtday2map=getWindturbineinfoday2Map(wpId, beginDate, endDate);
-            Map<String, List<Windturbineinfoday3>> wtday3map=getWindturbineinfoday3Map(wpId, beginDate, endDate);
+            Map<String, SingleAnalysisVo> iomap=getInputoroutputspeedtotalMap(wpId, beginDate, endDate);
+            Map<String, SingleAnalysisVo> wtdaymap=getWindturbineinfodayMap(wpId, beginDate, endDate);
+            Map<String, SingleAnalysisVo> wtday2map=getWindturbineinfoday2Map(wpId, beginDate, endDate);
+            Map<String, SingleAnalysisVo> wtday3map=getWindturbineinfoday3Map(wpId, beginDate, endDate);
 
 
 
@@ -77,21 +77,21 @@ public class SingleAnalysisService {
                         double fdl=0;
                         if(wtdaymap.containsKey(wt.getId()))
                         {
-                            List<WindTurbineInfoDay> wtdls=wtdaymap.get(wt.getId());
-
-                            fdl=wtdls.stream().mapToDouble(WindTurbineInfoDay::getGeneratingcapacity).sum();//风机发电量合计
-                            double yxxs=wtdls.stream().mapToDouble(WindTurbineInfoDay::getRunhours).sum();//风机运行小时合计
-                            double gzxs=wtdls.stream().mapToDouble(WindTurbineInfoDay::getFaulthours).sum();//风机故障小时合计
-                            double jxxs=wtdls.stream().mapToDouble(WindTurbineInfoDay::getMaintainhours).sum();//风机检修小时合计
-                            double tjxs=wtdls.stream().mapToDouble(WindTurbineInfoDay::getStophours).sum();//风机停机小时合计
-                            double zdxs=wtdls.stream().mapToDouble(WindTurbineInfoDay::getInterrupthours).sum();//风机中断小时合计
-                            double rlxs=wtdls.stream().mapToDouble(WindTurbineInfoDay::getDaycalendarhours).sum();//风机日历小时合计
-
-                            double fs=wtdls.stream().mapToDouble(WindTurbineInfoDay::getBuyelectricity).average().getAsDouble();//风机平均风速
-                            double sbklyl=wtdls.stream().mapToDouble(WindTurbineInfoDay::getDaysbklyl).average().getAsDouble();//风机平均设备可利用率
-                            double dxklyxs=wtdls.stream().mapToDouble(WindTurbineInfoDay::getDaydxkyxs).average().getAsDouble();//风机平均等效可利用系数
-                            double lyxs=wtdls.stream().mapToDouble(WindTurbineInfoDay::getDaylyxs).average().getAsDouble();//风机平均利用小时
-                            double yxfss=wtdls.stream().mapToDouble(WindTurbineInfoDay::getWindhours).average().getAsDouble();//风机平均有效风时速
+                            SingleAnalysisVo wtd=wtdaymap.get(wt.getId());
+
+                            fdl=null!=wtd.getFdl()?wtd.getFdl():0.0;//风机发电量合计
+                            double yxxs=null!=wtd.getYxxs()?wtd.getYxxs():0.0;//风机运行小时合计
+                            double gzxs=null!=wtd.getGzxs()?wtd.getGzxs():0.0;//风机故障小时合计
+                            double jxxs=null!=wtd.getJxxs()?wtd.getJxxs():0.0;//风机检修小时合计
+                            double tjxs=null!=wtd.getTjxs()?wtd.getTjxs():0.0;//风机停机小时合计
+                            double zdxs=null!=wtd.getZdxs()?wtd.getZdxs():0.0;//风机中断小时合计
+                            double rlxs=null!=wtd.getRlxs()?wtd.getRlxs():0.0;//风机日历小时合计
+                            double fs=null!=wtd.getFs()?wtd.getFs():0.0;//风机平均风速
+                            double sbklyl=null!=wtd.getSbklyl()?wtd.getSbklyl():0.0;//风机平均设备可利用率
+                            double dxklyxs=null!=wtd.getDxklyxs()?wtd.getDxklyxs():0.0;//风机平均等效可利用系数
+                            double lyxs=null!=wtd.getLyxs()?wtd.getLyxs():0.0;//风机平均利用小时
+                            double yxfss=null!=wtd.getYxfss()?wtd.getYxfss():0.0;//风机平均有效风时速
+
 
                             vo.setFdl(StringUtils.round(fdl,2));
                             vo.setYxxs(StringUtils.round(yxxs,2));
@@ -110,27 +110,22 @@ public class SingleAnalysisService {
 
                         if(wtday2map.containsKey(wt.getId()))
                         {
-                            List<WindTurbineInfoDay2> wtdls=wtday2map.get(wt.getId());
+                            SingleAnalysisVo wtd=wtday2map.get(wt.getId());
 
-                            double glyzxxs=wtdls.stream().mapToDouble(WindTurbineInfoDay2::getMonthcoefficient).average().getAsDouble();//风机平均功率一致性系数
+                            double glyzxxs=null!=wtd.getGlyzxxs()?wtd.getGlyzxxs():0.0;//风机平均功率一致性系数
                             vo.setGlyzxxs(StringUtils.round(glyzxxs,2));
                         }
 
                         if(wtday3map.containsKey(wt.getId()))
                         {
-                            List<Windturbineinfoday3> wtdls=wtday3map.get(wt.getId());
+                            SingleAnalysisVo wtd=wtday3map.get(wt.getId());
 
-                            double gzss=wtdls.stream().mapToDouble(Windturbineinfoday3::getDaynhgzssdl).sum();//风机故障损失合计
-                            double jxss=wtdls.stream().mapToDouble(Windturbineinfoday3::getDaynhwhssdl).sum();//风机检修损失合计
-                            double xdss=wtdls.stream().mapToDouble(Windturbineinfoday3::getDaynhxdssdl).sum();//风机限电损失合计
-                            double xnss=wtdls.stream().mapToDouble(Windturbineinfoday3::getDaynhqfdl).sum();//风机性能损失时合计
-                            double slss=wtdls.stream().mapToDouble(Windturbineinfoday3::getDaynhcfdl).sum();//风机受累损失合计
+                            double gzss=null!=wtd.getGzss()?wtd.getGzss():0.0;//风机故障损失合计
+                            double jxss=null!=wtd.getJxss()?wtd.getJxss():0.0;//风机检修损失合计
+                            double xdss=null!=wtd.getXdss()?wtd.getXdss():0.0;//风机限电损失合计
+                            double xnss=null!=wtd.getXnss()?wtd.getXnss():0.0;//风机性能损失时合计
+                            double slss=null!=wtd.getSlss()?wtd.getSlss():0.0;//风机受累损失合计
 
-                            gzss =new BigDecimal(gzss).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue();
-                            jxss =new BigDecimal(jxss).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue();
-                            xdss =new BigDecimal(xdss).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue();
-                            xnss =new BigDecimal(xnss).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue();
-                            slss =new BigDecimal(slss).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue();
 
                             double llfdl=fdl+gzss+jxss+xdss+xnss+slss;
 
@@ -145,13 +140,14 @@ public class SingleAnalysisService {
 
                         if(iomap.containsKey(wt.getId()))
                         {
-                            List<Inputoroutputspeedtotal>iols=iomap.get(wt.getId());
+                            SingleAnalysisVo wtd=iomap.get(wt.getId());
 
-                            double xfqr=iols.stream().mapToDouble(Inputoroutputspeedtotal::getDayinputsmall).average().getAsDouble();//风机小风切入
-                            double xfqrhgl=iols.stream().mapToDouble(Inputoroutputspeedtotal::getDayinputsmallratio).average().getAsDouble();//风机小风切入合格率
+                            double xfqr=null!=wtd.getXfqr()?wtd.getXfqr():0.0;//风机小风切入
+                            double xfqrhgl=null!=wtd.getXfqrhgl()?wtd.getXfqrhgl():0.0;//风机小风切入合格率
                             vo.setXfqr(StringUtils.round(xfqr,2));
                             vo.setXfqrhgl(StringUtils.round(xfqrhgl,2));
                         }
+                        vos.add(vo);
                     }
 
                 }
@@ -168,20 +164,136 @@ public class SingleAnalysisService {
             vo.setSwdl(StringUtils.round(swdl, 2));
             vo.setGwdl(StringUtils.round(gwdl, 2));
 
-            double fdl = vos.stream().mapToDouble(SingleAnalysisVo::getFdl).sum();//风机发电量合计
-            double yxxs = vos.stream().mapToDouble(SingleAnalysisVo::getYxxs).sum();//风机运行小时合计
-            double gzxs = vos.stream().mapToDouble(SingleAnalysisVo::getGzxs).sum();//风机故障小时合计
-            double jxxs = vos.stream().mapToDouble(SingleAnalysisVo::getJxxs).sum();//风机检修小时合计
-            double tjxs = vos.stream().mapToDouble(SingleAnalysisVo::getTjxs).sum();//风机停机小时合计
-            double zdxs = vos.stream().mapToDouble(SingleAnalysisVo::getZdxs).sum();//风机中断小时合计
-            double rlxs = vos.stream().mapToDouble(SingleAnalysisVo::getRlxs).sum();//风机日历小时合计
+            double fdl = 0.0;//风机发电量合计
+            double yxxs = 0.0;//风机运行小时合计
+            double gzxs =0.0;//风机故障小时合计
+            double jxxs =0.0;//风机检修小时合计
+            double tjxs =0.0;//风机停机小时合计
+            double zdxs =0.0;//风机中断小时合计
+            double rlxs = 0.0;//风机日历小时合计
+
+            double fs = 0.0;//风机平均风速
+            double sbklyl = 0.0;//风机平均设备可利用率
+            double dxklyxs =0.0;//风机平均等效可利用系数
+            double lyxs =0.0;//风机平均利用小时
+            double yxfss = 0.0;//风机平均有效风时速
+            double glyzxxs = 0.0;//风机平均功率一致性系数
+
+            double xfqr=0.0;//风机小风切入
+            double xfqrhgl = 0.0;//风机小风切入合格率
+
+            int xfqrnum=0;
+            int xfqrhglnum=0;
+
+            int fsnum=0;
+            int sbklylnum=0;
+            int dxklyxsnum=0;
+            int lyxsnum=0;
+            int yxfssnum=0;
+            int glyzxxsnum=0;
+
+            for(SingleAnalysisVo wtd:vos)
+            {
+                double temp=null!=wtd.getFdl()?wtd.getFdl():0.0;//风机发电量合计
+                fdl=fdl+temp;
+                temp=null!=wtd.getYxxs()?wtd.getYxxs():0.0;//风机运行小时合计
+                yxxs=yxxs+temp;
+                temp=null!=wtd.getGzxs()?wtd.getGzxs():0.0;//风机故障小时合计
+                gzxs=gzxs+temp;
+                temp=null!=wtd.getJxxs()?wtd.getJxxs():0.0;//风机检修小时合计
+                jxxs=jxxs+temp;
+                temp=null!=wtd.getTjxs()?wtd.getTjxs():0.0;//风机停机小时合计
+                tjxs=tjxs+temp;
+                temp=null!=wtd.getZdxs()?wtd.getZdxs():0.0;//风机中断小时合计
+                zdxs=zdxs+temp;
+                temp=null!=wtd.getRlxs()?wtd.getRlxs():0.0;//风机日历小时合计
+                rlxs=rlxs+temp;
+
+                temp=null!=wtd.getFs()?wtd.getFs():0.0;//风机平均风速
+                fs=fs+temp;
+                if(StringUtils.notEmp(wtd.getFs()))
+                {
+                    fsnum++;
+                }
+                temp=null!=wtd.getSbklyl()?wtd.getSbklyl():0.0;//风机平均设备可利用率
+                sbklyl=sbklyl+temp;
+                if(StringUtils.notEmp(wtd.getSbklyl()))
+                {
+                    sbklylnum++;
+                }
+                temp=null!=wtd.getDxklyxs()?wtd.getDxklyxs():0.0;//风机平均等效可利用系数
+                dxklyxs=dxklyxs+temp;
+                if(StringUtils.notEmp(wtd.getDxklyxs()))
+                {
+                    dxklyxsnum++;
+                }
+                temp=null!=wtd.getLyxs()?wtd.getLyxs():0.0;//风机平均利用小时
+                lyxs=lyxs+temp;
+                if(StringUtils.notEmp(wtd.getLyxs()))
+                {
+                    lyxsnum++;
+                }
+                temp=null!=wtd.getYxfss()?wtd.getYxfss():0.0;//风机平均有效风时速
+                yxfss=yxfss+temp;
+                if(StringUtils.notEmp(wtd.getYxfss()))
+                {
+                    yxfssnum++;
+                }
+                temp=null!=wtd.getGlyzxxs()?wtd.getGlyzxxs():0.0;//风机平均功率一致性系数
+                glyzxxs=glyzxxs+temp;
+                if(StringUtils.notEmp(wtd.getGlyzxxs()))
+                {
+                    glyzxxsnum++;
+                }
 
-            double fs = vos.stream().mapToDouble(SingleAnalysisVo::getFs).average().getAsDouble();//风机平均风速
-            double sbklyl = vos.stream().mapToDouble(SingleAnalysisVo::getSbklyl).average().getAsDouble();//风机平均设备可利用率
-            double dxklyxs = vos.stream().mapToDouble(SingleAnalysisVo::getDxklyxs).average().getAsDouble();//风机平均等效可利用系数
-            double lyxs = vos.stream().mapToDouble(SingleAnalysisVo::getLyxs).average().getAsDouble();//风机平均利用小时
-            double yxfss = vos.stream().mapToDouble(SingleAnalysisVo::getYxfss).average().getAsDouble();//风机平均有效风时速
-            double glyzxxs = vos.stream().mapToDouble(SingleAnalysisVo::getGlyzxxs).average().getAsDouble();//风机平均功率一致性系数
+                temp=null!=wtd.getXfqr()?wtd.getXfqr():0.0;//风机小风切入
+                xfqr=xfqr+temp;
+                if(StringUtils.notEmp(wtd.getXfqr()))
+                {
+                    xfqrnum++;
+                }
+                temp=null!=wtd.getXfqrhgl()?wtd.getXfqrhgl():0.0;//风机小风切入合格率
+                xfqrhgl=xfqrhgl+temp;
+                if(StringUtils.notEmp(wtd.getXfqrhgl()))
+                {
+                    xfqrhglnum++;
+                }
+            }
+
+            if(fsnum!=0)
+            {
+                double temp=new BigDecimal(fs).divide(new BigDecimal(fsnum), 2, RoundingMode.HALF_UP).doubleValue();
+                vo.setFs(temp);
+            }
+            if(sbklylnum!=0)
+            {
+                double temp=new BigDecimal(sbklyl).divide(new BigDecimal(sbklylnum), 2, RoundingMode.HALF_UP).doubleValue();
+                vo.setSbklyl(temp);
+            }
+
+            if(dxklyxsnum!=0)
+            {
+                double temp=new BigDecimal(dxklyxs).divide(new BigDecimal(dxklyxsnum), 2, RoundingMode.HALF_UP).doubleValue();
+                vo.setDxklyxs(temp);
+            }
+
+            if(lyxsnum!=0)
+            {
+                double temp=new BigDecimal(lyxs).divide(new BigDecimal(lyxsnum), 2, RoundingMode.HALF_UP).doubleValue();
+                vo.setLyxs(temp);
+            }
+
+            if(yxfssnum!=0)
+            {
+                double temp=new BigDecimal(yxfss).divide(new BigDecimal(yxfssnum), 2, RoundingMode.HALF_UP).doubleValue();
+                vo.setYxfss(temp);
+            }
+
+            if(glyzxxsnum!=0)
+            {
+                double temp=new BigDecimal(glyzxxs).divide(new BigDecimal(glyzxxsnum), 2, RoundingMode.HALF_UP).doubleValue();
+                vo.setGlyzxxs(temp);
+            }
 
 
             vo.setFdl(StringUtils.round(fdl, 2));
@@ -212,10 +324,21 @@ public class SingleAnalysisService {
             vo.setSlss(StringUtils.round(slss, 2));
             vo.setLlfdl(StringUtils.round(llfdl, 2));
 
-            double xfqr = vos.stream().mapToDouble(SingleAnalysisVo::getXfqr).average().getAsDouble();//风机小风切入
-            double xfqrhgl = vos.stream().mapToDouble(SingleAnalysisVo::getXfqrhgl).average().getAsDouble();//风机小风切入合格率
-            vo.setXfqr(xfqr);
-            vo.setXfqrhgl(xfqrhgl);
+
+
+
+            if(xfqrnum!=0)
+            {
+                double temp=new BigDecimal(xfqr).divide(new BigDecimal(xfqrnum), 2, RoundingMode.HALF_UP).doubleValue();
+                vo.setXfqr(temp);
+            }
+
+            if(xfqrhglnum!=0)
+            {
+                double temp=new BigDecimal(xfqrhgl).divide(new BigDecimal(xfqrhglnum), 2, RoundingMode.HALF_UP).doubleValue();
+                vo.setXfqrhgl(temp);
+            }
+
 
             vos.add(vo);
         }
@@ -225,17 +348,28 @@ public class SingleAnalysisService {
     }
 
 
+    public List<SingleAnalysisVo> SingleAnalysisList(String wpId, Date beginDate, Date endDate)  {
+
+        List<SingleAnalysisVo> vos =new ArrayList<>();
+
+        if (StringUtils.notEmp(wpId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
+
+            vos=inputoroutputspeedtotalService.getInputoroutputspeedtotalMapper(wpId, beginDate, endDate);
+        }
+        return  vos;
+    }
+
     public SingleAnalysisVo SingleAnalysisListByWtId(String wtId,Date beginDate,Date endDate)  {
 
         SingleAnalysisVo vo=new SingleAnalysisVo();
 
         if (StringUtils.notEmp(wtId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
 
-            List<Inputoroutputspeedtotal> iols=inputoroutputspeedtotalService.getInputoroutputspeedtotal(wtId, beginDate,endDate);
-            List<WindTurbineInfoDay> wtdayls=windturbineinfodayService.getWindturbineinfodayList(wtId, beginDate,endDate);
-            List<WindTurbineInfoDay2> wtday2ls=WindTurbineInfoDay2Service.getWindturbineinfoday2List(wtId, beginDate,endDate);
-            List<Windturbineinfoday3> wtday3ls=windturbineinfoday3Service.getWindturbineinfoday3List(wtId, beginDate,endDate);
-            List<Windturbinethewindinfo> wtdls = windturbinethewindinfoService.getWindturbinethewindinfo(wtId, beginDate,endDate);
+            List<SingleAnalysisVo> iols=inputoroutputspeedtotalService.getInputoroutputspeedtotalMapperByWtId(wtId, beginDate,endDate);
+            List<SingleAnalysisVo> wtdayls=windturbineinfodayService.getWindTurbineInfoDayMapper(wtId, beginDate,endDate);
+            List<SingleAnalysisVo> wtday2ls=WindTurbineInfoDay2Service.getWindTurbineInfoDay2Mapper(wtId, beginDate,endDate);
+            List<SingleAnalysisVo> wtday3ls=windturbineinfoday3Service.getWindTurbineInfoDay3Mapper(wtId, beginDate,endDate);
+            List<SingleAnalysisVo> wtdls = windturbinethewindinfoService.getWindturbinethewindinfoMapperByWtId(wtId, beginDate,endDate);
 
             Windturbine wt= InitialRunner.wtmap.get(wtId);
             Windpowerstation wp= InitialRunner.wpmap.get(wt.getWindpowerstationid());
@@ -264,19 +398,21 @@ public class SingleAnalysisService {
             if(StringUtils.notEmp(wtdayls) && !wtdayls.isEmpty())
             {
 
-                fdl=wtdayls.stream().mapToDouble(WindTurbineInfoDay::getGeneratingcapacity).sum();//风机发电量合计
-                double yxxs=wtdayls.stream().mapToDouble(WindTurbineInfoDay::getRunhours).sum();//风机运行小时合计
-                double gzxs=wtdayls.stream().mapToDouble(WindTurbineInfoDay::getFaulthours).sum();//风机故障小时合计
-                double jxxs=wtdayls.stream().mapToDouble(WindTurbineInfoDay::getMaintainhours).sum();//风机检修小时合计
-                double tjxs=wtdayls.stream().mapToDouble(WindTurbineInfoDay::getStophours).sum();//风机停机小时合计
-                double zdxs=wtdayls.stream().mapToDouble(WindTurbineInfoDay::getInterrupthours).sum();//风机中断小时合计
-                double rlxs=wtdayls.stream().mapToDouble(WindTurbineInfoDay::getDaycalendarhours).sum();//风机日历小时合计
+                SingleAnalysisVo wtd=wtdayls.get(0);
+
+                fdl=null!=wtd.getFdl()?wtd.getFdl():0.0;//风机发电量合计
+                double yxxs=null!=wtd.getYxxs()?wtd.getYxxs():0.0;//风机运行小时合计
+                double gzxs=null!=wtd.getGzxs()?wtd.getGzxs():0.0;//风机故障小时合计
+                double jxxs=null!=wtd.getJxxs()?wtd.getJxxs():0.0;//风机检修小时合计
+                double tjxs=null!=wtd.getTjxs()?wtd.getTjxs():0.0;//风机停机小时合计
+                double zdxs=null!=wtd.getZdxs()?wtd.getZdxs():0.0;//风机中断小时合计
+                double rlxs=null!=wtd.getRlxs()?wtd.getRlxs():0.0;//风机日历小时合计
+                double fs=null!=wtd.getFs()?wtd.getFs():0.0;//风机平均风速
+                double sbklyl=null!=wtd.getSbklyl()?wtd.getSbklyl():0.0;//风机平均设备可利用率
+                double dxklyxs=null!=wtd.getDxklyxs()?wtd.getDxklyxs():0.0;//风机平均等效可利用系数
+                double lyxs=null!=wtd.getLyxs()?wtd.getLyxs():0.0;//风机平均利用小时
+                double yxfss=null!=wtd.getYxfss()?wtd.getYxfss():0.0;//风机平均有效风时速
 
-                double fs=wtdayls.stream().mapToDouble(WindTurbineInfoDay::getBuyelectricity).average().getAsDouble();//风机平均风速
-                double sbklyl=wtdayls.stream().mapToDouble(WindTurbineInfoDay::getDaysbklyl).average().getAsDouble();//风机平均设备可利用率
-                double dxklyxs=wtdayls.stream().mapToDouble(WindTurbineInfoDay::getDaydxkyxs).average().getAsDouble();//风机平均等效可利用系数
-                double lyxs=wtdayls.stream().mapToDouble(WindTurbineInfoDay::getDaylyxs).average().getAsDouble();//风机平均利用小时
-                double yxfss=wtdayls.stream().mapToDouble(WindTurbineInfoDay::getWindhours).average().getAsDouble();//风机平均有效风时速
 
                 vo.setFdl(StringUtils.round(fdl,2));
                 vo.setYxxs(StringUtils.round(yxxs,2));
@@ -293,27 +429,25 @@ public class SingleAnalysisService {
 
             }
 
+
+
+
+
             if(StringUtils.notEmp(wtday2ls) && !wtday2ls.isEmpty())
             {
-
-                double glyzxxs=wtday2ls.stream().mapToDouble(WindTurbineInfoDay2::getMonthcoefficient).average().getAsDouble();//风机平均功率一致性系数
+                SingleAnalysisVo wtd=wtday2ls.get(0);
+                double glyzxxs=null!=wtd.getGlyzxxs()?wtd.getGlyzxxs():0.0;//风机平均功率一致性系数
                 vo.setGlyzxxs(StringUtils.round(glyzxxs,2));
             }
 
             if(StringUtils.notEmp(wtday3ls) && !wtday3ls.isEmpty())
             {
-
-                double gzss=wtday3ls.stream().mapToDouble(Windturbineinfoday3::getDaynhgzssdl).sum();//风机故障损失合计
-                double jxss=wtday3ls.stream().mapToDouble(Windturbineinfoday3::getDaynhwhssdl).sum();//风机检修损失合计
-                double xdss=wtday3ls.stream().mapToDouble(Windturbineinfoday3::getDaynhxdssdl).sum();//风机限电损失合计
-                double xnss=wtday3ls.stream().mapToDouble(Windturbineinfoday3::getDaynhqfdl).sum();//风机性能损失时合计
-                double slss=wtday3ls.stream().mapToDouble(Windturbineinfoday3::getDaynhcfdl).sum();//风机受累损失合计
-
-                gzss =new BigDecimal(gzss).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue();
-                jxss =new BigDecimal(jxss).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue();
-                xdss =new BigDecimal(xdss).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue();
-                xnss =new BigDecimal(xnss).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue();
-                slss =new BigDecimal(slss).divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP).doubleValue();
+                SingleAnalysisVo wtd=wtday3ls.get(0);
+                double gzss=null!=wtd.getGzss()?wtd.getGzss():0.0;//风机故障损失合计
+                double jxss=null!=wtd.getJxss()?wtd.getJxss():0.0;//风机检修损失合计
+                double xdss=null!=wtd.getXdss()?wtd.getXdss():0.0;//风机限电损失合计
+                double xnss=null!=wtd.getXnss()?wtd.getXnss():0.0;//风机性能损失时合计
+                double slss=null!=wtd.getSlss()?wtd.getSlss():0.0;//风机受累损失合计
 
                 double llfdl=fdl+gzss+jxss+xdss+xnss+slss;
 
@@ -328,16 +462,17 @@ public class SingleAnalysisService {
 
             if(StringUtils.notEmp(iols) && !iols.isEmpty())
             {
-
-                double xfqr=iols.stream().mapToDouble(Inputoroutputspeedtotal::getDayinputsmall).average().getAsDouble();//风机小风切入
-                double xfqrhgl=iols.stream().mapToDouble(Inputoroutputspeedtotal::getDayinputsmallratio).average().getAsDouble();//风机小风切入合格率
+                SingleAnalysisVo wtd=iols.get(0);
+                double xfqr=null!=wtd.getXfqr()?wtd.getXfqr():0.0;//风机小风切入
+                double xfqrhgl=null!=wtd.getXfqrhgl()?wtd.getXfqrhgl():0.0;//风机小风切入合格率
                 vo.setXfqr(StringUtils.round(xfqr,2));
                 vo.setXfqrhgl(StringUtils.round(xfqrhgl,2));
             }
 
             if(StringUtils.notEmp(wtdls) && !wtdls.isEmpty())
             {
-                double jfpl=wtdls.stream().mapToDouble(Windturbinethewindinfo::getCb).average().getAsDouble();//风机小风切入
+                SingleAnalysisVo wtd=wtdayls.get(0);
+                double jfpl=null!=wtd.getJfpl()?wtd.getJfpl():0.0;//静风频率
                 vo.setJfpl(StringUtils.round(jfpl,2));
             }
         }
@@ -415,93 +550,66 @@ public class SingleAnalysisService {
         return vo;
     }
 
-    private Map<String, List<Windturbineinfoday3>> getWindturbineinfoday3Map(String wpId, Date beginDate, Date endDate) {
-        Map<String, List<Windturbineinfoday3>> wtdaymap=new HashMap<>();
-        List<Windturbineinfoday3> wtdayls=windturbineinfoday3Service.getWindturbineinfoday3List(wpId, beginDate,endDate);
+    private Map<String, SingleAnalysisVo> getWindturbineinfoday3Map(String wpId, Date beginDate, Date endDate) {
+        Map<String, SingleAnalysisVo> wtdaymap=new HashMap<>();
+        List<SingleAnalysisVo> wtdayls=windturbineinfoday3Service.getWindTurbineInfoDay3Mapper(wpId, beginDate,endDate);
 
         if(!wtdayls.isEmpty())
         {
-            for (Windturbineinfoday3 wtday :wtdayls)
+            if(!wtdayls.isEmpty())
             {
-                if(wtdaymap.containsKey(wtday.getWindturbineid()))
+                for (SingleAnalysisVo io :wtdayls)
                 {
-                    List<Windturbineinfoday3> ls=wtdaymap.get(wtday.getWindturbineid());
-                    ls.add(wtday);
-                }else
-                {
-                    List<Windturbineinfoday3> ls=wtdaymap.get(wtday.getWindturbineid());
-                    ls.add(wtday);
-                    wtdaymap.put(wtday.getWindturbineid(),ls);
+                    wtdaymap.put(io.getWindturbineid(),io);
                 }
             }
         }
         return wtdaymap;
     }
 
-    private Map<String, List<WindTurbineInfoDay2>> getWindturbineinfoday2Map(String wpId, Date beginDate, Date endDate) {
-        Map<String, List<WindTurbineInfoDay2>> wtdaymap=new HashMap<>();
-        List<WindTurbineInfoDay2> wtdayls=WindTurbineInfoDay2Service.getWindturbineinfoday2List(wpId, beginDate,endDate);
+    private Map<String, SingleAnalysisVo> getWindturbineinfoday2Map(String wpId, Date beginDate, Date endDate) {
+        Map<String, SingleAnalysisVo> wtdaymap=new HashMap<>();
+        List<SingleAnalysisVo> wtdayls=WindTurbineInfoDay2Service.getWindTurbineInfoDay2Mapper(wpId, beginDate,endDate);
 
         if(!wtdayls.isEmpty())
         {
-            for (WindTurbineInfoDay2 wtday :wtdayls)
+            if(!wtdayls.isEmpty())
             {
-                if(wtdaymap.containsKey(wtday.getWindturbineid()))
-                {
-                    List<WindTurbineInfoDay2> ls=wtdaymap.get(wtday.getWindturbineid());
-                    ls.add(wtday);
-                }else
+                for (SingleAnalysisVo io :wtdayls)
                 {
-                    List<WindTurbineInfoDay2> ls=wtdaymap.get(wtday.getWindturbineid());
-                    ls.add(wtday);
-                    wtdaymap.put(wtday.getWindturbineid(),ls);
+                    wtdaymap.put(io.getWindturbineid(),io);
                 }
             }
         }
         return wtdaymap;
     }
 
-    private Map<String, List<WindTurbineInfoDay>> getWindturbineinfodayMap(String wpId, Date beginDate, Date endDate) {
-        Map<String, List<WindTurbineInfoDay>> wtdaymap=new HashMap<>();
-        List<WindTurbineInfoDay> wtdayls=windturbineinfodayService.getWindturbineinfodayList(wpId, beginDate,endDate);
+    private Map<String, SingleAnalysisVo> getWindturbineinfodayMap(String wpId, Date beginDate, Date endDate) {
+        Map<String, SingleAnalysisVo> wtdaymap=new HashMap<>();
+        List<SingleAnalysisVo> wtdayls=windturbineinfodayService.getWindTurbineInfoDayMapper(wpId, beginDate,endDate);
 
         if(!wtdayls.isEmpty())
         {
-            for (WindTurbineInfoDay wtday :wtdayls)
+            if(!wtdayls.isEmpty())
             {
-                if(wtdaymap.containsKey(wtday.getWindturbineid()))
+                for (SingleAnalysisVo io :wtdayls)
                 {
-                    List<WindTurbineInfoDay> ls=wtdaymap.get(wtday.getWindturbineid());
-                    ls.add(wtday);
-                }else
-                {
-                    List<WindTurbineInfoDay> ls=wtdaymap.get(wtday.getWindturbineid());
-                    ls.add(wtday);
-                    wtdaymap.put(wtday.getWindturbineid(),ls);
+                    wtdaymap.put(io.getWindturbineid(),io);
                 }
             }
         }
         return wtdaymap;
     }
 
-    private Map<String, List<Inputoroutputspeedtotal>> getInputoroutputspeedtotalMap(String wpId, Date beginDate, Date endDate) {
-        Map<String, List<Inputoroutputspeedtotal>> iomap=new HashMap<>();
-        List<Inputoroutputspeedtotal> iols=inputoroutputspeedtotalService.getInputoroutputspeedtotal(wpId, beginDate,endDate);
+    private Map<String, SingleAnalysisVo> getInputoroutputspeedtotalMap(String wpId, Date beginDate, Date endDate) {
+        Map<String, SingleAnalysisVo> iomap=new HashMap<>();
+        List<SingleAnalysisVo> iols=inputoroutputspeedtotalService.getInputoroutputspeedtotalMapper(wpId, beginDate,endDate);
 
         if(!iols.isEmpty())
         {
-            for (Inputoroutputspeedtotal io :iols)
+            for (SingleAnalysisVo io :iols)
             {
-                if(iomap.containsKey(io.getWindturbineid()))
-                {
-                    List<Inputoroutputspeedtotal> ls=iomap.get(io.getWindturbineid());
-                    ls.add(io);
-                }else
-                {
-                    List<Inputoroutputspeedtotal> ls=iomap.get(io.getWindturbineid());
-                    ls.add(io);
-                    iomap.put(io.getWindturbineid(),ls);
-                }
+                iomap.put(io.getWindturbineid(),io);
             }
         }
         return iomap;

+ 18 - 0
src/main/resources/mybatis/auto/InputoroutputspeedtotalMapper.xml

@@ -77,6 +77,8 @@
     <result column="PROJECTID" jdbcType="VARCHAR" property="projectid" />
     <result column="LINEID" jdbcType="VARCHAR" property="lineid" />
   </resultMap>
+
+
   <sql id="Example_Where_Clause">
     <!--
       WARNING - @mbg.generated
@@ -1302,4 +1304,20 @@
       LINEID = #{lineid,jdbcType=VARCHAR}
     where ID = #{id,jdbcType=INTEGER}
   </update>
+
+
+  <select id="getInputoroutputspeedtotal"  resultType="com.gyee.frame.model.custom.SingleAnalysisVo">
+    select WINDTURBINEID,avg(dayinputsmall)   xfqr,avg(dayinputsmallratio)   xfqrhgl
+    from Inputoroutputspeedtotal
+    where   Windpowerstationid = #{wpId} and Recorddate >= #{beginDate} and Recorddate &lt; #{endDate}
+    group by WINDTURBINEID ORDER BY WINDTURBINEID
+  </select>
+
+  <select id="getInputoroutputspeedtotalByWtId"  resultType="com.gyee.frame.model.custom.SingleAnalysisVo">
+    select WINDTURBINEID,avg(dayinputsmall)   xfqr,avg(dayinputsmallratio)   xfqrhgl
+    from Inputoroutputspeedtotal
+    where   Windpowerstationid = #{wtId} and Recorddate >= #{beginDate} and Recorddate &lt; #{endDate}
+    ORDER BY Recorddate
+  </select>
+
 </mapper>

+ 15 - 0
src/main/resources/mybatis/auto/WindTurbineInfoDay2Mapper.xml

@@ -333,4 +333,19 @@
       YEARCOEFFICIENT = #{yearcoefficient,jdbcType=DECIMAL}
     where ID = #{id,jdbcType=INTEGER}
   </update>
+
+
+  <select id="getWindTurbineInfoDay2"  resultType="com.gyee.frame.model.custom.SingleAnalysisVo">
+    select WINDTURBINEID,avg(Monthcoefficient)   glyzxxs
+    from WindTurbineInfoDay2
+    where   Windpowerstationid = #{wpId} and Recorddate >= #{beginDate} and Recorddate &lt; #{endDate}
+    group by WINDTURBINEID ORDER BY WINDTURBINEID
+  </select>
+
+  <select id="getWindTurbineInfoDay2ByWtId"  resultType="com.gyee.frame.model.custom.SingleAnalysisVo">
+    select WINDTURBINEID,avg(Monthcoefficient)   glyzxxs
+    from WindTurbineInfoDay2
+    where   WINDTURBINEID = #{wtId} and Recorddate >= #{beginDate} and Recorddate &lt; #{endDate}
+    ORDER BY Recorddate
+  </select>
 </mapper>

+ 30 - 0
src/main/resources/mybatis/auto/WindTurbineInfoDayMapper.xml

@@ -1384,4 +1384,34 @@
       weatherlossout = #{weatherlossout,jdbcType=DECIMAL}
     where id = #{id,jdbcType=INTEGER}
   </update>
+
+
+  <select id="getWindTurbineInfoDay"  resultType="com.gyee.frame.model.custom.SingleAnalysisVo">
+  select WINDTURBINEID,sum(Generatingcapacity)   fdl,sum(Runhours)   yxxs
+  ,sum(Faulthours)   gzxs,sum(Maintainhours)   jxxs
+  ,sum(Stophours)   tjxs,sum(Interrupthours)   zdxs
+  ,sum(Daycalendarhours)   rlxs,avg(Speed)   fs
+  ,avg(Daysbklyl)   sbklyl,avg(Daysbklyl)   dxklyxs
+  ,avg(Daylyxs)   sbklyl,avg(dayLYXS)  lyxs
+  ,avg(Windhours)   yxfss
+  from WindTurbineInfoDay
+  where   Windpowerstationid = #{wpId} and Recorddate >= #{beginDate} and Recorddate &lt; #{endDate}
+  group by WINDTURBINEID ORDER BY WINDTURBINEID
+</select>
+
+  <select id="getWindTurbineInfoDayByWtId"  resultType="com.gyee.frame.model.custom.SingleAnalysisVo">
+    select WINDTURBINEID,sum(Generatingcapacity)   fdl,sum(Runhours)   yxxs
+    ,sum(Faulthours)   gzxs,sum(Maintainhours)   jxxs
+    ,sum(Stophours)   tjxs,sum(Interrupthours)   zdxs
+    ,sum(Daycalendarhours)   rlxs,avg(Speed)   fs
+    ,avg(Daysbklyl)   sbklyl,avg(Daysbklyl)   dxklyxs
+    ,avg(Daylyxs)   sbklyl,avg(dayLYXS)  lyxs
+    ,avg(Windhours)   yxfss
+    from WindTurbineInfoDay
+    where   WINDTURBINEID = #{wtId} and Recorddate >= #{beginDate} and Recorddate &lt; #{endDate}
+    ORDER BY Recorddate
+  </select>
+
+
+
 </mapper>

+ 8 - 0
src/main/resources/mybatis/auto/WindturbinecurvefittingMapper.xml

@@ -307,4 +307,12 @@
       mainId = #{mainid,jdbcType=VARCHAR}
     where id = #{id,jdbcType=INTEGER}
   </update>
+
+  <select id="getWindturbinecurvefittingByWtId"  resultType="com.gyee.frame.model.auto.Windturbinecurvefitting">
+    select WINDTURBINEID,avg(Speed)   Speed,avg(Actualpower)   Actualpower
+    ,avg(Optimalpower) Optimalpower
+    from Windturbinecurvefitting
+    where   WINDTURBINEID = #{wtId}
+    group BY WINDTURBINEID,speed   ORDER BY Speed
+  </select>
 </mapper>

+ 18 - 0
src/main/resources/mybatis/auto/Windturbineinfoday3Mapper.xml

@@ -923,4 +923,22 @@
       recordDate = #{recorddate,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=INTEGER}
   </update>
+
+  <select id="getWindTurbineInfoDay3"  resultType="com.gyee.frame.model.custom.SingleAnalysisVo">
+    select WINDTURBINEID,sum(Daynhgzssdl)/10000   gzss,sum(Daynhwhssdl)/10000   jxss
+    ,sum(Daynhxdssdl)/10000   xdss,sum(Daynhqfdl)/10000   xnss
+    ,sum(Daynhcfdl)/10000   slss
+    from WindTurbineInfoDay3
+    where   Windpowerstationid = #{wpId} and Recorddate >= #{beginDate} and Recorddate &lt; #{endDate}
+    group by WINDTURBINEID ORDER BY WINDTURBINEID
+  </select>
+
+  <select id="getWindTurbineInfoDay3ByWtId"  resultType="com.gyee.frame.model.custom.SingleAnalysisVo">
+    select WINDTURBINEID,sum(Daynhgzssdl)/10000   gzss,sum(Daynhwhssdl)/10000   jxss
+    ,sum(Daynhxdssdl)/10000   xdss,sum(Daynhqfdl)/10000   xnss
+    ,sum(Daynhcfdl)/10000   slss
+    from WindTurbineInfoDay3
+    where   WINDTURBINEID = #{wtId} and Recorddate >= #{beginDate} and Recorddate &lt; #{endDate}
+    ORDER BY Recorddate
+  </select>
 </mapper>

+ 9 - 0
src/main/resources/mybatis/auto/WindturbinethewindinfoMapper.xml

@@ -4868,4 +4868,13 @@
       ENE18 = #{ene18,jdbcType=DECIMAL}
     where id = #{id,jdbcType=INTEGER}
   </update>
+
+
+
+  <select id="getWindturbinethewindinfoByWtId"  resultType="com.gyee.frame.model.custom.SingleAnalysisVo">
+    select WINDTURBINEID,avg(Cb)   jfpl
+    from Windturbinethewindinfo
+    where   WINDTURBINEID = #{wtId} and Recorddate >= #{beginDate} and Recorddate &lt; #{endDate}
+    ORDER BY Recorddate
+  </select>
 </mapper>

+ 91 - 0
src/test/java/test/PowerSaturationTest.java

@@ -0,0 +1,91 @@
+package test;
+
+import com.gyee.SpringbootStart;
+import com.gyee.frame.common.domain.AjaxResult;
+import com.gyee.frame.common.spring.SpringUtils;
+import com.gyee.frame.controller.powersaturation.PowerSaturationAmonutController;
+import com.gyee.frame.model.custom.DataVo;
+import com.gyee.frame.model.custom.Tablepar;
+import lombok.SneakyThrows;
+import org.springframework.boot.SpringApplication;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+public class PowerSaturationTest {
+
+    @SneakyThrows
+    public static void main(String[] args) {
+
+        SpringApplication.run(SpringbootStart.class, args);
+
+
+        Calendar c = Calendar.getInstance();
+
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+
+        c.set(Calendar.DAY_OF_MONTH,1);
+        c.set(Calendar.MONTH,0);
+        c.set(Calendar.YEAR,2021);
+
+        Date beginDate = c.getTime();
+
+        String wpid="MHS_FDC";
+
+        PowerSaturationAmonutController powerSaturationAmonutController= SpringUtils.getBean("powerSaturationAmonutController");
+
+
+        Tablepar tablepar=new Tablepar();
+        tablepar.setPageNum(1);
+        tablepar.setPageSize(10);
+
+
+//        AjaxResult ajaxResult = powerCompareController.powerAjaxAll("MHS_FDC","2021-01-01","2021-01-03","xl",null,null);
+//
+//        List<Windpowerinfoday3> test=(List<Windpowerinfoday3>)ajaxResult.get("data");
+//        for(Windpowerinfoday3 wtd:test)
+//        {
+//            System.out.println(wtd.getLineid()+"----------------"+wtd.getLocation());
+//        }
+//        System.out.println(test);
+//
+//        AjaxResult ajaxResult3 = powerCompareController.windfarmAjax();
+//
+//        List<StopTypeTreeVo> test3=(List<StopTypeTreeVo>)ajaxResult3.get("data");
+//        for(StopTypeTreeVo wtd:test3)
+//        {
+//            System.out.println(wtd.getId()+"----------------"+wtd.getName());
+//        }
+//
+//
+//        AjaxResult ajaxResult = powerCompareController.projectAjax("MHS_FDC");
+//
+//        List<StopTypeTreeVo> test=(List<StopTypeTreeVo>)ajaxResult.get("data");
+//        for(StopTypeTreeVo wtd:test)
+//        {
+//            System.out.println(wtd.getId()+"----------------"+wtd.getName());
+//        }
+//
+//        AjaxResult ajaxResult2 = powerCompareController.lineAjax("MHS01_GC");
+//        List<StopTypeTreeVo> test2=(List<StopTypeTreeVo>)ajaxResult2.get("data");
+//        for(StopTypeTreeVo wtd:test2)
+//        {
+//            System.out.println(wtd.getId()+"----------------"+wtd.getName());
+//        }
+
+        AjaxResult ajaxResult2 = powerSaturationAmonutController.powersaturationamonutchart("MG01_01");
+        List<DataVo> test2=(List<DataVo>)ajaxResult2.get("data");
+        for(DataVo wtd:test2)
+        {
+            System.out.println(wtd.getValue1()+"----------------"+wtd.getValue2()+"----------------"+wtd.getValue3()+"----------------"+wtd.getValue4());
+        }
+
+    }
+
+
+
+
+}

+ 18 - 39
src/test/java/test/SingleAnalysisTest.java

@@ -1,12 +1,16 @@
 package test;
 
 import com.gyee.SpringbootStart;
+import com.gyee.frame.common.domain.AjaxResult;
 import com.gyee.frame.common.spring.SpringUtils;
-import com.gyee.frame.controller.contrast.ContrastController;
+import com.gyee.frame.controller.singleanalysis.SingleAnalysisController;
+import com.gyee.frame.model.custom.SingleAnalysisVo;
 import com.gyee.frame.model.custom.Tablepar;
 import lombok.SneakyThrows;
 import org.springframework.boot.SpringApplication;
 
+import java.util.List;
+
 public class SingleAnalysisTest {
 
     @SneakyThrows
@@ -21,49 +25,24 @@ public class SingleAnalysisTest {
         String year="2021";
         String month="1";
 
-        ContrastController contrastController= SpringUtils.getBean("contrastController");
-//
-//        AjaxResult ajaxResult = dayBenchmarkingController.gadaylist(wpid,"2021-01-01");
-//
-//        List<Windturbineinfodaytop3> test=(List<Windturbineinfodaytop3>)ajaxResult.get("data");
+        SingleAnalysisController singleAnalysisController= SpringUtils.getBean("singleAnalysisController");
 
         Tablepar tablepar=new Tablepar();
         tablepar.setPageNum(1);
         tablepar.setPageSize(10);
+        tablepar.setOrderByColumn("windturbineName");
+        tablepar.setIsAsc("asc");
+
+
+
+        AjaxResult ar = singleAnalysisController.singleanalysisMain(tablepar,wpId,year,month);
+
+        List<SingleAnalysisVo> vos=( List<SingleAnalysisVo>)ar.get("data");
+        for(SingleAnalysisVo wtd:vos)
+        {
+            System.out.println(wtd.getXfqr()+"----------------"+wtd.getXfqrhgl());
+        }
 
-//        AjaxResult ajaxResult = contrastController.benchmarkPjList(tablepar,wpid,"","2021-01-01 00:00:00","2021-01-04 00:00:00");
-//
-//        List<BenchMarkVo> test=(List<BenchMarkVo>)ajaxResult.get("data");
-//        for(BenchMarkVo wtd:test)
-//        {
-//            System.out.println(wtd.getDxklylnum()+"----------------"+wtd.getDxklyl()+"----------------"+wtd.getEdfshgl());
-//        }
-//        System.out.println("/***********************************************/");
-
-//        AjaxResult ajaxResult2 = contrastController.benchmarkLnList(tablepar,wpid,"","2021-01-01 00:00:00","2021-01-04 00:00:00");
-//
-//        List<BenchMarkVo> test2=(List<BenchMarkVo>)ajaxResult2.get("data");
-//        for(BenchMarkVo wtd:test2)
-//        {
-//            System.out.println(wtd.getDxklylnum()+"----------------"+wtd.getDxklyl()+"----------------"+wtd.getEdfshgl());
-//        }
-//        System.out.println("/***********************************************/");
-
-//        AjaxResult ajaxResult = contrastController.findWpPowerOutChat(wpid,"2021-01-01 00:00:00","2021-01-04 00:00:00");
-//        List<DataVo> test=(List<DataVo>)ajaxResult.get("data");
-//        for(DataVo wtd:test)
-//        {
-//            System.out.println(wtd.getValue1()+"----------------"+wtd.getValue2());
-//        }
-
-//        AjaxResult ajaxResult = contrastController.benchmarkWtList(tablepar,wpid,null,"2021-01-01","2021-01-02");
-//
-//        List<BenchMarkVo> test=(List<BenchMarkVo>)ajaxResult.get("data");
-//        for(BenchMarkVo wtd:test)
-//        {
-//            System.out.println(wtd.getDxklyl()+"----------------"+wtd.getEdfshgl());
-//        }
-//        System.out.println(test);
     }