Commit b5d364de authored by ZWT's avatar ZWT

得到的

parent 9c3e5e36
...@@ -65,6 +65,11 @@ public class BusinessConstant { ...@@ -65,6 +65,11 @@ public class BusinessConstant {
*/ */
public static final String LAST_LIMIT_ORACLE = "AND ROWNUM = 1"; public static final String LAST_LIMIT_ORACLE = "AND ROWNUM = 1";
/**
* Oracle
*/
public static final String ORACLE = "Oracle";
/** /**
* 开井 * 开井
*/ */
......
...@@ -41,12 +41,10 @@ public class BaseUtils { ...@@ -41,12 +41,10 @@ public class BaseUtils {
* @return {@link String } * @return {@link String }
*/ */
public static String getLastLimit() { public static String getLastLimit() {
switch (DATA_BASE_ID) { if (CharSequenceUtil.equals(DATA_BASE_ID, BusinessConstant.ORACLE)) {
case "Oracle": return BusinessConstant.LAST_LIMIT_ORACLE;
return BusinessConstant.LAST_LIMIT_ORACLE;
default:
return BusinessConstant.LAST_LIMIT;
} }
return BusinessConstant.LAST_LIMIT;
} }
/** /**
......
...@@ -770,7 +770,7 @@ public class WindPredictionFutureService { ...@@ -770,7 +770,7 @@ 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");
if (CharSequenceUtil.equals(property, "Oracle")) { if (CharSequenceUtil.equals(property, BusinessConstant.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 { } else {
...@@ -810,7 +810,7 @@ public class WindPredictionFutureService { ...@@ -810,7 +810,7 @@ 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");
if (CharSequenceUtil.equals(property, "Oracle")) { if (CharSequenceUtil.equals(property, BusinessConstant.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 { } else {
queryWrapper.select("DATA_TIME", "IFNULL( SUM( ACTUAL_POWER ), 0 ) AS PREDICTED_POWER"); queryWrapper.select("DATA_TIME", "IFNULL( SUM( ACTUAL_POWER ), 0 ) AS PREDICTED_POWER");
...@@ -872,7 +872,7 @@ public class WindPredictionFutureService { ...@@ -872,7 +872,7 @@ 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");
if (CharSequenceUtil.equals(property, "Oracle")) { if (CharSequenceUtil.equals(property, BusinessConstant.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 { } else {
queryWrapper.select("COLLECT_TIME", "IFNULL( MAX( ACTUAL_WIND_SPEED ), 0 ) AS ACTUAL_WIND_SPEED", "IFNULL( MAX( ACTUAL_POWER ), 0 ) AS ACTUAL_POWER"); queryWrapper.select("COLLECT_TIME", "IFNULL( MAX( ACTUAL_WIND_SPEED ), 0 ) AS ACTUAL_WIND_SPEED", "IFNULL( MAX( ACTUAL_POWER ), 0 ) AS ACTUAL_POWER");
......
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