|
|
@@ -15,7 +15,7 @@ import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
|
- * 服务实现类
|
|
|
+ * 服务实现类
|
|
|
* </p>
|
|
|
*
|
|
|
* @author author
|
|
|
@@ -85,12 +85,16 @@ public class TurbineInfoDayServiceImpl extends ServiceImpl<TurbineInfoDayMapper,
|
|
|
|
|
|
@Override
|
|
|
public List<TurbineInfoDay> getTurbineMonthList(String windpowerstationId, LocalDate startDate, LocalDate endDate) {
|
|
|
+ int dayOfMonth = endDate.getDayOfMonth();
|
|
|
QueryWrapper<TurbineInfoDay> qw = new QueryWrapper<>();
|
|
|
qw.eq("station_id", windpowerstationId)
|
|
|
- .ge("record_date", startDate)
|
|
|
- .lt("record_date", endDate)
|
|
|
- .groupBy("turbine_id",
|
|
|
- "to_char(record_date, 'yyyy-MM')" )
|
|
|
+ .ge("record_date", startDate);
|
|
|
+ if (dayOfMonth == 1) {
|
|
|
+ qw.le("record_date", endDate);
|
|
|
+ }else {
|
|
|
+ qw.lt("record_date", endDate);
|
|
|
+ }
|
|
|
+ qw.groupBy("turbine_id", "to_char(record_date, 'yyyy-MM')")
|
|
|
.orderByAsc("turbine_id")
|
|
|
.select(
|
|
|
"turbine_id",
|
|
|
@@ -131,7 +135,7 @@ public class TurbineInfoDayServiceImpl extends ServiceImpl<TurbineInfoDayMapper,
|
|
|
"AVG(bll) as bll",
|
|
|
"SUM(score) as score",
|
|
|
"AVG(glyzxxs) as glyzxxs"
|
|
|
- );
|
|
|
+ );
|
|
|
return baseMapper.selectList(qw);
|
|
|
}
|
|
|
|
|
|
@@ -139,8 +143,8 @@ public class TurbineInfoDayServiceImpl extends ServiceImpl<TurbineInfoDayMapper,
|
|
|
public List<TurbineInfoDay> getTurbineInfoDayList(String wpid, String kssj) throws ParseException {
|
|
|
QueryWrapper<TurbineInfoDay> qw = new QueryWrapper<>();
|
|
|
Date kssjDate = new SimpleDateFormat("yyyy-MM-dd").parse(kssj);
|
|
|
- qw.lambda().eq(TurbineInfoDay::getTurbineId,wpid);
|
|
|
- qw.lambda().eq(TurbineInfoDay::getRecordDate,kssjDate);
|
|
|
+ qw.lambda().eq(TurbineInfoDay::getTurbineId, wpid);
|
|
|
+ qw.lambda().eq(TurbineInfoDay::getRecordDate, kssjDate);
|
|
|
List<TurbineInfoDay> list = baseMapper.selectList(qw);
|
|
|
return list;
|
|
|
}
|
|
|
@@ -150,8 +154,8 @@ public class TurbineInfoDayServiceImpl extends ServiceImpl<TurbineInfoDayMapper,
|
|
|
QueryWrapper<TurbineInfoDay> qw = new QueryWrapper<>();
|
|
|
Date kssjDate = new SimpleDateFormat("yyyy-MM-dd").parse(kssj);
|
|
|
Date jssjDate = new SimpleDateFormat("yyyy-MM-dd").parse(jssj);
|
|
|
- qw.lambda().eq(TurbineInfoDay::getTurbineId,wtid);
|
|
|
- qw.lambda().between(TurbineInfoDay::getRecordDate,kssjDate,jssjDate);
|
|
|
+ qw.lambda().eq(TurbineInfoDay::getTurbineId, wtid);
|
|
|
+ qw.lambda().between(TurbineInfoDay::getRecordDate, kssjDate, jssjDate);
|
|
|
List<TurbineInfoDay> list = baseMapper.selectList(qw);
|
|
|
return list;
|
|
|
}
|