Commit 9c3e5e36 authored by ZWT's avatar ZWT

得到的

parent 0b39a2d6
...@@ -770,14 +770,12 @@ public class WindPredictionFutureService { ...@@ -770,14 +770,12 @@ public class WindPredictionFutureService {
private Map<Date, WindPredictionFutureEnt> getPredictedMap(XContext context, String stationId, DateTime beginTime, DateTime endTime) { private Map<Date, WindPredictionFutureEnt> getPredictedMap(XContext context, String stationId, DateTime beginTime, DateTime endTime) {
QueryWrapper<WindPredictionFutureEnt> queryWrapper = new QueryWrapper<>(); QueryWrapper<WindPredictionFutureEnt> queryWrapper = new QueryWrapper<>();
String property = context.getProperty("x.db.databaseId"); String property = context.getProperty("x.db.databaseId");
switch (property) { if (CharSequenceUtil.equals(property, "Oracle")) {
case "Oracle": queryWrapper.select("DATA_TIME", "NVL( MAX( ACTUAL_POWER ), 0 ) AS PREDICTED_POWER",
queryWrapper.select("DATA_TIME", "NVL( MAX( ACTUAL_POWER ), 0 ) AS PREDICTED_POWER", "NVL( MAX( ACTUAL_WIND_SPEED ), 0 ) AS ACTUAL_WIND_SPEED", "NVL( MAX( WIND_SPEED ), 0 ) AS WIND_SPEED");
"NVL( MAX( ACTUAL_WIND_SPEED ), 0 ) AS ACTUAL_WIND_SPEED", "NVL( MAX( WIND_SPEED ), 0 ) AS WIND_SPEED"); } else {
break; queryWrapper.select("DATA_TIME", "IFNULL( MAX( ACTUAL_POWER ), 0 ) AS PREDICTED_POWER",
default: "IFNULL( MAX( ACTUAL_WIND_SPEED ), 0 ) AS ACTUAL_WIND_SPEED", "IFNULL( MAX( WIND_SPEED ), 0 ) AS WIND_SPEED");
queryWrapper.select("DATA_TIME", "IFNULL( MAX( ACTUAL_POWER ), 0 ) AS PREDICTED_POWER",
"IFNULL( MAX( ACTUAL_WIND_SPEED ), 0 ) AS ACTUAL_WIND_SPEED", "IFNULL( MAX( WIND_SPEED ), 0 ) AS WIND_SPEED");
} }
WindPredictionFutureMapper mapper = context.getBean(WindPredictionFutureMapper.class); WindPredictionFutureMapper mapper = context.getBean(WindPredictionFutureMapper.class);
List<WindPredictionFutureEnt> predictedList = mapper.selectList(queryWrapper List<WindPredictionFutureEnt> predictedList = mapper.selectList(queryWrapper
...@@ -812,12 +810,10 @@ public class WindPredictionFutureService { ...@@ -812,12 +810,10 @@ public class WindPredictionFutureService {
private Map<Date, BigDecimal> getPredictedMap(XContext context, List<String> stationIds, Date beginTime, Date endTime) { private Map<Date, BigDecimal> getPredictedMap(XContext context, List<String> stationIds, Date beginTime, Date endTime) {
QueryWrapper<WindPredictionFutureEnt> queryWrapper = new QueryWrapper<>(); QueryWrapper<WindPredictionFutureEnt> queryWrapper = new QueryWrapper<>();
String property = context.getProperty("x.db.databaseId"); String property = context.getProperty("x.db.databaseId");
switch (property) { if (CharSequenceUtil.equals(property, "Oracle")) {
case "Oracle": queryWrapper.select("DATA_TIME", "NVL( SUM( ACTUAL_POWER ), 0 ) AS PREDICTED_POWER");
queryWrapper.select("DATA_TIME", "NVL( SUM( ACTUAL_POWER ), 0 ) AS PREDICTED_POWER"); } else {
break; queryWrapper.select("DATA_TIME", "IFNULL( SUM( ACTUAL_POWER ), 0 ) AS PREDICTED_POWER");
default:
queryWrapper.select("DATA_TIME", "IFNULL( SUM( ACTUAL_POWER ), 0 ) AS PREDICTED_POWER");
} }
WindPredictionFutureMapper mapper = context.getBean(WindPredictionFutureMapper.class); WindPredictionFutureMapper mapper = context.getBean(WindPredictionFutureMapper.class);
List<WindPredictionFutureEnt> predictedList = mapper.selectList(queryWrapper List<WindPredictionFutureEnt> predictedList = mapper.selectList(queryWrapper
...@@ -876,12 +872,10 @@ public class WindPredictionFutureService { ...@@ -876,12 +872,10 @@ public class WindPredictionFutureService {
private Map<Date, ThirdWindPowerGenerationEnt> getActivePower15MinuteMap(XContext context, String stationId, DateTime beginTime, DateTime endTime) { private Map<Date, ThirdWindPowerGenerationEnt> getActivePower15MinuteMap(XContext context, String stationId, DateTime beginTime, DateTime endTime) {
QueryWrapper<ThirdWindPowerGenerationEnt> queryWrapper = new QueryWrapper<>(); QueryWrapper<ThirdWindPowerGenerationEnt> queryWrapper = new QueryWrapper<>();
String property = context.getProperty("x.db.databaseId"); String property = context.getProperty("x.db.databaseId");
switch (property) { if (CharSequenceUtil.equals(property, "Oracle")) {
case "Oracle": queryWrapper.select("COLLECT_TIME", "NVL( MAX( ACTUAL_WIND_SPEED ), 0 ) AS ACTUAL_WIND_SPEED", "NVL( MAX( ACTUAL_POWER ), 0 ) AS ACTUAL_POWER");
queryWrapper.select("COLLECT_TIME", "NVL( MAX( ACTUAL_WIND_SPEED ), 0 ) AS ACTUAL_WIND_SPEED", "NVL( MAX( ACTUAL_POWER ), 0 ) AS ACTUAL_POWER"); } else {
break; queryWrapper.select("COLLECT_TIME", "IFNULL( MAX( ACTUAL_WIND_SPEED ), 0 ) AS ACTUAL_WIND_SPEED", "IFNULL( MAX( ACTUAL_POWER ), 0 ) AS ACTUAL_POWER");
default:
queryWrapper.select("COLLECT_TIME", "IFNULL( MAX( ACTUAL_WIND_SPEED ), 0 ) AS ACTUAL_WIND_SPEED", "IFNULL( MAX( ACTUAL_POWER ), 0 ) AS ACTUAL_POWER");
} }
ThirdWindPowerGenerationMapper generationMapper = context.getBean(ThirdWindPowerGenerationMapper.class); ThirdWindPowerGenerationMapper generationMapper = context.getBean(ThirdWindPowerGenerationMapper.class);
List<ThirdWindPowerGenerationEnt> list = generationMapper.selectList(queryWrapper List<ThirdWindPowerGenerationEnt> list = generationMapper.selectList(queryWrapper
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment