|
@@ -4,11 +4,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.gyee.runeconomy.model.auto.ProEconWtAlysisDay;
|
|
import com.gyee.runeconomy.model.auto.ProEconWtAlysisDay;
|
|
import com.gyee.runeconomy.service.auto.IProEconWtAlysisDayService;
|
|
import com.gyee.runeconomy.service.auto.IProEconWtAlysisDayService;
|
|
-import com.gyee.runeconomy.util.DateUtils;
|
|
|
|
import com.gyee.runeconomy.util.StringUtils;
|
|
import com.gyee.runeconomy.util.StringUtils;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
+import java.text.ParseException;
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
@@ -29,8 +30,17 @@ public class WtAlysisDayService {
|
|
//构造分页构造器
|
|
//构造分页构造器
|
|
Page<ProEconWtAlysisDay> pageInfo = new Page<>(pageNum, pageSize);
|
|
Page<ProEconWtAlysisDay> pageInfo = new Page<>(pageNum, pageSize);
|
|
if (StringUtils.notEmp(wtId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
|
|
if (StringUtils.notEmp(wtId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate)) {
|
|
- Date begin = DateUtils.parseDate(beginDate);
|
|
|
|
- Date end = DateUtils.parseDate(endDate);
|
|
|
|
|
|
+ String format = "yyyy-MM-dd";
|
|
|
|
+ SimpleDateFormat df = new SimpleDateFormat(format);
|
|
|
|
+ Date begin = null;
|
|
|
|
+ Date end = null;
|
|
|
|
+ try {
|
|
|
|
+ begin = df.parse(beginDate);
|
|
|
|
+ end = df.parse(endDate);
|
|
|
|
+ } catch (ParseException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
//构造条件构造器
|
|
//构造条件构造器
|
|
LambdaQueryWrapper<ProEconWtAlysisDay> queryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<ProEconWtAlysisDay> queryWrapper = new LambdaQueryWrapper<>();
|
|
@@ -38,6 +48,7 @@ public class WtAlysisDayService {
|
|
queryWrapper.eq(ProEconWtAlysisDay::getWindturbineId, wtId).
|
|
queryWrapper.eq(ProEconWtAlysisDay::getWindturbineId, wtId).
|
|
ge(ProEconWtAlysisDay::getRecordDate, begin).
|
|
ge(ProEconWtAlysisDay::getRecordDate, begin).
|
|
le(ProEconWtAlysisDay::getRecordDate, end);
|
|
le(ProEconWtAlysisDay::getRecordDate, end);
|
|
|
|
+ queryWrapper.orderByAsc(ProEconWtAlysisDay::getRecordDate);
|
|
//执行查询
|
|
//执行查询
|
|
proEconWtAlysisDayService.page(pageInfo, queryWrapper);
|
|
proEconWtAlysisDayService.page(pageInfo, queryWrapper);
|
|
}
|
|
}
|