Browse Source

修改风机报警排行榜

shilin 4 years ago
parent
commit
dbe9dffb3e

+ 2 - 2
src/main/java/com/gyee/frame/controller/goodness/WindturbineGoodnessDetailController.java

@@ -5,7 +5,7 @@ import com.gyee.frame.common.domain.AjaxResult;
 import com.gyee.frame.common.spring.InitialRunner;
 import com.gyee.frame.model.auto.*;
 import com.gyee.frame.model.custom.DataVo;
-import com.gyee.frame.model.custom.StatisticalAnalysisWarningTopVo;
+import com.gyee.frame.model.custom.SawVo;
 import com.gyee.frame.model.custom.Tablepar;
 import com.gyee.frame.model.custom.ValueVo;
 import com.gyee.frame.service.*;
@@ -143,7 +143,7 @@ public class WindturbineGoodnessDetailController {
     @PostMapping("/bjphlist")
     @ResponseBody
     public AjaxResult bjphlist(Tablepar tablepar, String wtId, String recorddate) {
-        List<StatisticalAnalysisWarningTopVo> resultList =new ArrayList<>();
+        List<SawVo> resultList =new ArrayList<>();
         if(StringUtils.notEmp(wtId) && StringUtils.notEmp(recorddate))
         {
 

+ 3 - 4
src/main/java/com/gyee/frame/controller/leaderboard/LeaderboardController.java

@@ -6,12 +6,11 @@ import com.gyee.frame.model.auto.Curvefittingmain;
 import com.gyee.frame.model.auto.Curvefittingmonthmain;
 import com.gyee.frame.model.auto.Windturbineinfoday3;
 import com.gyee.frame.model.custom.StatisticalAnalysisTopVo;
-import com.gyee.frame.model.custom.StatisticalAnalysisWarningTopVo;
+import com.gyee.frame.model.custom.SawVo;
 import com.gyee.frame.model.custom.Tablepar;
 import com.gyee.frame.service.leaderboard.LeaderboardService;
 import com.gyee.frame.util.DateUtils;
 import com.gyee.frame.util.StringUtils;
-import oracle.jdbc.proxy.annotation.Post;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -349,7 +348,7 @@ public class LeaderboardController {
         {
             endDate_d= DateUtils.parseDate(endDate);
         }
-        List<StatisticalAnalysisWarningTopVo> vos= leaderboardService.getWarningTopDate( tablepar, type, beginDate_d, endDate_d);
+        List<SawVo> vos= leaderboardService.getWarningTopDate( tablepar, type, beginDate_d, endDate_d);
 
 
         if (vos != null && !vos.isEmpty()) {
@@ -375,7 +374,7 @@ public class LeaderboardController {
         {
             endDate_d= DateUtils.parseDate(endDate);
         }
-        List<StatisticalAnalysisWarningTopVo> vos=
+        List<SawVo> vos=
                 leaderboardService.getWarningTopDatePercentage( type, beginDate_d, endDate_d);
 
 

+ 11 - 1
src/main/java/com/gyee/frame/mapper/auto/WarningInfoDayMapper.java

@@ -2,9 +2,12 @@ package com.gyee.frame.mapper.auto;
 
 import com.gyee.frame.model.auto.WarningInfoDay;
 import com.gyee.frame.model.auto.WarningInfoDayExample;
-import java.util.List;
+import com.gyee.frame.model.custom.SawVo;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.Date;
+import java.util.List;
+
 public interface WarningInfoDayMapper {
     /**
      * This method was generated by MyBatis Generator.
@@ -93,4 +96,11 @@ public interface WarningInfoDayMapper {
      * @mbg.generated
      */
     int updateByPrimaryKey(WarningInfoDay record);
+
+    List<SawVo> getWarningInfoDayByWarningid(@Param("beginDate") Date beginDate, @Param("endDate") Date endDate, @Param("order") String order);
+
+    List<SawVo> getWarningInfoDayByWarningClassify(@Param("beginDate") Date beginDate, @Param("endDate") Date endDate, @Param("order") String order);
+
+    List<SawVo> getWarningInfoDayByManufacturer(@Param("beginDate") Date beginDate, @Param("endDate") Date endDate, @Param("order") String order);
+
 }

+ 1 - 1
src/main/java/com/gyee/frame/model/custom/StatisticalAnalysisWarningTopVo.java

@@ -1,6 +1,6 @@
 package com.gyee.frame.model.custom;
 
-public class StatisticalAnalysisWarningTopVo implements java.io.Serializable {
+public class SawVo implements java.io.Serializable {
 
 	// Fields
 

+ 115 - 271
src/main/java/com/gyee/frame/service/WarningInfoDayService.java

@@ -1,11 +1,13 @@
 package com.gyee.frame.service;
 
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 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.WarningInfoDayMapper;
 import com.gyee.frame.model.auto.*;
-import com.gyee.frame.model.custom.StatisticalAnalysisWarningTopVo;
+import com.gyee.frame.model.custom.SawVo;
 import com.gyee.frame.model.custom.Tablepar;
 import com.gyee.frame.util.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -20,240 +22,135 @@ import java.util.*;
 public class WarningInfoDayService implements BaseService<WarningInfoDay, WarningInfoDayExample> {
 	@Autowired
 	private WarningInfoDayMapper warningInfoDayMapper;
-	
+
 
 	@Override
 	public int deleteByPrimaryKey(String ids) {
-				
-			List<Integer> lista=Convert.toIntArrayList(ids);
-			WarningInfoDayExample example=new WarningInfoDayExample();
-			example.createCriteria().andIdIn(lista);
-			return warningInfoDayMapper.deleteByExample(example);
-			
-				
+
+		List<Integer> lista=Convert.toIntArrayList(ids);
+		WarningInfoDayExample example=new WarningInfoDayExample();
+		example.createCriteria().andIdIn(lista);
+		return warningInfoDayMapper.deleteByExample(example);
+
+
 	}
-	
-	
+
+
 	@Override
 	public WarningInfoDay selectByPrimaryKey(String id) {
-				
-			return warningInfoDayMapper.selectByPrimaryKey(Integer.valueOf(id));
-				
+
+		return warningInfoDayMapper.selectByPrimaryKey(Integer.valueOf(id));
+
 	}
 
-	
+
 	@Override
 	public int updateByPrimaryKeySelective(WarningInfoDay record) {
 		return warningInfoDayMapper.updateByPrimaryKeySelective(record);
 	}
-	
-	
+
+
 	/**
 	 * 添加
 	 */
 	@Override
 	public int insertSelective(WarningInfoDay record) {
-				
-			
-				
+
+
+
 		return warningInfoDayMapper.insertSelective(record);
 	}
-	
-	
+
+
 	@Override
 	public int updateByExampleSelective(WarningInfoDay record, WarningInfoDayExample example) {
-		
+
 		return warningInfoDayMapper.updateByExampleSelective(record, example);
 	}
 
-	
+
 	@Override
 	public int updateByExample(WarningInfoDay record, WarningInfoDayExample example) {
-		
+
 		return warningInfoDayMapper.updateByExample(record, example);
 	}
 
 	@Override
 	public List<WarningInfoDay> selectByExample(WarningInfoDayExample example) {
-		
+
 		return warningInfoDayMapper.selectByExample(example);
 	}
 
-	
+
 	@Override
 	public long countByExample(WarningInfoDayExample example) {
-		
+
 		return warningInfoDayMapper.countByExample(example);
 	}
 
-	
+
 	@Override
 	public int deleteByExample(WarningInfoDayExample example) {
-		
+
 		return warningInfoDayMapper.deleteByExample(example);
 	}
 
 
-	public List<StatisticalAnalysisWarningTopVo> getWarningInfoDayByWarningid(Tablepar tablepar,Date beginDate, Date endDate)  {
-
-		List<StatisticalAnalysisWarningTopVo> list =new ArrayList<>();
+	public List<SawVo> getWarningInfoDayByWarningid(Tablepar tablepar, Date beginDate, Date endDate)  {
 
-		WarningInfoDayExample example=new WarningInfoDayExample();
-		example.setOrderByClause(" frequencyday desc");
-
-
-		WarningInfoDayExample.Criteria criteria =example.createCriteria();
-
-		criteria.andRecorddateGreaterThanOrEqualTo(beginDate).andRecorddateLessThanOrEqualTo(endDate);
-
-		List<WarningInfoDay> wils=warningInfoDayMapper.selectByExample(example);
-
-		Map<String, List<WarningInfoDay>> lsMap = new LinkedHashMap<>();
-		if(!wils.isEmpty())
+		List<SawVo> list =new ArrayList<>();;
+		String order =null;
+		if(StringUtils.isNotEmpty(tablepar.getOrderByColumn()))
 		{
-			for(WarningInfoDay ap:wils)
+			StringBuilder sb=new StringBuilder();
+			sb.append(" ").append(tablepar.getOrderByColumn());
+			if(StringUtils.isNotEmpty(tablepar.getIsAsc()))
 			{
-				List<WarningInfoDay> items=null;
-				if (lsMap.containsKey(ap.getWarningid())) {
-					items = lsMap.get(ap.getWarningid());
-					items.add(ap);
-					lsMap.put(ap.getWarningid(), items);
-				} else {
-					items = new ArrayList<>();
-					items.add(ap);
-					lsMap.put(ap.getWarningid(), items);
-				}
-
-			}
-
-
-			Set<Map.Entry<String, List<WarningInfoDay>>> set = lsMap.entrySet();
-			int i=0;
-			for (Iterator<Map.Entry<String, List<WarningInfoDay>>> it = set.iterator(); it.hasNext();) {
-				Map.Entry<String, List<WarningInfoDay>> entry = (Map.Entry<String, List<WarningInfoDay>>) it.next();
-				System.out.println(entry.getKey() + "--->" + entry.getValue());
-
-				List<WarningInfoDay> ls=entry.getValue();
-
-				Warning2 warning= InitialRunner.warningmap.get(entry.getKey());
-
-				StatisticalAnalysisWarningTopVo item = new StatisticalAnalysisWarningTopVo();
-				item.setNum(i++);
-				item.setName(warning.getChinesetext());
-				int frequencyday=ls.stream().mapToInt(WarningInfoDay::getFrequencyday).sum();//合计
-				double totalhoursday=ls.stream().mapToDouble(WarningInfoDay::getTotalhoursday).sum();//合计
-				item.setFrequency(frequencyday);
-				item.setFrequencyday(frequencyday);
-				item.setTotalhours(totalhoursday);
-
-				if(i<10)
-				{
-					list.add(item);
-				}else
-				{
-					break;
-				}
+				sb.append(" ").append(tablepar.getIsAsc());
+			}else
+			{
+				sb.append(" asc ");
 			}
-
-			list=sortStatisticalAnalysisWarningTopVoList(tablepar,list);
+			order=String.valueOf(sb);
+		}else {
+			order=" frequencyday desc";
 		}
+		PageHelper.startPage(0, 10);
+		list =warningInfoDayMapper.getWarningInfoDayByWarningid(beginDate, endDate,order);
+		PageInfo<SawVo> pageInfo = new PageInfo<SawVo>(list);
 		return list;
 
 	}
 
 
-	public List<StatisticalAnalysisWarningTopVo> getWarningInfoDayByWarningClassify(Tablepar tablepar,Date beginDate, Date endDate)  {
+	public List<SawVo> getWarningInfoDayByWarningClassify(Tablepar tablepar, Date beginDate, Date endDate)  {
 
-		List<StatisticalAnalysisWarningTopVo> list =new ArrayList<>();
-
-		WarningInfoDayExample example=new WarningInfoDayExample();
-		example.setOrderByClause("frequencyday desc");
-
-
-		WarningInfoDayExample.Criteria criteria =example.createCriteria();
-
-		criteria.andRecorddateGreaterThanOrEqualTo(beginDate).andRecorddateLessThanOrEqualTo(endDate);
-
-		List<WarningInfoDay> wils=warningInfoDayMapper.selectByExample(example);
-
-		Map<String, List<WarningInfoDay>> lsMap = new LinkedHashMap<String, List<WarningInfoDay>>();
-		if(!wils.isEmpty())
+		List<SawVo> list =new ArrayList<>();;
+		String order =null;
+		if(StringUtils.isNotEmpty(tablepar.getOrderByColumn()))
 		{
-			for(WarningInfoDay ap:wils)
+			StringBuilder sb=new StringBuilder();
+			sb.append(" ").append(tablepar.getOrderByColumn());
+			if(StringUtils.isNotEmpty(tablepar.getIsAsc()))
 			{
-				Warning2 warning=null;
-				if(InitialRunner.warningmap.containsKey(ap.getWarningid()))
-				{
-					warning=InitialRunner.warningmap.get(ap.getWarningid());
-				}
-
-				List<WarningInfoDay> items=null;
-				if(StringUtils.notEmp(warning) && StringUtils.notEmp(warning.getWarningclassifyid()) && !warning.getWarningclassifyid().equals(""))
-				{
-						WarningClassify warningClassify=null;
-						if(InitialRunner.warningClassifymap.containsKey(warning.getWarningclassifyid()))
-						{
-							warningClassify=InitialRunner.warningClassifymap.get(warning.getWarningclassifyid());
-						}
-						if(StringUtils.notEmp(warningClassify))
-						{
-							if (lsMap.containsKey(warningClassify.getName())) {
-								items = lsMap.get(warningClassify.getName());
-								items.add(ap);
-								lsMap.put(warningClassify.getName(), items);
-							} else {
-								items = new ArrayList<>();
-								items.add(ap);
-								lsMap.put(warningClassify.getName(), items);
-							}
-						}
-
-
-				}
-
-
-
-
-
-
-			}
-
-
-			Set<Map.Entry<String, List<WarningInfoDay>>> set = lsMap.entrySet();
-			int i=0;
-			for (Iterator<Map.Entry<String, List<WarningInfoDay>>> it = set.iterator(); it.hasNext();) {
-				Map.Entry<String, List<WarningInfoDay>> entry = (Map.Entry<String, List<WarningInfoDay>>) it.next();
-				System.out.println(entry.getKey() + "--->" + entry.getValue());
-
-				List<WarningInfoDay> ls=entry.getValue();
-
-				Warning2 warning= InitialRunner.warningmap.get(entry.getKey());
-
-				StatisticalAnalysisWarningTopVo item = new StatisticalAnalysisWarningTopVo();
-				item.setNum(i++);
-				item.setName(entry.getKey());
-				int frequencyday=ls.stream().mapToInt(WarningInfoDay::getFrequencyday).sum();//合计
-				double totalhoursday=ls.stream().mapToDouble(WarningInfoDay::getTotalhoursday).sum();//合计
-				item.setFrequency(frequencyday);
-				item.setFrequencyday(frequencyday);
-				item.setTotalhours(totalhoursday);
-
-				if(i<10)
-				{
-					list.add(item);
-				}else
-				{
-					break;
-				}
+				sb.append(" ").append(tablepar.getIsAsc());
+			}else
+			{
+				sb.append(" asc ");
 			}
-			list=sortStatisticalAnalysisWarningTopVoList(tablepar,list);
+			order=String.valueOf(sb);
+		}else {
+			order=" frequencyday desc";
 		}
+		PageHelper.startPage(0, 10);
+		list =warningInfoDayMapper.getWarningInfoDayByWarningid(beginDate, endDate,order);
+		PageInfo<SawVo> pageInfo = new PageInfo<SawVo>(list);
 		return list;
 
 	}
 
 
-	public  List<StatisticalAnalysisWarningTopVo> sortStatisticalAnalysisWarningTopVoList(Tablepar tablepar,List<StatisticalAnalysisWarningTopVo> ls)
+	public  List<SawVo> sortStatisticalAnalysisWarningTopVoList(Tablepar tablepar, List<SawVo> ls)
 	{
 
 		if (null !=tablepar && StringUtils.notEmp(tablepar.getOrderByColumn())) {
@@ -262,17 +159,17 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
 				case "name":
 					if (tablepar.getIsAsc().equals("asc")) {
 
-						Collections.sort(ls, new Comparator<StatisticalAnalysisWarningTopVo>() {
+						Collections.sort(ls, new Comparator<SawVo>() {
 							// 升序排序
-							public int compare(StatisticalAnalysisWarningTopVo o1, StatisticalAnalysisWarningTopVo o2) {
+							public int compare(SawVo o1, SawVo o2) {
 								return o1.getName().compareTo(o2.getName());
 							}
 
 						});
 					} else   {
-						Collections.sort(ls, new Comparator<StatisticalAnalysisWarningTopVo>() {
+						Collections.sort(ls, new Comparator<SawVo>() {
 							// 升序排序
-							public int compare(StatisticalAnalysisWarningTopVo o1, StatisticalAnalysisWarningTopVo o2) {
+							public int compare(SawVo o1, SawVo o2) {
 								return o2.getName().compareTo(o1.getName());
 							}
 
@@ -282,17 +179,17 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
 				case "frequency":
 					if (tablepar.getIsAsc().equals("asc")) {
 
-						Collections.sort(ls, new Comparator<StatisticalAnalysisWarningTopVo>() {
+						Collections.sort(ls, new Comparator<SawVo>() {
 							// 升序排序
-							public int compare(StatisticalAnalysisWarningTopVo o1, StatisticalAnalysisWarningTopVo o2) {
+							public int compare(SawVo o1, SawVo o2) {
 								return o1.getFrequency().compareTo(o2.getFrequency());
 							}
 
 						});
 					} else   {
-						Collections.sort(ls, new Comparator<StatisticalAnalysisWarningTopVo>() {
+						Collections.sort(ls, new Comparator<SawVo>() {
 							// 升序排序
-							public int compare(StatisticalAnalysisWarningTopVo o1, StatisticalAnalysisWarningTopVo o2) {
+							public int compare(SawVo o1, SawVo o2) {
 								return o2.getFrequency().compareTo(o1.getFrequency());
 							}
 
@@ -302,17 +199,17 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
 				case "frequencyday":
 					if (tablepar.getIsAsc().equals("asc")) {
 
-						Collections.sort(ls, new Comparator<StatisticalAnalysisWarningTopVo>() {
+						Collections.sort(ls, new Comparator<SawVo>() {
 							// 升序排序
-							public int compare(StatisticalAnalysisWarningTopVo o1, StatisticalAnalysisWarningTopVo o2) {
+							public int compare(SawVo o1, SawVo o2) {
 								return o1.getFrequencyday().compareTo(o2.getFrequencyday());
 							}
 
 						});
 					} else   {
-						Collections.sort(ls, new Comparator<StatisticalAnalysisWarningTopVo>() {
+						Collections.sort(ls, new Comparator<SawVo>() {
 							// 升序排序
-							public int compare(StatisticalAnalysisWarningTopVo o1, StatisticalAnalysisWarningTopVo o2) {
+							public int compare(SawVo o1, SawVo o2) {
 								return o2.getFrequencyday().compareTo(o1.getFrequencyday());
 							}
 
@@ -322,17 +219,17 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
 				case "totalhours":
 					if (tablepar.getIsAsc().equals("asc")) {
 
-						Collections.sort(ls, new Comparator<StatisticalAnalysisWarningTopVo>() {
+						Collections.sort(ls, new Comparator<SawVo>() {
 							// 升序排序
-							public int compare(StatisticalAnalysisWarningTopVo o1, StatisticalAnalysisWarningTopVo o2) {
+							public int compare(SawVo o1, SawVo o2) {
 								return o1.getTotalhours().compareTo(o2.getTotalhours());
 							}
 
 						});
 					} else   {
-						Collections.sort(ls, new Comparator<StatisticalAnalysisWarningTopVo>() {
+						Collections.sort(ls, new Comparator<SawVo>() {
 							// 升序排序
-							public int compare(StatisticalAnalysisWarningTopVo o1, StatisticalAnalysisWarningTopVo o2) {
+							public int compare(SawVo o1, SawVo o2) {
 								return o2.getTotalhours().compareTo(o1.getTotalhours());
 							}
 
@@ -349,82 +246,29 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
 	}
 
 
-	public List<StatisticalAnalysisWarningTopVo> getWarningInfoDayByManufacturer(Tablepar tablepar,Date beginDate, Date endDate)  {
-
-		List<StatisticalAnalysisWarningTopVo> list =new ArrayList<>();
+	public List<SawVo> getWarningInfoDayByManufacturer(Tablepar tablepar, Date beginDate, Date endDate)  {
 
-		WarningInfoDayExample example=new WarningInfoDayExample();
-		example.setOrderByClause("frequencyday desc");
-
-
-		WarningInfoDayExample.Criteria criteria =example.createCriteria();
-
-		criteria.andRecorddateGreaterThanOrEqualTo(beginDate).andRecorddateLessThanOrEqualTo(endDate);
 
-		List<WarningInfoDay> wils=warningInfoDayMapper.selectByExample(example);
-
-		Map<String, List<WarningInfoDay>> lsMap = new LinkedHashMap<String, List<WarningInfoDay>>();
-		if(!wils.isEmpty())
+		List<SawVo> list =new ArrayList<>();;
+		String order =null;
+		if(StringUtils.isNotEmpty(tablepar.getOrderByColumn()))
 		{
-			for(WarningInfoDay ap:wils)
+			StringBuilder sb=new StringBuilder();
+			sb.append(" ").append(tablepar.getOrderByColumn());
+			if(StringUtils.isNotEmpty(tablepar.getIsAsc()))
 			{
-				Manufacturer manufacturer=null;
-
-				if(InitialRunner.manufacturermap.containsKey(ap.getManufacturerid()))
-				{
-					 manufacturer=InitialRunner.manufacturermap.get(ap.getManufacturerid());
-
-				}
-
-				List<WarningInfoDay> items=null;
-
-				if(null!=manufacturer)
-				{
-					if (lsMap.containsKey(manufacturer.getName())) {
-						items = lsMap.get(manufacturer.getName());
-						items.add(ap);
-						lsMap.put(manufacturer.getName(), items);
-					} else {
-						items = new ArrayList<>();
-						items.add(ap);
-						lsMap.put(manufacturer.getName(), items);
-					}
-				}
-
-
-			}
-
-
-			Set<Map.Entry<String, List<WarningInfoDay>>> set = lsMap.entrySet();
-			int i=0;
-			for (Iterator<Map.Entry<String, List<WarningInfoDay>>> it = set.iterator(); it.hasNext();) {
-				Map.Entry<String, List<WarningInfoDay>> entry = (Map.Entry<String, List<WarningInfoDay>>) it.next();
-				System.out.println(entry.getKey() + "--->" + entry.getValue());
-
-				List<WarningInfoDay> ls=entry.getValue();
-
-				Warning2 warning= InitialRunner.warningmap.get(entry.getKey());
-
-				StatisticalAnalysisWarningTopVo item = new StatisticalAnalysisWarningTopVo();
-				item.setNum(i++);
-				item.setName(entry.getKey());
-				int frequencyday=ls.stream().mapToInt(WarningInfoDay::getFrequencyday).sum();//合计
-				double totalhoursday=ls.stream().mapToDouble(WarningInfoDay::getTotalhoursday).sum();//合计
-				item.setFrequency(frequencyday);
-				item.setFrequencyday(frequencyday);
-				item.setTotalhours(totalhoursday);
-
-				if(i<10)
-				{
-					list.add(item);
-				}else
-				{
-					break;
-				}
+				sb.append(" ").append(tablepar.getIsAsc());
+			}else
+			{
+				sb.append(" asc ");
 			}
-
-			list=sortStatisticalAnalysisWarningTopVoList(tablepar,list);
+			order=String.valueOf(sb);
+		}else {
+			order=" frequencyday desc";
 		}
+		PageHelper.startPage(0, 10);
+		list =warningInfoDayMapper.getWarningInfoDayByManufacturer(beginDate, endDate,order);
+		PageInfo<SawVo> pageInfo = new PageInfo<SawVo>(list);
 		return list;
 
 	}
@@ -433,9 +277,9 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
 
 
 
-	public List<StatisticalAnalysisWarningTopVo> getWarningInfoDayByWarningidPercentage(Date beginDate, Date endDate)  {
+	public List<SawVo> getWarningInfoDayByWarningidPercentage(Date beginDate, Date endDate)  {
 
-		List<StatisticalAnalysisWarningTopVo> list =new ArrayList<>();
+		List<SawVo> list =new ArrayList<>();
 
 		WarningInfoDayExample example=new WarningInfoDayExample();
 		example.setOrderByClause("frequencyday desc");
@@ -478,7 +322,7 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
 
 				Warning2 warning= InitialRunner.warningmap.get(entry.getKey());
 
-				StatisticalAnalysisWarningTopVo item = new StatisticalAnalysisWarningTopVo();
+				SawVo item = new SawVo();
 				item.setNum(i++);
 				item.setName(warning.getChinesetext());
 				int frequencyday=ls.stream().mapToInt(WarningInfoDay::getFrequencyday).sum();//合计
@@ -497,7 +341,7 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
 			}
 
 			int sum = 0;
-			for (StatisticalAnalysisWarningTopVo item : list) {
+			for (SawVo item : list) {
 				sum += item.getFrequency();
 				if (total != 0) {
 					BigDecimal b1 = new BigDecimal(item.getFrequency());
@@ -510,7 +354,7 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
 			}
 
 			if (sum != total) {
-				StatisticalAnalysisWarningTopVo item = new StatisticalAnalysisWarningTopVo();
+				SawVo item = new SawVo();
 				item.setNum(i++);
 				item.setName("其他");
 				item.setFrequency(sum);
@@ -529,9 +373,9 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
 	}
 
 
-	public List<StatisticalAnalysisWarningTopVo> getWarningInfoDayByWarningClassifyPercentage(Date beginDate, Date endDate)  {
+	public List<SawVo> getWarningInfoDayByWarningClassifyPercentage(Date beginDate, Date endDate)  {
 
-		List<StatisticalAnalysisWarningTopVo> list =new ArrayList<>();
+		List<SawVo> list =new ArrayList<>();
 
 		WarningInfoDayExample example=new WarningInfoDayExample();
 		example.setOrderByClause("frequencyday desc");
@@ -591,7 +435,7 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
 
 				Warning2 warning= InitialRunner.warningmap.get(entry.getKey());
 
-				StatisticalAnalysisWarningTopVo item = new StatisticalAnalysisWarningTopVo();
+				SawVo item = new SawVo();
 				item.setNum(i++);
 				item.setName(entry.getKey());
 				int frequencyday=ls.stream().mapToInt(WarningInfoDay::getFrequencyday).sum();//合计
@@ -610,7 +454,7 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
 			}
 
 			int sum = 0;
-			for (StatisticalAnalysisWarningTopVo item : list) {
+			for (SawVo item : list) {
 				sum += item.getFrequency();
 				if (total != 0) {
 					BigDecimal b1 = new BigDecimal(item.getFrequency());
@@ -623,7 +467,7 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
 			}
 
 			if (sum != total) {
-				StatisticalAnalysisWarningTopVo item = new StatisticalAnalysisWarningTopVo();
+				SawVo item = new SawVo();
 				item.setNum(i++);
 				item.setName("其他");
 				item.setFrequency(sum);
@@ -644,9 +488,9 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
 
 
 
-	public List<StatisticalAnalysisWarningTopVo> getWarningInfoDayByManufacturerPercentage(Date beginDate, Date endDate)  {
+	public List<SawVo> getWarningInfoDayByManufacturerPercentage(Date beginDate, Date endDate)  {
 
-		List<StatisticalAnalysisWarningTopVo> list =new ArrayList<>();
+		List<SawVo> list =new ArrayList<>();
 
 		WarningInfoDayExample example=new WarningInfoDayExample();
 		example.setOrderByClause("frequencyday desc");
@@ -699,7 +543,7 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
 
 				Warning2 warning= InitialRunner.warningmap.get(entry.getKey());
 
-				StatisticalAnalysisWarningTopVo item = new StatisticalAnalysisWarningTopVo();
+				SawVo item = new SawVo();
 				item.setNum(i++);
 				item.setName(entry.getKey());
 				int frequencyday=ls.stream().mapToInt(WarningInfoDay::getFrequencyday).sum();//合计
@@ -719,7 +563,7 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
 			}
 
 			int sum = 0;
-			for (StatisticalAnalysisWarningTopVo item : list) {
+			for (SawVo item : list) {
 				sum += item.getFrequency();
 				if (total != 0) {
 					BigDecimal b1 = new BigDecimal(item.getFrequency());
@@ -732,7 +576,7 @@ public class WarningInfoDayService implements BaseService<WarningInfoDay, Warnin
 			}
 
 			if (sum != total) {
-				StatisticalAnalysisWarningTopVo item = new StatisticalAnalysisWarningTopVo();
+				SawVo item = new SawVo();
 				item.setNum(i++);
 				item.setName("其他");
 				item.setFrequency(sum);

+ 25 - 25
src/main/java/com/gyee/frame/service/WarningRecordsService.java

@@ -9,7 +9,7 @@ import com.gyee.frame.mapper.auto.WarningRecordsMapper;
 import com.gyee.frame.model.auto.Warning2;
 import com.gyee.frame.model.auto.WarningRecords;
 import com.gyee.frame.model.auto.WarningRecordsExample;
-import com.gyee.frame.model.custom.StatisticalAnalysisWarningTopVo;
+import com.gyee.frame.model.custom.SawVo;
 import com.gyee.frame.model.custom.Tablepar;
 import com.gyee.frame.util.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -149,10 +149,10 @@ public class WarningRecordsService implements BaseService<WarningRecords, Warnin
 
 
 
-	public List<StatisticalAnalysisWarningTopVo> getWarningRecordsTop5(Tablepar tablepar, String wtId, Date beginDate,Date endDate) {
+	public List<SawVo> getWarningRecordsTop5(Tablepar tablepar, String wtId, Date beginDate, Date endDate) {
 
-		List<StatisticalAnalysisWarningTopVo> sawlist=new ArrayList<>();
-		List<StatisticalAnalysisWarningTopVo> templist=new ArrayList<>();
+		List<SawVo> sawlist=new ArrayList<>();
+		List<SawVo> templist=new ArrayList<>();
 		WarningRecordsExample example = new WarningRecordsExample();
 
 		WarningRecordsExample.Criteria criteria = example.createCriteria();
@@ -195,7 +195,7 @@ public class WarningRecordsService implements BaseService<WarningRecords, Warnin
 
 				Warning2 warning= InitialRunner.warningmap.get(entry.getKey());
 
-				StatisticalAnalysisWarningTopVo item = new StatisticalAnalysisWarningTopVo();
+				SawVo item = new SawVo();
 				item.setNum(i++);
 				item.setName(warning.getChinesetext());
 				item.setFrequency(ls.size());
@@ -204,16 +204,16 @@ public class WarningRecordsService implements BaseService<WarningRecords, Warnin
 			}
 
 
-			Collections.sort(templist, new Comparator<StatisticalAnalysisWarningTopVo>() {
+			Collections.sort(templist, new Comparator<SawVo>() {
 				// 升序排序
-				public int compare(StatisticalAnalysisWarningTopVo o1, StatisticalAnalysisWarningTopVo o2) {
+				public int compare(SawVo o1, SawVo o2) {
 					return o2.getFrequency().compareTo(o1.getFrequency());
 				}
 
 			});
 
 			i=0;
-			for(StatisticalAnalysisWarningTopVo vo:templist)
+			for(SawVo vo:templist)
 			{
 				if(i<5)
 				{
@@ -227,7 +227,7 @@ public class WarningRecordsService implements BaseService<WarningRecords, Warnin
 
 		return sawlist;
 	}
-	public  List<StatisticalAnalysisWarningTopVo> sortStatisticalAnalysisWarningTopVoList(Tablepar tablepar,List<StatisticalAnalysisWarningTopVo> ls)
+	public  List<SawVo> sortStatisticalAnalysisWarningTopVoList(Tablepar tablepar, List<SawVo> ls)
 	{
 
 		if (null !=tablepar && StringUtils.notEmp(tablepar.getOrderByColumn())) {
@@ -236,17 +236,17 @@ public class WarningRecordsService implements BaseService<WarningRecords, Warnin
 				case "name":
 					if (tablepar.getIsAsc().equals("asc")) {
 
-						Collections.sort(ls, new Comparator<StatisticalAnalysisWarningTopVo>() {
+						Collections.sort(ls, new Comparator<SawVo>() {
 							// 升序排序
-							public int compare(StatisticalAnalysisWarningTopVo o1, StatisticalAnalysisWarningTopVo o2) {
+							public int compare(SawVo o1, SawVo o2) {
 								return o1.getName().compareTo(o2.getName());
 							}
 
 						});
 					} else   {
-						Collections.sort(ls, new Comparator<StatisticalAnalysisWarningTopVo>() {
+						Collections.sort(ls, new Comparator<SawVo>() {
 							// 升序排序
-							public int compare(StatisticalAnalysisWarningTopVo o1, StatisticalAnalysisWarningTopVo o2) {
+							public int compare(SawVo o1, SawVo o2) {
 								return o2.getName().compareTo(o1.getName());
 							}
 
@@ -256,17 +256,17 @@ public class WarningRecordsService implements BaseService<WarningRecords, Warnin
 				case "frequency":
 					if (tablepar.getIsAsc().equals("asc")) {
 
-						Collections.sort(ls, new Comparator<StatisticalAnalysisWarningTopVo>() {
+						Collections.sort(ls, new Comparator<SawVo>() {
 							// 升序排序
-							public int compare(StatisticalAnalysisWarningTopVo o1, StatisticalAnalysisWarningTopVo o2) {
+							public int compare(SawVo o1, SawVo o2) {
 								return o1.getFrequency().compareTo(o2.getFrequency());
 							}
 
 						});
 					} else   {
-						Collections.sort(ls, new Comparator<StatisticalAnalysisWarningTopVo>() {
+						Collections.sort(ls, new Comparator<SawVo>() {
 							// 升序排序
-							public int compare(StatisticalAnalysisWarningTopVo o1, StatisticalAnalysisWarningTopVo o2) {
+							public int compare(SawVo o1, SawVo o2) {
 								return o2.getFrequency().compareTo(o1.getFrequency());
 							}
 
@@ -276,17 +276,17 @@ public class WarningRecordsService implements BaseService<WarningRecords, Warnin
 				case "frequencyday":
 					if (tablepar.getIsAsc().equals("asc")) {
 
-						Collections.sort(ls, new Comparator<StatisticalAnalysisWarningTopVo>() {
+						Collections.sort(ls, new Comparator<SawVo>() {
 							// 升序排序
-							public int compare(StatisticalAnalysisWarningTopVo o1, StatisticalAnalysisWarningTopVo o2) {
+							public int compare(SawVo o1, SawVo o2) {
 								return o1.getFrequencyday().compareTo(o2.getFrequencyday());
 							}
 
 						});
 					} else   {
-						Collections.sort(ls, new Comparator<StatisticalAnalysisWarningTopVo>() {
+						Collections.sort(ls, new Comparator<SawVo>() {
 							// 升序排序
-							public int compare(StatisticalAnalysisWarningTopVo o1, StatisticalAnalysisWarningTopVo o2) {
+							public int compare(SawVo o1, SawVo o2) {
 								return o2.getFrequencyday().compareTo(o1.getFrequencyday());
 							}
 
@@ -296,17 +296,17 @@ public class WarningRecordsService implements BaseService<WarningRecords, Warnin
 				case "totalhours":
 					if (tablepar.getIsAsc().equals("asc")) {
 
-						Collections.sort(ls, new Comparator<StatisticalAnalysisWarningTopVo>() {
+						Collections.sort(ls, new Comparator<SawVo>() {
 							// 升序排序
-							public int compare(StatisticalAnalysisWarningTopVo o1, StatisticalAnalysisWarningTopVo o2) {
+							public int compare(SawVo o1, SawVo o2) {
 								return o1.getTotalhours().compareTo(o2.getTotalhours());
 							}
 
 						});
 					} else   {
-						Collections.sort(ls, new Comparator<StatisticalAnalysisWarningTopVo>() {
+						Collections.sort(ls, new Comparator<SawVo>() {
 							// 升序排序
-							public int compare(StatisticalAnalysisWarningTopVo o1, StatisticalAnalysisWarningTopVo o2) {
+							public int compare(SawVo o1, SawVo o2) {
 								return o2.getTotalhours().compareTo(o1.getTotalhours());
 							}
 

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

@@ -221,6 +221,7 @@ public class WindturbinecurvefittingService implements BaseService<Windturbinecu
 		list= windturbinecurvefittingMapper.selectByExample(example);
 		PageInfo<Windturbinecurvefitting> pageInfo = new PageInfo<Windturbinecurvefitting>(list);
 
+
 		return pageInfo;
 
 	}

+ 4 - 4
src/main/java/com/gyee/frame/service/leaderboard/LeaderboardService.java

@@ -325,8 +325,8 @@ public class LeaderboardService {
     }
 
 
-    public List<StatisticalAnalysisWarningTopVo> getWarningTopDate(Tablepar tablepar,String type,  Date beginDate,  Date endDate)  {
-        List<StatisticalAnalysisWarningTopVo> vos=new ArrayList<>();
+    public List<SawVo> getWarningTopDate(Tablepar tablepar, String type, Date beginDate, Date endDate)  {
+        List<SawVo> vos=new ArrayList<>();
 
         if(StringUtils.isNotEmpty(type))
         {
@@ -348,8 +348,8 @@ public class LeaderboardService {
 
         return vos;
     }
-    public List<StatisticalAnalysisWarningTopVo> getWarningTopDatePercentage(String type,  Date beginDate,  Date endDate)  {
-        List<StatisticalAnalysisWarningTopVo> vos=new ArrayList<>();
+    public List<SawVo> getWarningTopDatePercentage(String type, Date beginDate, Date endDate)  {
+        List<SawVo> vos=new ArrayList<>();
 
         if(StringUtils.isNotEmpty(type))
         {

+ 33 - 0
src/main/resources/mybatis/auto/WarningInfoDayMapper.xml

@@ -395,4 +395,37 @@
       totalHours = #{totalhours,jdbcType=DECIMAL}
     where id = #{id,jdbcType=INTEGER}
   </update>
+
+  <select id="getWarningInfoDayByWarningid"  resultType="com.gyee.frame.model.custom.SawVo">
+
+
+    SELECT    Warning2.chineseText   name,SUM(WarningInfoDay.frequencyDay)   frequencyday, SUM(WarningInfoDay.totalhoursDay)  totalhoursday,
+    WarningInfoDay.warningId,equipmentmodel.name  model
+    FROM WarningInfoDay LEFT JOIN Warning2 ON WarningInfoDay.warningId = Warning2.id INNER JOIN equipmentmodel ON
+    WarningInfoDay.modelid = equipmentmodel.id
+    AND WarningInfoDay.modelId = equipmentmodel.id  WHERE (
+
+    WarningInfoDay.recordDate>= #{beginDate} AND WarningInfoDay.recordDate &lt; #{endDate}
+    )
+    GROUP BY Warning2.chineseText, WarningInfoDay.warningId, equipmentmodel.name  order by  ${order}
+  </select>
+
+  <select id="getWarningInfoDayByWarningClassify"  resultType="com.gyee.frame.model.custom.SawVo">
+
+    SELECT    SUM(WarningInfoDay.frequencyDay) AS frequencyday, SUM(WarningInfoDay.totalhoursDay) AS totalhoursday, WarningClassify.name
+    FROM (SELECT  * FROM WarningInfoDay WHERE
+    WarningInfoDay.recordDate>= #{beginDate} AND WarningInfoDay.recordDate &lt; #{endDate}
+    WarningInfoDay LEFT JOIN Warning2 ON WarningInfoDay.warningId = Warning2.id RIGHT JOIN WarningClassify ON Warning2.warningClassifyId = WarningClassify.id
+    GROUP BY WarningClassify.name  order by  ${order}
+
+  </select>
+
+  <select id="getWarningInfoDayByManufacturer"  resultType="com.gyee.frame.model.custom.SawVo">
+    SELECT    WarningInfoDay.manufacturerId, SUM(WarningInfoDay.frequencyDay) AS frequencyday, SUM(WarningInfoDay.totalhoursDay) AS totalhoursday, Manufacturer.name
+     FROM  WarningInfoDay INNER JOIN Manufacturer ON WarningInfoDay.manufacturerId = Manufacturer.id WHERE
+    WarningInfoDay.recordDate>= #{beginDate} AND WarningInfoDay.recordDate &lt; #{endDate}
+    GROUP BY WarningInfoDay.manufacturerId, Manufacturer.name  order by  ${order}
+
+
+  </select>
 </mapper>