|
@@ -11,6 +11,7 @@ import com.gyee.common.vo.benchmark.FjjxbVo;
|
|
|
import com.gyee.common.vo.benchmark.FjjxbmxVo;
|
|
|
import com.gyee.common.vo.benchmark.WxsslVo;
|
|
|
import com.gyee.runeconomy.init.CacheContext;
|
|
|
+import com.gyee.runeconomy.mapper.auto.ProEconEquipmentInfoDay1Mapper;
|
|
|
import com.gyee.runeconomy.model.auto.*;
|
|
|
import com.gyee.runeconomy.service.TokenService;
|
|
|
import com.gyee.runeconomy.service.auto.IProEconEquipmentInfoDay1Service;
|
|
@@ -40,6 +41,9 @@ public class BenchmarkingService {
|
|
|
@Resource
|
|
|
private IProEconEquipmentInfoDay1Service proEconEquipmentInfoDay1Service;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private ProEconEquipmentInfoDay1Mapper proEconEquipmentInfoDay1Mapper;
|
|
|
+
|
|
|
public List<ProBasicCompany> companys() {
|
|
|
List<ProBasicCompany> cpls = CacheContext.cpls;
|
|
|
Map<String, ProBasicRegion> rgmap = CacheContext.rgmap;
|
|
@@ -562,8 +566,10 @@ public class BenchmarkingService {
|
|
|
|
|
|
|
|
|
|
|
|
- public List<WxsslVo> cndb(String companys, String type, String wpid, String beginDate, String endDate, String target, String sort) {
|
|
|
+ public Map<String, Object> cndb(String companys, String type, String wpid, String beginDate, String endDate, String target, String sort,int pageNum, int pageSize) {
|
|
|
QueryWrapper<ProEconEquipmentInfoDay1> qw = new QueryWrapper<>();
|
|
|
+ Integer total =0;
|
|
|
+
|
|
|
List<WxsslVo> resultList = new ArrayList<>();
|
|
|
qw.select("record_date,sum(rfdl) rfdl,sum(rllfdl) rllfdl,avg(rpjfs) rpjfs,sum(rjxssdl) rjxssdl,sum(rcnsljxssdl) rcnsljxssdl,sum(rgzssdl) rgzssdl,sum(rcnslgzssdl) rcnslgzssdl,sum(rxdtjssdl) rxdtjssdl,sum(rxdjclssdl) rxdjclssdl,sum(rdjssdl) rdjssdl,sum(rqxjclssdl) rqxjclssdl,sum(rsdtjssdl) rsdtjssdl,sum(rxnssdl) rxnssdl,sum(rcwsldwssdl) rcwsldwssdl,sum(rcwsltqssdl) rcwsltqssdl");
|
|
|
qw.ge("record_date",DateUtils.parseDate(beginDate)).le("record_date",DateUtils.parseDate(endDate));
|
|
@@ -581,7 +587,25 @@ public class BenchmarkingService {
|
|
|
qw.like("windturbine_id","_IN_");
|
|
|
}
|
|
|
qw.groupBy("record_date");
|
|
|
- List<WxsslVo> wxsslVoList = getWxsslSortVos(qw,resultList,TYPE_DATE);
|
|
|
+
|
|
|
+// total = proEconEquipmentInfoDay1Mapper.selectCount(qw);
|
|
|
+
|
|
|
+// qw1.ge("record_date",DateUtils.parseDate(beginDate)).le("record_date",DateUtils.parseDate(endDate));
|
|
|
+// if (StringUtils.isNotEmpty(wpid)){
|
|
|
+// qw1.eq("windpowerstation_id",wpid);
|
|
|
+// }
|
|
|
+// if (companys.endsWith("RGN")){
|
|
|
+// qw1.eq("region_id",companys);
|
|
|
+// }else {
|
|
|
+// qw1.eq("company_id",companys);
|
|
|
+// }
|
|
|
+// if (type.equals("-1")){
|
|
|
+// qw1.like("windturbine_id","_WT_");
|
|
|
+// }else {
|
|
|
+// qw1.like("windturbine_id","_IN_");
|
|
|
+// }
|
|
|
+
|
|
|
+ Map<String, Object> wxsslVoList = getWxsslSortVos(qw,total,resultList,TYPE_DATE,pageNum,pageSize);
|
|
|
if (StringUtils.isNotEmpty(target) && StringUtils.isNotEmpty(sort)){
|
|
|
if (sort.equals("1")){
|
|
|
SortUtils.sort(resultList,target,SortUtils.ASC);
|
|
@@ -597,8 +621,9 @@ public class BenchmarkingService {
|
|
|
|
|
|
|
|
|
|
|
|
- public List<WxsslVo> cndbthb(String companys, String type, String wpid, String beginDate, String endDate) {
|
|
|
+ public Map<String, Object> cndbthb(String companys, String type, String wpid, String beginDate, String endDate,int pageNum, int pageSize) {
|
|
|
QueryWrapper<ProEconEquipmentInfoDay1> qw = new QueryWrapper<>();
|
|
|
+ Integer total =0;
|
|
|
List<WxsslVo> resultList = new ArrayList<>();
|
|
|
qw.select("sum(rfdl) rfdl,sum(rllfdl) rllfdl,avg(rpjfs) rpjfs,sum(rjxssdl) rjxssdl,sum(rcnsljxssdl) rcnsljxssdl,sum(rgzssdl) rgzssdl,sum(rcnslgzssdl) rcnslgzssdl,sum(rxdtjssdl) rxdtjssdl,sum(rxdjclssdl) rxdjclssdl,sum(rdjssdl) rdjssdl,sum(rqxjclssdl) rqxjclssdl,sum(rsdtjssdl) rsdtjssdl,sum(rxnssdl) rxnssdl,sum(rcwsldwssdl) rcwsldwssdl,sum(rcwsltqssdl) rcwsltqssdl");
|
|
|
qw.ge("record_date",DateUtils.parseDate(beginDate)).le("record_date",DateUtils.parseDate(endDate));
|
|
@@ -616,13 +641,17 @@ public class BenchmarkingService {
|
|
|
qw.like("windturbine_id","_IN_");
|
|
|
}
|
|
|
qw.groupBy("windpowerstation_id");
|
|
|
- List<WxsslVo> wxsslVoList = getWxsslSortVos(qw,resultList,TYPE_DATE);
|
|
|
+
|
|
|
+// total = proEconEquipmentInfoDay1Mapper.selectCount(qw);
|
|
|
+
|
|
|
+ Map<String, Object> wxsslVoList = getWxsslSortVos(qw,total,resultList,TYPE_DATE,pageNum,pageSize);
|
|
|
return wxsslVoList;
|
|
|
}
|
|
|
|
|
|
- public List<WxsslVo> cjdb(String companys, String type, String wpids, String beginDate, String endDate, String target, String sort) {
|
|
|
+ public Map<String, Object> cjdb(String companys, String type, String wpids, String beginDate, String endDate, String target, String sort,int pageNum, int pageSize) {
|
|
|
List<WxsslVo> resultList = new ArrayList<>();
|
|
|
QueryWrapper<ProEconEquipmentInfoDay1> qw = new QueryWrapper<>();
|
|
|
+ Integer total =0;
|
|
|
qw.select("windpowerstation_id,sum(rfdl) rfdl,sum(rllfdl) rllfdl,avg(rpjfs) rpjfs,sum(rjxssdl) rjxssdl,sum(rcnsljxssdl) rcnsljxssdl,sum(rgzssdl) rgzssdl,sum(rcnslgzssdl) rcnslgzssdl,sum(rxdtjssdl) rxdtjssdl,sum(rxdjclssdl) rxdjclssdl,sum(rdjssdl) rdjssdl,sum(rqxjclssdl) rqxjclssdl,sum(rsdtjssdl) rsdtjssdl,sum(rxnssdl) rxnssdl,sum(rcwsldwssdl) rcwsldwssdl,sum(rcwsltqssdl) rcwsltqssdl");
|
|
|
|
|
|
qw.ge("record_date",DateUtils.parseDate(beginDate)).le("record_date",DateUtils.parseDate(endDate));
|
|
@@ -641,7 +670,10 @@ public class BenchmarkingService {
|
|
|
qw.like("windturbine_id","_IN_");
|
|
|
}
|
|
|
qw.groupBy("windpowerstation_id");
|
|
|
- List<WxsslVo> wxsslVoList = getWxsslSortVos(qw,resultList,TYPE_WIND);
|
|
|
+
|
|
|
+// total = proEconEquipmentInfoDay1Mapper.selectCount(qw);
|
|
|
+
|
|
|
+ Map<String, Object> wxsslVoList = getWxsslSortVos(qw,total,resultList,TYPE_WIND,pageNum,pageSize);
|
|
|
if (StringUtils.isNotEmpty(target) && StringUtils.isNotEmpty(sort)){
|
|
|
if (sort.equals("1")){
|
|
|
SortUtils.sort(resultList,target,SortUtils.ASC);
|
|
@@ -655,9 +687,10 @@ public class BenchmarkingService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public List<WxsslVo> xmdb(String companys, String type, String wpids, String projectids, String beginDate, String endDate, String target, String sort) {
|
|
|
+ public Map<String, Object> xmdb(String companys, String type, String wpids, String projectids, String beginDate, String endDate, String target, String sort,int pageNum, int pageSize) {
|
|
|
List<WxsslVo> resultList = new ArrayList<>();
|
|
|
QueryWrapper<ProEconEquipmentInfoDay1> qw = new QueryWrapper<>();
|
|
|
+ Integer total =0;
|
|
|
qw.select("project_id,sum(rfdl) rfdl,sum(rllfdl) rllfdl,avg(rpjfs) rpjfs,sum(rjxssdl) rjxssdl,sum(rcnsljxssdl) rcnsljxssdl,sum(rgzssdl) rgzssdl,sum(rcnslgzssdl) rcnslgzssdl,sum(rxdtjssdl) rxdtjssdl,sum(rxdjclssdl) rxdjclssdl,sum(rdjssdl) rdjssdl,sum(rqxjclssdl) rqxjclssdl,sum(rsdtjssdl) rsdtjssdl,sum(rxnssdl) rxnssdl,sum(rcwsldwssdl) rcwsldwssdl,sum(rcwsltqssdl) rcwsltqssdl");
|
|
|
qw.ge("record_date",DateUtils.parseDate(beginDate)).le("record_date",DateUtils.parseDate(endDate));
|
|
|
if (StringUtils.isNotEmpty(wpids)){
|
|
@@ -679,7 +712,10 @@ public class BenchmarkingService {
|
|
|
qw.like("windturbine_id","_IN_");
|
|
|
}
|
|
|
qw.groupBy("project_id");
|
|
|
- List<WxsslVo> wxsslVoList = getWxsslSortVos(qw,resultList,TYPE_PROJECT);
|
|
|
+
|
|
|
+// total = proEconEquipmentInfoDay1Mapper.selectCount(qw);
|
|
|
+
|
|
|
+ Map<String, Object> wxsslVoList = getWxsslSortVos(qw,total,resultList,TYPE_PROJECT,pageNum,pageSize);
|
|
|
if (StringUtils.isNotEmpty(target) && StringUtils.isNotEmpty(sort)){
|
|
|
if (sort.equals("1")){
|
|
|
SortUtils.sort(resultList,target,SortUtils.ASC);
|
|
@@ -692,9 +728,10 @@ public class BenchmarkingService {
|
|
|
return wxsslVoList;
|
|
|
}
|
|
|
|
|
|
- public List<WxsslVo> xldb(String companys, String type, String wpids, String projectids, String lineids, String beginDate, String endDate, String target, String sort) {
|
|
|
+ public Map<String, Object> xldb(String companys, String type, String wpids, String projectids, String lineids, String beginDate, String endDate, String target, String sort,int pageNum, int pageSize) {
|
|
|
List<WxsslVo> resultList = new ArrayList<>();
|
|
|
QueryWrapper<ProEconEquipmentInfoDay1> qw = new QueryWrapper<>();
|
|
|
+ Integer total =0;
|
|
|
qw.select("line_id,sum(rfdl) rfdl,sum(rllfdl) rllfdl,avg(rpjfs) rpjfs,sum(rjxssdl) rjxssdl,sum(rcnsljxssdl) rcnsljxssdl,sum(rgzssdl) rgzssdl,sum(rcnslgzssdl) rcnslgzssdl,sum(rxdtjssdl) rxdtjssdl,sum(rxdjclssdl) rxdjclssdl,sum(rdjssdl) rdjssdl,sum(rqxjclssdl) rqxjclssdl,sum(rsdtjssdl) rsdtjssdl,sum(rxnssdl) rxnssdl,sum(rcwsldwssdl) rcwsldwssdl,sum(rcwsltqssdl) rcwsltqssdl");
|
|
|
|
|
|
qw.ge("record_date",DateUtils.parseDate(beginDate)).le("record_date",DateUtils.parseDate(endDate));
|
|
@@ -723,7 +760,10 @@ public class BenchmarkingService {
|
|
|
qw.like("windturbine_id","_IN_");
|
|
|
}
|
|
|
qw.groupBy("line_id");
|
|
|
- List<WxsslVo> wxsslVoList = getWxsslSortVos(qw,resultList,TYPE_LINE);
|
|
|
+
|
|
|
+// total = proEconEquipmentInfoDay1Mapper.selectCount(qw);
|
|
|
+
|
|
|
+ Map<String, Object> wxsslVoList = getWxsslSortVos(qw,total,resultList,TYPE_LINE,pageNum,pageSize);
|
|
|
if (StringUtils.isNotEmpty(target) && StringUtils.isNotEmpty(sort)){
|
|
|
if (sort.equals("1")){
|
|
|
SortUtils.sort(resultList,target,SortUtils.ASC);
|
|
@@ -743,12 +783,21 @@ public class BenchmarkingService {
|
|
|
* @param type
|
|
|
* @return
|
|
|
*/
|
|
|
- private List<WxsslVo> getWxsslSortVos(QueryWrapper<ProEconEquipmentInfoDay1> qw, List<WxsslVo> resultList, String type) {
|
|
|
+ private Map<String, Object> getWxsslSortVos(QueryWrapper<ProEconEquipmentInfoDay1> qw,Integer total, List<WxsslVo> resultList, String type,int pageNum, int pageSize) {
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) (RequestContextHolder.currentRequestAttributes())).getRequest();
|
|
|
List<ProBasicPowerstation> wpls = tokenService.getWpls(request);
|
|
|
Map<String,Integer> station = wpls
|
|
|
.stream().collect(Collectors.toMap(ProBasicPowerstation::getId,ProBasicPowerstation::getOrderNum));
|
|
|
|
|
|
+ List<ProEconEquipmentInfoDay1> list1 = proEconEquipmentInfoDay1Service.list(qw);
|
|
|
+ // 添加分页逻辑
|
|
|
+// qw.last("OFFSET " + (pageNum - 1) * pageSize + " ROWS FETCH NEXT " + pageSize + " ROWS ONLY");
|
|
|
+ int offset = (pageNum - 1) * pageSize;
|
|
|
+ int limit = pageSize;
|
|
|
+ qw.last("OFFSET " + offset + " ROWS FETCH NEXT " + limit + " ROWS ONLY");
|
|
|
+
|
|
|
+
|
|
|
List<ProEconEquipmentInfoDay1> list = proEconEquipmentInfoDay1Service.list(qw);
|
|
|
list.stream().forEach(i->{
|
|
|
WxsslVo vo = new WxsslVo();
|
|
@@ -840,13 +889,23 @@ public class BenchmarkingService {
|
|
|
resultList.get(i).setSlsslpm(i+1);
|
|
|
}
|
|
|
// SortUtils.sort(resultList,"ordernum",SortUtils.ASC);
|
|
|
- return resultList;
|
|
|
+ // 计算总记录数
|
|
|
+// long total = proEconEquipmentInfoDay1Service.count(qw);
|
|
|
+ // 计算总记录数
|
|
|
+ Integer ls = list1.size();
|
|
|
+
|
|
|
+ resultMap.put("resultList", resultList);
|
|
|
+ resultMap.put("total", ls);
|
|
|
+ resultMap.put("pageNum", pageNum);
|
|
|
+ resultMap.put("pageSize", pageSize);
|
|
|
+ return resultMap;
|
|
|
}
|
|
|
|
|
|
|
|
|
- public List<WxsslVo> details(String id, String beginDate, String endDate, String target, String sort) {
|
|
|
+ public Map<String, Object> details(String id, String beginDate, String endDate, String target, String sort,int pageNum, int pageSize) {
|
|
|
List<WxsslVo> resultList = new ArrayList<>();
|
|
|
QueryWrapper<ProEconEquipmentInfoDay1> qw = new QueryWrapper<>();
|
|
|
+ Integer total =0;
|
|
|
qw.select("windturbine_id,sum(rfdl) rfdl,sum(rllfdl) rllfdl,avg(rpjfs) rpjfs,sum(rjxssdl) rjxssdl,sum(rcnsljxssdl) rcnsljxssdl,sum(rgzssdl) rgzssdl,sum(rcnslgzssdl) rcnslgzssdl,sum(rxdtjssdl) rxdtjssdl,sum(rxdjclssdl) rxdjclssdl,sum(rdjssdl) rdjssdl,sum(rqxjclssdl) rqxjclssdl,sum(rsdtjssdl) rsdtjssdl,sum(rxnssdl) rxnssdl,sum(rcwsldwssdl) rcwsldwssdl,sum(rcwsltqssdl) rcwsltqssdl");
|
|
|
|
|
|
qw.ge("record_date",DateUtils.parseDate(beginDate)).le("record_date",DateUtils.parseDate(endDate));
|
|
@@ -858,7 +917,8 @@ public class BenchmarkingService {
|
|
|
qw.eq("line_id",id);
|
|
|
}
|
|
|
qw.groupBy("windturbine_id");
|
|
|
- List<WxsslVo> wxsslVoList = getWxsslSortVos(qw,resultList,TYPE_WINDTURBINE);
|
|
|
+// total = proEconEquipmentInfoDay1Service.count(qw);
|
|
|
+ Map<String, Object> wxsslVoList = getWxsslSortVos(qw,total,resultList,TYPE_WINDTURBINE,pageNum,pageSize);
|
|
|
if (StringUtils.isNotEmpty(target) && StringUtils.isNotEmpty(sort)){
|
|
|
if (sort.equals("1")){
|
|
|
SortUtils.sort(resultList,target,SortUtils.ASC);
|