Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gf_back
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tianchao
gf_back
Commits
8d95f85a
Commit
8d95f85a
authored
Dec 23, 2024
by
ZWT
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
得到的
parent
b8bb9b0d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
43 deletions
+43
-43
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/service/EnergyConsumptionAnalysisService.java
.../prediction/service/EnergyConsumptionAnalysisService.java
+17
-17
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/service/HomePageService.java
...ain/java/pps/core/prediction/service/HomePageService.java
+23
-23
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/service/PlantPredictedPowerDataService.java
...re/prediction/service/PlantPredictedPowerDataService.java
+3
-3
No files found.
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/service/EnergyConsumptionAnalysisService.java
View file @
8d95f85a
...
@@ -346,7 +346,7 @@ public class EnergyConsumptionAnalysisService {
...
@@ -346,7 +346,7 @@ public class EnergyConsumptionAnalysisService {
"NVL( SUM( ELECTRICITY_CONSUMPTION_HH ), 0 ) AS ELECTRICITY_CONSUMPTION_HH"
,
"NVL( SUM( ELECTRICITY_CONSUMPTION_HH ), 0 ) AS ELECTRICITY_CONSUMPTION_HH"
,
"NVL( SUM( ELECTRICITY_CONSUMPTION_PH ), 0 ) AS ELECTRICITY_CONSUMPTION_PH"
,
"NVL( SUM( ELECTRICITY_CONSUMPTION_PH ), 0 ) AS ELECTRICITY_CONSUMPTION_PH"
,
yearFlag
?
"TO_CHAR( DATA_DATE, 'YYYY-MM-' ) || '01 00:00:00' AS DATA_DATE"
:
"DATA_DATE"
)
yearFlag
?
"TO_CHAR( DATA_DATE, 'YYYY-MM-' ) || '01 00:00:00' AS DATA_DATE"
:
"DATA_DATE"
)
.
last
(
yearFlag
?
"GROUP BY TO_CHAR( DATA_DATE, 'YYYY-MM-' )"
:
"GROUP BY
data_date
"
);
.
last
(
yearFlag
?
"GROUP BY TO_CHAR( DATA_DATE, 'YYYY-MM-' )"
:
"GROUP BY
DATA_DATE
"
);
}
else
{
}
else
{
queryWrapper
.
select
(
"IFNULL( SUM( ELECTRICITY_CHARGE_CITY ), 0 ) AS ELECTRICITY_CHARGE_CITY"
,
queryWrapper
.
select
(
"IFNULL( SUM( ELECTRICITY_CHARGE_CITY ), 0 ) AS ELECTRICITY_CHARGE_CITY"
,
"IFNULL( SUM( ELECTRICITY_CONSUMPTION_VH ), 0 ) AS ELECTRICITY_CONSUMPTION_VH"
,
"IFNULL( SUM( ELECTRICITY_CONSUMPTION_VH ), 0 ) AS ELECTRICITY_CONSUMPTION_VH"
,
...
@@ -1230,15 +1230,15 @@ public class EnergyConsumptionAnalysisService {
...
@@ -1230,15 +1230,15 @@ public class EnergyConsumptionAnalysisService {
if
(
CollUtil
.
isNotEmpty
(
plantList
))
{
if
(
CollUtil
.
isNotEmpty
(
plantList
))
{
QueryWrapper
<
ThirdDailyAccumulationUpdateEnt
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
ThirdDailyAccumulationUpdateEnt
>
queryWrapper
=
new
QueryWrapper
<>();
if
(
CharSequenceUtil
.
equals
(
context
.
getProperty
(
"x.db.databaseId"
),
BusinessConstant
.
ORACLE
))
{
if
(
CharSequenceUtil
.
equals
(
context
.
getProperty
(
"x.db.databaseId"
),
BusinessConstant
.
ORACLE
))
{
queryWrapper
.
select
(
"NVL( SUM(
photovoltaic_power ), 0 ) AS photovoltaic_power
"
,
queryWrapper
.
select
(
"NVL( SUM(
PHOTOVOLTAIC_POWER ), 0 ) AS PHOTOVOLTAIC_POWER
"
,
"NVL( SUM(
daily_electricity_consumption ), 0 ) AS daily_electricity_consumption
"
,
"NVL( SUM(
DAILY_ELECTRICITY_CONSUMPTION ), 0 ) AS DAILY_ELECTRICITY_CONSUMPTION
"
,
"NVL( SUM(
daily_liquid_production ), 0 ) AS daily_liquid_production
"
,
"NVL( SUM(
DAILY_LIQUID_PRODUCTION ), 0 ) AS DAILY_LIQUID_PRODUCTION
"
,
"NVL( SUM(
in_place_consumption ), 0 ) AS in_place_consumption
"
);
"NVL( SUM(
IN_PLACE_CONSUMPTION ), 0 ) AS IN_PLACE_CONSUMPTION
"
);
}
else
{
}
else
{
queryWrapper
.
select
(
"IFNULL( SUM(
photovoltaic_power ), 0 ) AS photovoltaic_power
"
,
queryWrapper
.
select
(
"IFNULL( SUM(
PHOTOVOLTAIC_POWER ), 0 ) AS PHOTOVOLTAIC_POWER
"
,
"IFNULL( SUM(
daily_electricity_consumption ), 0 ) AS daily_electricity_consumption
"
,
"IFNULL( SUM(
DAILY_ELECTRICITY_CONSUMPTION ), 0 ) AS DAILY_ELECTRICITY_CONSUMPTION
"
,
"IFNULL( SUM(
daily_liquid_production ), 0 ) AS daily_liquid_production
"
,
"IFNULL( SUM(
DAILY_LIQUID_PRODUCTION ), 0 ) AS DAILY_LIQUID_PRODUCTION
"
,
"IFNULL( SUM(
in_place_consumption ), 0 ) AS in_place_consumption
"
);
"IFNULL( SUM(
IN_PLACE_CONSUMPTION ), 0 ) AS IN_PLACE_CONSUMPTION
"
);
}
}
DateTime
start
=
DateUtil
.
beginOfMonth
(
end
);
DateTime
start
=
DateUtil
.
beginOfMonth
(
end
);
//累计发电
//累计发电
...
@@ -1710,16 +1710,16 @@ public class EnergyConsumptionAnalysisService {
...
@@ -1710,16 +1710,16 @@ public class EnergyConsumptionAnalysisService {
StationDailyProductionSituationMapper
situationMapper
=
context
.
getBean
(
StationDailyProductionSituationMapper
.
class
);
StationDailyProductionSituationMapper
situationMapper
=
context
.
getBean
(
StationDailyProductionSituationMapper
.
class
);
QueryWrapper
<
StationDailyProductionSituationEnt
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
StationDailyProductionSituationEnt
>
queryWrapper
=
new
QueryWrapper
<>();
if
(
CharSequenceUtil
.
equals
(
context
.
getProperty
(
"x.db.databaseId"
),
BusinessConstant
.
ORACLE
))
{
if
(
CharSequenceUtil
.
equals
(
context
.
getProperty
(
"x.db.databaseId"
),
BusinessConstant
.
ORACLE
))
{
queryWrapper
.
select
(
"NVL( ROUND( SUM(
daily_electricity_consumption ), 2 ), 0 ) AS daily_electricity_consumption
"
,
queryWrapper
.
select
(
"NVL( ROUND( SUM(
DAILY_ELECTRICITY_CONSUMPTION ), 2 ), 0 ) AS DAILY_ELECTRICITY_CONSUMPTION
"
,
"NVL( ROUND( SUM(
daily_liquid_production ), 2 ), 0 ) AS daily_liquid_production
"
,
"NVL( ROUND( SUM(
DAILY_LIQUID_PRODUCTION ), 2 ), 0 ) AS DAILY_LIQUID_PRODUCTION
"
,
"NVL( ROUND( SUM(
photovoltaic_power ), 2 ), 0 ) AS photovoltaic_power
"
,
"NVL( ROUND( SUM(
PHOTOVOLTAIC_POWER ), 2 ), 0 ) AS PHOTOVOLTAIC_POWER
"
,
"
data_date
"
"
DATA_DATE
"
);
);
}
else
{
}
else
{
queryWrapper
.
select
(
"IFNULL( ROUND( SUM(
daily_electricity_consumption ), 2 ), 0 ) AS daily_electricity_consumption
"
,
queryWrapper
.
select
(
"IFNULL( ROUND( SUM(
DAILY_ELECTRICITY_CONSUMPTION ), 2 ), 0 ) AS DAILY_ELECTRICITY_CONSUMPTION
"
,
"IFNULL( ROUND( SUM(
daily_liquid_production ), 2 ), 0 ) AS daily_liquid_production
"
,
"IFNULL( ROUND( SUM(
DAILY_LIQUID_PRODUCTION ), 2 ), 0 ) AS DAILY_LIQUID_PRODUCTION
"
,
"IFNULL( ROUND( SUM(
photovoltaic_power ), 2 ), 0 ) AS photovoltaic_power
"
,
"IFNULL( ROUND( SUM(
PHOTOVOLTAIC_POWER ), 2 ), 0 ) AS PHOTOVOLTAIC_POWER
"
,
"
data_date
"
"
DATA_DATE
"
);
);
}
}
List
<
StationDailyProductionSituationEnt
>
list
=
situationMapper
.
selectList
(
queryWrapper
.
lambda
()
List
<
StationDailyProductionSituationEnt
>
list
=
situationMapper
.
selectList
(
queryWrapper
.
lambda
()
...
...
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/service/HomePageService.java
View file @
8d95f85a
...
@@ -457,7 +457,7 @@ public class HomePageService {
...
@@ -457,7 +457,7 @@ public class HomePageService {
stationList
=
new
ArrayList
<>(
4
);
stationList
=
new
ArrayList
<>(
4
);
for
(
Map
.
Entry
<
String
,
List
<
DynamicQueryBasePowerLineOutput
>>
entry
:
listMap
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
List
<
DynamicQueryBasePowerLineOutput
>>
entry
:
listMap
.
entrySet
())
{
EnergyConsumptionAnalysisEnt
ent
=
mapper
.
selectOne
(
new
QueryWrapper
<
EnergyConsumptionAnalysisEnt
>()
EnergyConsumptionAnalysisEnt
ent
=
mapper
.
selectOne
(
new
QueryWrapper
<
EnergyConsumptionAnalysisEnt
>()
.
select
(
equals
?
"NVL( SUM(
power_consumption ), 0 ) AS power_consumption"
:
"IFNULL( SUM( power_consumption ), 0 ) AS power_consumption
"
)
.
select
(
equals
?
"NVL( SUM(
POWER_CONSUMPTION ), 0 ) AS POWER_CONSUMPTION"
:
"IFNULL( SUM( POWER_CONSUMPTION ), 0 ) AS POWER_CONSUMPTION
"
)
.
lambda
()
.
lambda
()
.
in
(
EnergyConsumptionAnalysisEnt:
:
getStationName
,
entry
.
getValue
().
stream
()
.
in
(
EnergyConsumptionAnalysisEnt:
:
getStationName
,
entry
.
getValue
().
stream
()
.
map
(
DynamicQueryBasePowerLineOutput:
:
getLineName
)
.
map
(
DynamicQueryBasePowerLineOutput:
:
getLineName
)
...
@@ -477,7 +477,7 @@ public class HomePageService {
...
@@ -477,7 +477,7 @@ public class HomePageService {
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
if
(
CollUtil
.
isNotEmpty
(
lineNameList
))
{
if
(
CollUtil
.
isNotEmpty
(
lineNameList
))
{
List
<
EnergyConsumptionAnalysisEnt
>
list
=
mapper
.
selectList
(
new
QueryWrapper
<
EnergyConsumptionAnalysisEnt
>()
List
<
EnergyConsumptionAnalysisEnt
>
list
=
mapper
.
selectList
(
new
QueryWrapper
<
EnergyConsumptionAnalysisEnt
>()
.
select
(
equals
?
"NVL( SUM(
power_consumption ), 0 ) AS power_consumption"
:
"IFNULL( SUM( power_consumption ), 0 ) AS power_consumption"
,
"station_name
"
)
.
select
(
equals
?
"NVL( SUM(
POWER_CONSUMPTION ), 0 ) AS POWER_CONSUMPTION"
:
"IFNULL( SUM( POWER_CONSUMPTION ), 0 ) AS POWER_CONSUMPTION"
,
"STATION_NAME
"
)
.
lambda
()
.
lambda
()
.
in
(
EnergyConsumptionAnalysisEnt:
:
getStationName
,
lineNameList
)
.
in
(
EnergyConsumptionAnalysisEnt:
:
getStationName
,
lineNameList
)
.
eq
(
EnergyConsumptionAnalysisEnt:
:
getDataDate
,
startTime
)
.
eq
(
EnergyConsumptionAnalysisEnt:
:
getDataDate
,
startTime
)
...
@@ -622,17 +622,17 @@ public class HomePageService {
...
@@ -622,17 +622,17 @@ public class HomePageService {
case
BusinessConstant
.
ENV_CQ
:
case
BusinessConstant
.
ENV_CQ
:
QueryWrapper
<
ThirdDailyAccumulationUpdateEnt
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
ThirdDailyAccumulationUpdateEnt
>
queryWrapper
=
new
QueryWrapper
<>();
if
(
CharSequenceUtil
.
equals
(
context
.
getProperty
(
"x.db.databaseId"
),
BusinessConstant
.
ORACLE
))
{
if
(
CharSequenceUtil
.
equals
(
context
.
getProperty
(
"x.db.databaseId"
),
BusinessConstant
.
ORACLE
))
{
queryWrapper
.
select
(
"NVL( SUM(
photovoltaic_power ), 0 ) AS photovoltaic_power
"
,
queryWrapper
.
select
(
"NVL( SUM(
PHOTOVOLTAIC_POWER ), 0 ) AS PHOTOVOLTAIC_POWER
"
,
"NVL( SUM(
daily_electricity_consumption ), 0 ) AS daily_electricity_consumption
"
,
"NVL( SUM(
DAILY_ELECTRICITY_CONSUMPTION ), 0 ) AS DAILY_ELECTRICITY_CONSUMPTION
"
,
"NVL( SUM(
daily_liquid_production ), 0 ) AS daily_liquid_production
"
,
"NVL( SUM(
DAILY_LIQUID_PRODUCTION ), 0 ) AS DAILY_LIQUID_PRODUCTION
"
,
"NVL( SUM(
energy_storage_discharge ), 0 ) AS energy_storage_discharge
"
,
"NVL( SUM(
ENERGY_STORAGE_DISCHARGE ), 0 ) AS ENERGY_STORAGE_DISCHARGE
"
,
"NVL( SUM(
in_place_consumption ), 0 ) AS in_place_consumption
"
);
"NVL( SUM(
IN_PLACE_CONSUMPTION ), 0 ) AS IN_PLACE_CONSUMPTION
"
);
}
else
{
}
else
{
queryWrapper
.
select
(
"IFNULL( SUM(
photovoltaic_power ), 0 ) AS photovoltaic_power
"
,
queryWrapper
.
select
(
"IFNULL( SUM(
PHOTOVOLTAIC_POWER ), 0 ) AS PHOTOVOLTAIC_POWER
"
,
"IFNULL( SUM(
daily_electricity_consumption ), 0 ) AS daily_electricity_consumption
"
,
"IFNULL( SUM(
DAILY_ELECTRICITY_CONSUMPTION ), 0 ) AS DAILY_ELECTRICITY_CONSUMPTION
"
,
"IFNULL( SUM(
daily_liquid_production ), 0 ) AS daily_liquid_production
"
,
"IFNULL( SUM(
DAILY_LIQUID_PRODUCTION ), 0 ) AS DAILY_LIQUID_PRODUCTION
"
,
"IFNULL( SUM(
energy_storage_discharge ), 0 ) AS energy_storage_discharge
"
,
"IFNULL( SUM(
ENERGY_STORAGE_DISCHARGE ), 0 ) AS ENERGY_STORAGE_DISCHARGE
"
,
"IFNULL( SUM(
in_place_consumption ), 0 ) AS in_place_consumption
"
);
"IFNULL( SUM(
IN_PLACE_CONSUMPTION ), 0 ) AS IN_PLACE_CONSUMPTION
"
);
}
}
ThirdDailyAccumulationUpdateMapper
analysisMapper
=
context
.
getBean
(
ThirdDailyAccumulationUpdateMapper
.
class
);
ThirdDailyAccumulationUpdateMapper
analysisMapper
=
context
.
getBean
(
ThirdDailyAccumulationUpdateMapper
.
class
);
...
@@ -669,13 +669,13 @@ public class HomePageService {
...
@@ -669,13 +669,13 @@ public class HomePageService {
case
BusinessConstant
.
ENV_SY
:
case
BusinessConstant
.
ENV_SY
:
QueryWrapper
<
StationDailyProductionSituationEnt
>
wrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
StationDailyProductionSituationEnt
>
wrapper
=
new
QueryWrapper
<>();
if
(
CharSequenceUtil
.
equals
(
context
.
getProperty
(
"x.db.databaseId"
),
BusinessConstant
.
ORACLE
))
{
if
(
CharSequenceUtil
.
equals
(
context
.
getProperty
(
"x.db.databaseId"
),
BusinessConstant
.
ORACLE
))
{
wrapper
.
select
(
"NVL( SUM(
photovoltaic_power ), 0 ) AS photovoltaic_power
"
,
wrapper
.
select
(
"NVL( SUM(
PHOTOVOLTAIC_POWER ), 0 ) AS PHOTOVOLTAIC_POWER
"
,
"NVL( SUM(
daily_electricity_consumption ), 0 ) AS daily_electricity_consumption
"
,
"NVL( SUM(
DAILY_ELECTRICITY_CONSUMPTION ), 0 ) AS DAILY_ELECTRICITY_CONSUMPTION
"
,
"NVL( SUM(
electricity_charge_city ), 0 ) AS electricity_charge_city
"
);
"NVL( SUM(
ELECTRICITY_CHARGE_CITY ), 0 ) AS ELECTRICITY_CHARGE_CITY
"
);
}
else
{
}
else
{
wrapper
.
select
(
"IFNULL( SUM(
photovoltaic_power ), 0 ) AS photovoltaic_power
"
,
wrapper
.
select
(
"IFNULL( SUM(
PHOTOVOLTAIC_POWER ), 0 ) AS PHOTOVOLTAIC_POWER
"
,
"IFNULL( SUM(
daily_electricity_consumption ), 0 ) AS daily_electricity_consumption
"
,
"IFNULL( SUM(
DAILY_ELECTRICITY_CONSUMPTION ), 0 ) AS DAILY_ELECTRICITY_CONSUMPTION
"
,
"IFNULL( SUM(
electricity_charge_city ), 0 ) AS electricity_charge_city
"
);
"IFNULL( SUM(
ELECTRICITY_CHARGE_CITY ), 0 ) AS ELECTRICITY_CHARGE_CITY
"
);
}
}
StationDailyProductionSituationMapper
dailyMapper
=
context
.
getBean
(
StationDailyProductionSituationMapper
.
class
);
StationDailyProductionSituationMapper
dailyMapper
=
context
.
getBean
(
StationDailyProductionSituationMapper
.
class
);
StationDailyProductionSituationEnt
dailyEnt
=
dailyMapper
.
selectOne
(
wrapper
.
lambda
()
StationDailyProductionSituationEnt
dailyEnt
=
dailyMapper
.
selectOne
(
wrapper
.
lambda
()
...
@@ -851,16 +851,16 @@ public class HomePageService {
...
@@ -851,16 +851,16 @@ public class HomePageService {
DateTime
today
=
DateUtil
.
beginOfDay
(
DateUtil
.
date
());
DateTime
today
=
DateUtil
.
beginOfDay
(
DateUtil
.
date
());
ThirdDailyAccumulationUpdateMapper
mapper
=
context
.
getBean
(
ThirdDailyAccumulationUpdateMapper
.
class
);
ThirdDailyAccumulationUpdateMapper
mapper
=
context
.
getBean
(
ThirdDailyAccumulationUpdateMapper
.
class
);
dailyAccumulation
=
mapper
.
selectOne
(
new
QueryWrapper
<
ThirdDailyAccumulationUpdateEnt
>()
dailyAccumulation
=
mapper
.
selectOne
(
new
QueryWrapper
<
ThirdDailyAccumulationUpdateEnt
>()
.
select
(
"IFNULL( AVG(
photovoltaic_power ), 0 ) AS photovoltaic_power
"
,
.
select
(
"IFNULL( AVG(
PHOTOVOLTAIC_POWER ), 0 ) AS PHOTOVOLTAIC_POWER
"
,
"IFNULL( AVG(
daily_electricity_consumption ), 0 ) AS daily_electricity_consumption
"
,
"IFNULL( AVG(
DAILY_ELECTRICITY_CONSUMPTION ), 0 ) AS DAILY_ELECTRICITY_CONSUMPTION
"
,
"IFNULL( AVG(
daily_liquid_production ), 0 ) AS daily_liquid_production
"
,
"IFNULL( AVG(
DAILY_LIQUID_PRODUCTION ), 0 ) AS DAILY_LIQUID_PRODUCTION
"
,
"IFNULL( AVG(
in_place_consumption ), 0 ) AS in_place_consumption
"
)
"IFNULL( AVG(
IN_PLACE_CONSUMPTION ), 0 ) AS IN_PLACE_CONSUMPTION
"
)
.
lambda
()
.
lambda
()
.
in
(
ThirdDailyAccumulationUpdateEnt:
:
getStationName
,
plantViewList
.
stream
()
.
in
(
ThirdDailyAccumulationUpdateEnt:
:
getStationName
,
plantViewList
.
stream
()
.
map
(
DynamicQueryBasePowerLinePlantViewOutput:
:
getStationName
)
.
map
(
DynamicQueryBasePowerLinePlantViewOutput:
:
getStationName
)
.
collect
(
Collectors
.
toList
()))
.
collect
(
Collectors
.
toList
()))
.
eq
(
ThirdDailyAccumulationUpdateEnt:
:
getSystemSource
,
oilFieldCode
)
.
eq
(
ThirdDailyAccumulationUpdateEnt:
:
getSystemSource
,
oilFieldCode
)
.
apply
(
"DATE(
create_date
) = {0}"
,
today
)
.
apply
(
"DATE(
CREATE_DATE
) = {0}"
,
today
)
.
groupBy
(
ThirdDailyAccumulationUpdateEnt:
:
getStationName
)
.
groupBy
(
ThirdDailyAccumulationUpdateEnt:
:
getStationName
)
);
);
break
;
break
;
...
...
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/service/PlantPredictedPowerDataService.java
View file @
8d95f85a
...
@@ -86,7 +86,7 @@ public class PlantPredictedPowerDataService {
...
@@ -86,7 +86,7 @@ public class PlantPredictedPowerDataService {
PlantPredictedPowerDataMapper
mapper
=
context
.
getBean
(
PlantPredictedPowerDataMapper
.
class
);
PlantPredictedPowerDataMapper
mapper
=
context
.
getBean
(
PlantPredictedPowerDataMapper
.
class
);
Date
date
=
new
Date
();
Date
date
=
new
Date
();
QueryWrapper
<
PlantPredictedPowerDataEnt
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
PlantPredictedPowerDataEnt
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
select
(
"IFNULL(
avg(power ) , 0 ) power
"
)
queryWrapper
.
select
(
"IFNULL(
AVG(POWER ) , 0 ) POWER
"
)
.
lambda
()
.
lambda
()
.
eq
(
PlantPredictedPowerDataEnt:
:
getPlantId
,
input
.
getPlantId
())
.
eq
(
PlantPredictedPowerDataEnt:
:
getPlantId
,
input
.
getPlantId
())
.
ge
(
PlantPredictedPowerDataEnt:
:
getDataDate
,
date
)
.
ge
(
PlantPredictedPowerDataEnt:
:
getDataDate
,
date
)
...
@@ -94,7 +94,7 @@ public class PlantPredictedPowerDataService {
...
@@ -94,7 +94,7 @@ public class PlantPredictedPowerDataService {
PlantPredictedPowerDataEnt
currentData
=
mapper
.
selectOne
(
queryWrapper
);
PlantPredictedPowerDataEnt
currentData
=
mapper
.
selectOne
(
queryWrapper
);
queryWrapper
.
clear
();
queryWrapper
.
clear
();
DateTime
lastYear
=
DateUtil
.
offset
(
date
,
DateField
.
YEAR
,
-
1
);
DateTime
lastYear
=
DateUtil
.
offset
(
date
,
DateField
.
YEAR
,
-
1
);
queryWrapper
.
select
(
"IFNULL(
avg(power ) , 0 ) power
"
)
queryWrapper
.
select
(
"IFNULL(
AVG(POWER ) , 0 ) POWER
"
)
.
lambda
()
.
lambda
()
.
eq
(
PlantPredictedPowerDataEnt:
:
getPlantId
,
input
.
getPlantId
())
.
eq
(
PlantPredictedPowerDataEnt:
:
getPlantId
,
input
.
getPlantId
())
.
ge
(
PlantPredictedPowerDataEnt:
:
getDataDate
,
lastYear
)
.
ge
(
PlantPredictedPowerDataEnt:
:
getDataDate
,
lastYear
)
...
@@ -105,7 +105,7 @@ public class PlantPredictedPowerDataService {
...
@@ -105,7 +105,7 @@ public class PlantPredictedPowerDataService {
compare
=
currentData
.
getPower
().
divide
(
lastData
.
getPower
(),
6
,
BigDecimal
.
ROUND_HALF_UP
);
compare
=
currentData
.
getPower
().
divide
(
lastData
.
getPower
(),
6
,
BigDecimal
.
ROUND_HALF_UP
);
}
}
queryWrapper
.
clear
();
queryWrapper
.
clear
();
queryWrapper
.
select
(
"
data_date, power
"
)
queryWrapper
.
select
(
"
DATA_DATE, POWER
"
)
.
lambda
()
.
lambda
()
.
eq
(
PlantPredictedPowerDataEnt:
:
getPlantId
,
input
.
getPlantId
())
.
eq
(
PlantPredictedPowerDataEnt:
:
getPlantId
,
input
.
getPlantId
())
.
ge
(
PlantPredictedPowerDataEnt:
:
getDataDate
,
lastYear
)
.
ge
(
PlantPredictedPowerDataEnt:
:
getDataDate
,
lastYear
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment