|
@@ -3,6 +3,7 @@ package com.gyee.runeconomy.service.outputspeed;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.gyee.runeconomy.init.CacheContext;
|
|
|
import com.gyee.runeconomy.model.auto.ProEconInOrOutSpeedTotal;
|
|
|
import com.gyee.runeconomy.service.auto.IProEconInOrOutSpeedTotalService;
|
|
|
import com.gyee.runeconomy.util.DateUtils;
|
|
@@ -18,39 +19,45 @@ public class OutputSpeedService {
|
|
|
@Resource
|
|
|
private IProEconInOrOutSpeedTotalService proEconInOrOutSpeedTotalService;
|
|
|
|
|
|
- public Page<ProEconInOrOutSpeedTotal> outputSpeedlist(Integer pageNum, Integer pageSize, String cmId,String type, String wpId, String recorddate) {
|
|
|
+ public Page<ProEconInOrOutSpeedTotal> outputSpeedlist(Integer pageNum, Integer pageSize, String cmId, String type, String wpId, String recorddate) {
|
|
|
|
|
|
- if(StringUtils.empty(pageNum))
|
|
|
- {
|
|
|
- pageNum=1;
|
|
|
+ if (StringUtils.empty(pageNum)) {
|
|
|
+ pageNum = 1;
|
|
|
}
|
|
|
- if(StringUtils.empty(pageSize))
|
|
|
- {
|
|
|
- pageSize=10;
|
|
|
+ if (StringUtils.empty(pageSize)) {
|
|
|
+ pageSize = 10;
|
|
|
}
|
|
|
//构造分页构造器
|
|
|
Page<ProEconInOrOutSpeedTotal> pageInfo = new Page<>(pageNum, pageSize);
|
|
|
- if (StringUtils.notEmp(cmId) && StringUtils.notEmp(recorddate))
|
|
|
- {
|
|
|
- Date date= DateUtils.parseDate(recorddate);
|
|
|
+ if (StringUtils.notEmp(cmId) && StringUtils.notEmp(recorddate)) {
|
|
|
+ Date date = DateUtils.parseDate(recorddate);
|
|
|
//构造条件构造器
|
|
|
LambdaQueryWrapper<ProEconInOrOutSpeedTotal> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
//添加过滤条件
|
|
|
|
|
|
|
|
|
- if(StringUtils.notEmp(wpId))
|
|
|
- {
|
|
|
-
|
|
|
- queryWrapper.eq(ProEconInOrOutSpeedTotal::getWindpowerstationId, wpId).
|
|
|
- eq(ProEconInOrOutSpeedTotal::getCompanyId,cmId).
|
|
|
- eq(ProEconInOrOutSpeedTotal::getTypes,type).
|
|
|
+ if (StringUtils.notEmp(wpId)) {
|
|
|
+ queryWrapper.eq(ProEconInOrOutSpeedTotal::getWindpowerstationId, wpId).eq(ProEconInOrOutSpeedTotal::getTypes, type).
|
|
|
eq(ProEconInOrOutSpeedTotal::getRecordDate, date);
|
|
|
- }else
|
|
|
- {
|
|
|
+ if (StringUtils.notEmp(type) && !type.equals("0")) {
|
|
|
+ queryWrapper.eq(ProEconInOrOutSpeedTotal::getTypes, type);
|
|
|
+ }
|
|
|
+
|
|
|
+ } else if (StringUtils.notEmp(cmId) && CacheContext.cpmap.containsKey(cmId)) {
|
|
|
queryWrapper.
|
|
|
- eq(ProEconInOrOutSpeedTotal::getCompanyId,cmId).
|
|
|
- eq(ProEconInOrOutSpeedTotal::getTypes,type).
|
|
|
+ eq(ProEconInOrOutSpeedTotal::getCompanyId, cmId).
|
|
|
+
|
|
|
eq(ProEconInOrOutSpeedTotal::getRecordDate, date);
|
|
|
+ if (StringUtils.notEmp(type) && !type.equals("0")) {
|
|
|
+ queryWrapper.eq(ProEconInOrOutSpeedTotal::getTypes, type);
|
|
|
+ }
|
|
|
+ } else if (StringUtils.notEmp(cmId) && CacheContext.rgmap.containsKey(cmId)) {
|
|
|
+ queryWrapper.eq(ProEconInOrOutSpeedTotal::getRegionId, cmId).
|
|
|
+
|
|
|
+ eq(ProEconInOrOutSpeedTotal::getRecordDate, date);
|
|
|
+ if (StringUtils.notEmp(type) && !type.equals("0")) {
|
|
|
+ queryWrapper.eq(ProEconInOrOutSpeedTotal::getTypes, type);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//执行查询
|
|
@@ -62,56 +69,59 @@ public class OutputSpeedService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public Page<ProEconInOrOutSpeedTotal> outputspeedhistorylist(Integer pageNum, Integer pageSize,String cmId,String type, String wpId, String wtId, String beginDate, String endDate) {
|
|
|
+ public Page<ProEconInOrOutSpeedTotal> outputspeedhistorylist(Integer pageNum, Integer pageSize, String cmId, String type, String wpId, String wtId, String beginDate, String endDate) {
|
|
|
|
|
|
|
|
|
- if(StringUtils.empty(pageNum))
|
|
|
- {
|
|
|
- pageNum=1;
|
|
|
+ if (StringUtils.empty(pageNum)) {
|
|
|
+ pageNum = 1;
|
|
|
}
|
|
|
- if(StringUtils.empty(pageSize))
|
|
|
- {
|
|
|
- pageSize=10;
|
|
|
+ if (StringUtils.empty(pageSize)) {
|
|
|
+ pageSize = 10;
|
|
|
}
|
|
|
//构造分页构造器
|
|
|
Page<ProEconInOrOutSpeedTotal> pageInfo = new Page<>(pageNum, pageSize);
|
|
|
|
|
|
|
|
|
+ if (StringUtils.notEmp(type) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
|
|
|
|
|
|
- if (StringUtils.notEmp(cmId) && StringUtils.notEmp(type) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate))
|
|
|
- {
|
|
|
-
|
|
|
- Date begin=DateUtils.parseDate(beginDate);
|
|
|
- Date end=DateUtils.parseDate(endDate);
|
|
|
+ Date begin = DateUtils.parseDate(beginDate);
|
|
|
+ Date end = DateUtils.parseDate(endDate);
|
|
|
|
|
|
//构造条件构造器
|
|
|
LambdaQueryWrapper<ProEconInOrOutSpeedTotal> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
//添加过滤条件
|
|
|
- if(StringUtils.notEmp(wpId))
|
|
|
- {
|
|
|
-
|
|
|
- if(StringUtils.notEmp(wtId))
|
|
|
- {
|
|
|
- queryWrapper.eq(ProEconInOrOutSpeedTotal::getWindpowerstationId, wpId).
|
|
|
- eq(ProEconInOrOutSpeedTotal::getCompanyId,cmId).
|
|
|
- eq(ProEconInOrOutSpeedTotal::getTypes,type).
|
|
|
- eq(ProEconInOrOutSpeedTotal::getWindturbineId,wtId).
|
|
|
- ge(ProEconInOrOutSpeedTotal::getRecordDate, begin).
|
|
|
- le(ProEconInOrOutSpeedTotal::getRecordDate,end);
|
|
|
- }else
|
|
|
- {
|
|
|
- queryWrapper.eq(ProEconInOrOutSpeedTotal::getWindpowerstationId, wpId).
|
|
|
- eq(ProEconInOrOutSpeedTotal::getCompanyId,cmId).
|
|
|
- eq(ProEconInOrOutSpeedTotal::getTypes,type).
|
|
|
- ge(ProEconInOrOutSpeedTotal::getRecordDate, begin).
|
|
|
- le(ProEconInOrOutSpeedTotal::getRecordDate,end);
|
|
|
+
|
|
|
+
|
|
|
+ if (StringUtils.notEmp(wtId)) {
|
|
|
+ queryWrapper.eq(ProEconInOrOutSpeedTotal::getWindturbineId, wtId).
|
|
|
+ ge(ProEconInOrOutSpeedTotal::getRecordDate, begin).
|
|
|
+ le(ProEconInOrOutSpeedTotal::getRecordDate, end);
|
|
|
+ if (StringUtils.notEmp(type) && !type.equals("0")) {
|
|
|
+ queryWrapper.eq(ProEconInOrOutSpeedTotal::getTypes, type);
|
|
|
+ }
|
|
|
+ } else if (StringUtils.notEmp(wpId)) {
|
|
|
+ queryWrapper.eq(ProEconInOrOutSpeedTotal::getWindpowerstationId, wpId).
|
|
|
+ ge(ProEconInOrOutSpeedTotal::getRecordDate, begin).
|
|
|
+ le(ProEconInOrOutSpeedTotal::getRecordDate, end);
|
|
|
+ if (StringUtils.notEmp(type) && !type.equals("0")) {
|
|
|
+ queryWrapper.eq(ProEconInOrOutSpeedTotal::getTypes, type);
|
|
|
}
|
|
|
- }else
|
|
|
- {
|
|
|
- queryWrapper.eq(ProEconInOrOutSpeedTotal::getCompanyId,cmId).
|
|
|
- eq(ProEconInOrOutSpeedTotal::getTypes,type).
|
|
|
+ } else if (StringUtils.notEmp(cmId) && CacheContext.cpmap.containsKey(cmId)) {
|
|
|
+ queryWrapper.
|
|
|
+ eq(ProEconInOrOutSpeedTotal::getCompanyId, cmId).
|
|
|
ge(ProEconInOrOutSpeedTotal::getRecordDate, begin).
|
|
|
- le(ProEconInOrOutSpeedTotal::getRecordDate,end);
|
|
|
+ le(ProEconInOrOutSpeedTotal::getRecordDate, end);
|
|
|
+ if (StringUtils.notEmp(type) && !type.equals("0")) {
|
|
|
+ queryWrapper.eq(ProEconInOrOutSpeedTotal::getTypes, type);
|
|
|
+ }
|
|
|
+ } else if (StringUtils.notEmp(cmId) && CacheContext.rgmap.containsKey(cmId)) {
|
|
|
+ queryWrapper.eq(ProEconInOrOutSpeedTotal::getRegionId, cmId).
|
|
|
+ eq(ProEconInOrOutSpeedTotal::getTypes, type).
|
|
|
+ ge(ProEconInOrOutSpeedTotal::getRecordDate, begin).
|
|
|
+ le(ProEconInOrOutSpeedTotal::getRecordDate, end);
|
|
|
+ if (StringUtils.notEmp(type) && !type.equals("0")) {
|
|
|
+ queryWrapper.eq(ProEconInOrOutSpeedTotal::getTypes, type);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//执行查询
|