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
c70a3649
Commit
c70a3649
authored
Dec 09, 2024
by
ZWT
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
得到的
parent
a0532dfd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
8 deletions
+64
-8
C02-system/pps-core-system/src/main/resources/mybatis/mapper/pps/core/system/SysOrganizationViewMapper.xml
...atis/mapper/pps/core/system/SysOrganizationViewMapper.xml
+32
-1
C09-base/pps-core-base/src/main/java/pps/core/base/service/WindPredictionFutureService.java
...va/pps/core/base/service/WindPredictionFutureService.java
+32
-7
No files found.
C02-system/pps-core-system/src/main/resources/mybatis/mapper/pps/core/system/SysOrganizationViewMapper.xml
View file @
c70a3649
...
@@ -747,7 +747,7 @@
...
@@ -747,7 +747,7 @@
</select>
</select>
<select
id=
"selectOrgAndWindStationList"
parameterType=
"pps.core.system.entity.SysOrganizationView"
<select
id=
"selectOrgAndWindStationList"
parameterType=
"pps.core.system.entity.SysOrganizationView"
resultMap=
"ExtendResultMap"
>
resultMap=
"ExtendResultMap"
databaseId=
"MySQL"
>
(SELECT ROW_NUMBER() OVER ( ORDER BY R.SORT ) AS RN, O.ID,
(SELECT ROW_NUMBER() OVER ( ORDER BY R.SORT ) AS RN, O.ID,
O.OU_NAME AS OU_NAME,
O.OU_NAME AS OU_NAME,
'' AS STATION_ID,
'' AS STATION_ID,
...
@@ -769,6 +769,37 @@
...
@@ -769,6 +769,37 @@
ORDER BY STATION_NAME)
ORDER BY STATION_NAME)
</select>
</select>
<select
id=
"selectOrgAndWindStationList"
parameterType=
"pps.core.system.entity.SysOrganizationView"
resultMap=
"ExtendResultMap"
databaseId=
"Oracle"
>
WITH S1 AS (SELECT TO_CHAR( O.ID ) AS ID,
TO_CHAR( O.OU_NAME ) AS OU_NAME,
'' AS STATION_ID,
'ORG' AS OU_LEVEL
FROM SYS_ORGANIZATION O
LEFT JOIN SYS_ORGANIZATION_REL R ON O.ID = R.OU_ID
WHERE R.PARENT_OU_ID = #{id}
AND R.END_TIME >=
<include
refid=
"now"
/>
AND O.IS_DELETED = 1
ORDER BY R.SORT),
S2 AS (SELECT TO_CHAR( ID ) AS ID,
TO_CHAR( STATION_NAME ) AS OU_NAME,
TO_CHAR( ID ) AS STATION_ID,
'STATION' AS OU_LEVEL
FROM BASE_WIND_TURBINE
WHERE OU_ID = #{id}
AND IS_DELETED = 1
ORDER BY STATION_NAME,
CREATE_TIME) SELECT
*
FROM
S1 UNION ALL
SELECT
*
FROM
S2
</select>
<select
id=
"selectChildLineList"
parameterType=
"pps.core.system.entity.SysOrganizationView"
<select
id=
"selectChildLineList"
parameterType=
"pps.core.system.entity.SysOrganizationView"
resultMap=
"ExtendResultMap"
>
resultMap=
"ExtendResultMap"
>
SELECT ID AS ID,
SELECT ID AS ID,
...
...
C09-base/pps-core-base/src/main/java/pps/core/base/service/WindPredictionFutureService.java
View file @
c70a3649
...
@@ -768,10 +768,19 @@ public class WindPredictionFutureService {
...
@@ -768,10 +768,19 @@ public class WindPredictionFutureService {
* @return {@link Map }<{@link Date }, {@link WindPredictionFutureEnt }>
* @return {@link Map }<{@link Date }, {@link WindPredictionFutureEnt }>
*/
*/
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
<>();
String
property
=
context
.
getProperty
(
"x.db.databaseId"
);
switch
(
property
)
{
case
"Oracle"
:
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"
);
break
;
default
:
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
(
new
QueryWrapper
<
WindPredictionFutureEnt
>()
List
<
WindPredictionFutureEnt
>
predictedList
=
mapper
.
selectList
(
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"
)
.
lambda
()
.
lambda
()
.
eq
(
WindPredictionFutureEnt:
:
getStationId
,
stationId
)
.
eq
(
WindPredictionFutureEnt:
:
getStationId
,
stationId
)
.
between
(
WindPredictionFutureEnt:
:
getDataTime
,
beginTime
,
endTime
)
.
between
(
WindPredictionFutureEnt:
:
getDataTime
,
beginTime
,
endTime
)
...
@@ -801,9 +810,17 @@ public class WindPredictionFutureService {
...
@@ -801,9 +810,17 @@ public class WindPredictionFutureService {
* @return {@link Map }<{@link Date }, {@link BigDecimal }>
* @return {@link Map }<{@link Date }, {@link BigDecimal }>
*/
*/
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
<>();
String
property
=
context
.
getProperty
(
"x.db.databaseId"
);
switch
(
property
)
{
case
"Oracle"
:
queryWrapper
.
select
(
"data_time"
,
"NVL( SUM( actual_power ), 0 ) AS predicted_power"
);
break
;
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
(
new
QueryWrapper
<
WindPredictionFutureEnt
>()
List
<
WindPredictionFutureEnt
>
predictedList
=
mapper
.
selectList
(
queryWrapper
.
select
(
"data_time"
,
"IFNULL( SUM( actual_power ), 0 ) AS predicted_power"
)
.
lambda
()
.
lambda
()
.
in
(
WindPredictionFutureEnt:
:
getStationId
,
stationIds
)
.
in
(
WindPredictionFutureEnt:
:
getStationId
,
stationIds
)
.
between
(
WindPredictionFutureEnt:
:
getDataTime
,
beginTime
,
endTime
)
.
between
(
WindPredictionFutureEnt:
:
getDataTime
,
beginTime
,
endTime
)
...
@@ -857,9 +874,17 @@ public class WindPredictionFutureService {
...
@@ -857,9 +874,17 @@ public class WindPredictionFutureService {
* @return {@link Map }<{@link Date }, {@link ThirdWindPowerGenerationEnt }>
* @return {@link Map }<{@link Date }, {@link ThirdWindPowerGenerationEnt }>
*/
*/
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
<>();
String
property
=
context
.
getProperty
(
"x.db.databaseId"
);
switch
(
property
)
{
case
"Oracle"
:
queryWrapper
.
select
(
"collect_time"
,
"NVL( MAX( actual_wind_speed ), 0 ) AS actual_wind_speed"
,
"NVL( MAX( actual_power ), 0 ) AS actual_power"
);
break
;
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
(
new
QueryWrapper
<
ThirdWindPowerGenerationEnt
>()
List
<
ThirdWindPowerGenerationEnt
>
list
=
generationMapper
.
selectList
(
queryWrapper
.
select
(
"collect_time"
,
"IFNULL( MAX( actual_wind_speed ), 0 ) AS actual_wind_speed"
,
"IFNULL( MAX( actual_power ), 0 ) AS actual_power"
)
.
groupBy
(
"collect_time"
)
.
groupBy
(
"collect_time"
)
.
lambda
()
.
lambda
()
.
eq
(
ThirdWindPowerGenerationEnt:
:
getStationId
,
stationId
)
.
eq
(
ThirdWindPowerGenerationEnt:
:
getStationId
,
stationId
)
...
...
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