Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
9276b616
Commit
9276b616
authored
Jul 26, 2024
by
hezhuozhi
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
7cbfc658
e6720fac
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
314 additions
and
180 deletions
+314
-180
DateUtils.java
...ava/com/yeejoin/amos/boot/biz/common/utils/DateUtils.java
+25
-0
IdxBizPvHealthIndexController.java
...e/jxiop/biz/controller/IdxBizPvHealthIndexController.java
+1
-1
TDBigScreenAnalyseController.java
...le/jxiop/biz/controller/TDBigScreenAnalyseController.java
+38
-43
FanHealthIndexServiceImpl.java
...ule/jxiop/biz/service/impl/FanHealthIndexServiceImpl.java
+62
-44
PvHealthIndexServiceImpl.java
...dule/jxiop/biz/service/impl/PvHealthIndexServiceImpl.java
+69
-32
TdengineTimeServiceImpl.java
...odule/jxiop/biz/service/impl/TdengineTimeServiceImpl.java
+2
-6
IdxBizFanHealthIndexMapper.xml
...n/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
+17
-44
EarningsForecastImpl.java
...t/module/jxiop/biz/service/impl/EarningsForecastImpl.java
+20
-6
SjglZsjZsbtzMapper.java
...mos/boot/module/jxiop/biz/mapper2/SjglZsjZsbtzMapper.java
+3
-0
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+42
-4
SjglZsjZsbtzMapper.xml
.../src/main/resources/mapper/cluster/SjglZsjZsbtzMapper.xml
+35
-0
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/DateUtils.java
View file @
9276b616
...
@@ -671,6 +671,9 @@ public class DateUtils {
...
@@ -671,6 +671,9 @@ public class DateUtils {
// System.out.println(getWeekBeginDate(dateParse("2021-10-11", null)));
// System.out.println(getWeekBeginDate(dateParse("2021-10-11", null)));
// System.out.println(getWeekEndDate(dateParse("2021-10-11", null)));
// System.out.println(getWeekEndDate(dateParse("2021-10-11", null)));
System
.
out
.
println
(
secondsToTimeStr
(
3600
));
System
.
out
.
println
(
secondsToTimeStr
(
3600
));
List
<
String
>
beforeCurrentMonth
=
getBeforeCurrentMonth
(
3
,
true
);
System
.
out
.
println
(
beforeCurrentMonth
);
}
}
/**
/**
...
@@ -1073,4 +1076,26 @@ public class DateUtils {
...
@@ -1073,4 +1076,26 @@ public class DateUtils {
final
LocalDateTime
end
=
LocalDateTime
.
parse
(
sdf
.
format
(
endTime
),
DateTimeFormatter
.
ofPattern
(
pattern
));
final
LocalDateTime
end
=
LocalDateTime
.
parse
(
sdf
.
format
(
endTime
),
DateTimeFormatter
.
ofPattern
(
pattern
));
return
Duration
.
between
(
start
,
end
).
toDays
();
return
Duration
.
between
(
start
,
end
).
toDays
();
}
}
public
static
List
<
String
>
getBeforeCurrentMonth
(
int
num
,
Boolean
bool
){
int
n
=
0
;
if
(!
bool
){
n
=
n
+
1
;
}
List
<
String
>
objects
=
new
ArrayList
<>();
for
(
int
i
=
n
;
shouldContinue
(
i
,
num
,
bool
);
i
++)
{
Date
date1
=
dateAddMonths
(
new
Date
(),
num
>
0
?
i:
-
i
);
String
s
=
convertDateToString
(
date1
,
MONTH_PATTERN
);
objects
.
add
(
s
);
}
return
objects
;
}
private
static
boolean
shouldContinue
(
int
i
,
int
num
,
Boolean
bool
)
{
return
bool
?
i
<
Math
.
abs
(
num
)
:
i
<=
Math
.
abs
(
num
)
;
}
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/IdxBizPvHealthIndexController.java
View file @
9276b616
...
@@ -442,7 +442,7 @@ public class IdxBizPvHealthIndexController extends BaseController {
...
@@ -442,7 +442,7 @@ public class IdxBizPvHealthIndexController extends BaseController {
Date
startDate
=
DateUtils
.
dateParse
(
startTimeTop
);
Date
startDate
=
DateUtils
.
dateParse
(
startTimeTop
);
startTimeTop
=
formatter
.
format
(
startDate
);
startTimeTop
=
formatter
.
format
(
startDate
);
List
<
PvHealthIndexDay
>
fanHealthIndexDays
=
pvHealthIndexDayMapper
.
selectData
(
station
,
analysisType
,
indexAddress
,
healthLevel
,
area
,
analysisObjType
,
subarray
,
pointName
,
startTimeTop
,
endTimeTop
,
equipmentName
,
(
current
-
1
)
*
size
,
size
,
orgCode
);
List
<
PvHealthIndexDay
>
fanHealthIndexDays
=
pvHealthIndexDayMapper
.
selectData
(
station
,
analysisType
,
indexAddress
,
healthLevel
,
area
,
analysisObjType
,
subarray
,
pointName
,
startTimeTop
,
endTimeTop
,
equipmentName
,
null
,
null
,
orgCode
);
fanHealthIndexDays
=
fanHealthIndexDays
.
stream
().
sorted
(
Comparator
.
comparing
(
PvHealthIndexDay:
:
getAnalysisTime
)).
collect
(
Collectors
.
toList
());
fanHealthIndexDays
=
fanHealthIndexDays
.
stream
().
sorted
(
Comparator
.
comparing
(
PvHealthIndexDay:
:
getAnalysisTime
)).
collect
(
Collectors
.
toList
());
for
(
PvHealthIndexDay
obj
:
fanHealthIndexDays
)
{
for
(
PvHealthIndexDay
obj
:
fanHealthIndexDays
)
{
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/TDBigScreenAnalyseController.java
View file @
9276b616
...
@@ -163,9 +163,9 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -163,9 +163,9 @@ public class TDBigScreenAnalyseController extends BaseController {
wrapper
.
eq
(
FanHealthIndex:
:
getGatewayId
,
stationCode
);
wrapper
.
eq
(
FanHealthIndex:
:
getGatewayId
,
stationCode
);
FanHealthIndex
fanHealthIndex
=
fanHealthIndexMapper
.
selectOne
(
wrapper
);
FanHealthIndex
fanHealthIndex
=
fanHealthIndexMapper
.
selectOne
(
wrapper
);
//预防空指针
//预防空指针
if
(
Objects
.
isNull
(
fanHealthIndex
))
{
if
(
Objects
.
isNull
(
fanHealthIndex
))
{
stringBigDecimalHashMap
.
put
(
"value"
,
""
);
stringBigDecimalHashMap
.
put
(
"value"
,
""
);
}
else
{
}
else
{
stringBigDecimalHashMap
.
put
(
"value"
,
stringBigDecimalHashMap
.
put
(
"value"
,
BigDecimal
.
valueOf
(
fanHealthIndex
.
getHealthIndex
()).
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
));
BigDecimal
.
valueOf
(
fanHealthIndex
.
getHealthIndex
()).
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
));
}
}
...
@@ -177,9 +177,9 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -177,9 +177,9 @@ public class TDBigScreenAnalyseController extends BaseController {
pvwrapper
.
last
(
"limit 1"
);
pvwrapper
.
last
(
"limit 1"
);
PvHealthIndex
pvHealthIndex
=
pvHealthIndexMapper
.
selectOne
(
pvwrapper
);
PvHealthIndex
pvHealthIndex
=
pvHealthIndexMapper
.
selectOne
(
pvwrapper
);
//预防空指针
//预防空指针
if
(
Objects
.
isNull
(
pvHealthIndex
))
{
if
(
Objects
.
isNull
(
pvHealthIndex
))
{
stringBigDecimalHashMap
.
put
(
"value"
,
""
);
stringBigDecimalHashMap
.
put
(
"value"
,
""
);
}
else
{
}
else
{
stringBigDecimalHashMap
.
put
(
"value"
,
stringBigDecimalHashMap
.
put
(
"value"
,
BigDecimal
.
valueOf
(
pvHealthIndex
.
getHealthIndex
()).
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
));
BigDecimal
.
valueOf
(
pvHealthIndex
.
getHealthIndex
()).
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
));
}
}
...
@@ -296,25 +296,27 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -296,25 +296,27 @@ public class TDBigScreenAnalyseController extends BaseController {
@RequestParam
(
required
=
false
)
String
station
,
@RequestParam
(
required
=
false
)
String
analysisType
,
@RequestParam
(
required
=
false
)
String
station
,
@RequestParam
(
required
=
false
)
String
analysisType
,
@RequestParam
(
required
=
false
)
Date
startTime
,
@RequestParam
(
required
=
false
)
Date
endTime
)
{
@RequestParam
(
required
=
false
)
Date
startTime
,
@RequestParam
(
required
=
false
)
Date
endTime
)
{
String
finalStationCode
=
null
;
String
finalAreaCode
=
null
;
String
stationType
=
null
;
if
(
StrUtil
.
isNotEmpty
(
stationCode
))
{
if
(
StrUtil
.
isNotEmpty
(
stationCode
))
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationCode
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationCode
);
stationCode
=
stationBasic
.
getFanGatewayId
();
finalStationCode
=
stationBasic
.
getFanGatewayId
();
stationType
=
stationBasic
.
getStationType
();
}
else
if
(
StrUtil
.
isNotEmpty
(
station
))
{
}
else
if
(
StrUtil
.
isNotEmpty
(
station
))
{
// 由于命名不统一
// 由于命名不统一
StationBasic
stationBasic
=
stationBasicMapper
.
selectOne
(
new
LambdaQueryWrapper
<
StationBasic
>()
StationBasic
stationBasic
=
stationBasicMapper
.
selectOne
(
new
LambdaQueryWrapper
<
StationBasic
>()
.
eq
(
StationBasic:
:
getStationName
,
station
.
substring
(
0
,
station
.
length
()
-
1
)
+
'场'
).
or
()
.
eq
(
StationBasic:
:
getStationName
,
station
.
substring
(
0
,
station
.
length
()
-
1
)
+
'场'
).
or
()
.
eq
(
StationBasic:
:
getStationName
,
station
.
substring
(
0
,
station
.
length
()
-
1
)
+
'站'
));
.
eq
(
StationBasic:
:
getStationName
,
station
.
substring
(
0
,
station
.
length
()
-
1
)
+
'站'
));
stationCode
=
stationBasic
.
getFanGatewayId
();
finalStationCode
=
stationBasic
.
getFanGatewayId
();
stationType
=
stationBasic
.
getStationType
();
}
}
if
(
StrUtil
.
isNotEmpty
(
areaCode
))
{
if
(
StrUtil
.
isNotEmpty
(
areaCode
))
{
a
reaCode
=
"%"
+
areaCode
+
"%"
;
finalA
reaCode
=
"%"
+
areaCode
+
"%"
;
}
else
if
(
StrUtil
.
isNotEmpty
(
area
))
{
}
else
if
(
StrUtil
.
isNotEmpty
(
area
))
{
a
reaCode
=
"%"
+
area
+
"%"
;
finalA
reaCode
=
"%"
+
area
+
"%"
;
}
}
String
finalStationCode
=
stationCode
;
String
finalAreaCode
=
areaCode
;
List
<
String
>
valueList
;
List
<
String
>
valueList
;
List
<
String
>
dateList
;
List
<
String
>
dateList
;
List
<
Map
<
String
,
Object
>>
arrayList
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
arrayList
=
new
ArrayList
<>();
...
@@ -327,11 +329,9 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -327,11 +329,9 @@ public class TDBigScreenAnalyseController extends BaseController {
wrapper
.
eq
(
FanHealthIndex:
:
getAnalysisType
,
"按10分钟"
);
wrapper
.
eq
(
FanHealthIndex:
:
getAnalysisType
,
"按10分钟"
);
if
(
CharSequenceUtil
.
isNotEmpty
(
finalStationCode
))
{
if
(
CharSequenceUtil
.
isNotEmpty
(
finalStationCode
))
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
finalStationCode
);
if
(
"FDZ"
.
equals
(
stationType
))
{
if
(
"FDZ"
.
equals
(
stationBasic
.
getStationType
()))
{
stationCode
=
stationBasic
.
getFanGatewayId
();
wrapper
.
eq
(
FanHealthIndex:
:
getAnalysisObjType
,
"场站"
);
wrapper
.
eq
(
FanHealthIndex:
:
getAnalysisObjType
,
"场站"
);
wrapper
.
eq
(
FanHealthIndex:
:
getGatewayId
,
s
tationCode
);
wrapper
.
eq
(
FanHealthIndex:
:
getGatewayId
,
finalS
tationCode
);
List
<
FanHealthIndex
>
fanHealthIndexList
=
fanHealthIndexMapper
.
selectList
(
wrapper
);
List
<
FanHealthIndex
>
fanHealthIndexList
=
fanHealthIndexMapper
.
selectList
(
wrapper
);
valueList
=
fanHealthIndexList
.
stream
().
map
(
t
->
String
.
valueOf
(
BigDecimal
.
valueOf
(
t
.
getHealthIndex
())
valueList
=
fanHealthIndexList
.
stream
().
map
(
t
->
String
.
valueOf
(
BigDecimal
.
valueOf
(
t
.
getHealthIndex
())
.
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
))).
collect
(
Collectors
.
toList
());
.
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
))).
collect
(
Collectors
.
toList
());
...
@@ -456,7 +456,6 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -456,7 +456,6 @@ public class TDBigScreenAnalyseController extends BaseController {
List
<
String
>
list
=
new
ArrayList
<>();
List
<
String
>
list
=
new
ArrayList
<>();
list
=
Arrays
.
asList
(
"华北区域"
,
"东北区域"
,
"华东区域"
,
"华南区域"
,
"西南区域"
,
"西北区域"
,
"华中区域"
);
list
=
Arrays
.
asList
(
"华北区域"
,
"东北区域"
,
"华东区域"
,
"华南区域"
,
"西南区域"
,
"西北区域"
,
"华中区域"
);
List
<
Object
>
seriesData
=
new
ArrayList
<>();
List
<
Object
>
seriesData
=
new
ArrayList
<>();
...
@@ -484,17 +483,16 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -484,17 +483,16 @@ public class TDBigScreenAnalyseController extends BaseController {
.
get
()).
collect
(
Collectors
.
toMap
(
FanHealthIndex:
:
getArea
,
Function
.
identity
()));
.
get
()).
collect
(
Collectors
.
toMap
(
FanHealthIndex:
:
getArea
,
Function
.
identity
()));
List
<
String
>
axisData
=
latestData
.
values
().
stream
().
map
(
t
->
t
.
getArea
()).
collect
(
Collectors
.
toList
());
List
<
String
>
axisData
=
latestData
.
values
().
stream
().
map
(
t
->
t
.
getArea
()).
collect
(
Collectors
.
toList
());
List
<
String
>
list
=
Arrays
.
asList
(
"华北区域"
,
"东北区域"
,
"华东区域"
,
"华南区域"
,
"西南区域"
,
"西北区域"
,
"华中区域"
);
List
<
String
>
list
=
Arrays
.
asList
(
"华北区域"
,
"东北区域"
,
"华东区域"
,
"华南区域"
,
"西南区域"
,
"西北区域"
,
"华中区域"
);
List
<
String
>
finalList
=
Stream
.
concat
(
list
.
stream
(),
axisData
.
stream
()).
distinct
().
collect
(
Collectors
.
toList
());
List
<
String
>
finalList
=
Stream
.
concat
(
list
.
stream
(),
axisData
.
stream
()).
distinct
().
collect
(
Collectors
.
toList
());
List
<
Object
>
seriesData
=
new
ArrayList
<>();
List
<
Object
>
seriesData
=
new
ArrayList
<>();
finalList
.
forEach
(
item
->
finalList
.
forEach
(
item
->
seriesData
.
add
(
latestData
.
get
(
item
)
==
null
?
"100.0"
:
String
.
valueOf
(
BigDecimal
.
valueOf
(
latestData
.
get
(
item
).
getHealthIndex
()).
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
))));
seriesData
.
add
(
latestData
.
get
(
item
)
==
null
?
"100.0"
:
String
.
valueOf
(
BigDecimal
.
valueOf
(
latestData
.
get
(
item
).
getHealthIndex
()).
setScale
(
1
,
BigDecimal
.
ROUND_HALF_UP
))));
resultMap
.
put
(
"axisData"
,
finalList
);
resultMap
.
put
(
"axisData"
,
finalList
);
resultMap
.
put
(
"seriesData"
,
seriesData
);
resultMap
.
put
(
"seriesData"
,
seriesData
);
return
ResponseHelper
.
buildResponse
(
resultMap
);
return
ResponseHelper
.
buildResponse
(
resultMap
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"片区场站设备健康状态指数 "
,
notes
=
"片区场站设备健康状态指数 "
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"片区场站设备健康状态指数 "
,
notes
=
"片区场站设备健康状态指数 "
)
@GetMapping
(
value
=
"/getStationHealthInfoByMinute"
)
@GetMapping
(
value
=
"/getStationHealthInfoByMinute"
)
...
@@ -1584,24 +1582,23 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -1584,24 +1582,23 @@ public class TDBigScreenAnalyseController extends BaseController {
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
String
startTime
=
DateUtils
.
convertDateToString
(
DateUtils
.
dateAddMinutes
(
new
Date
(),
-
10
),
DateUtils
.
DATE_TIME_PATTERN
);
LambdaQueryWrapper
<
FanHealthIndex
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
String
endTime
=
DateUtils
.
convertDateToString
(
new
Date
(),
DateUtils
.
DATE_TIME_PATTERN
);
lambdaQueryWrapper
.
eq
(
FanHealthIndex:
:
getIndexAddress
,
indexAddress
);
lambdaQueryWrapper
.
eq
(
FanHealthIndex:
:
getGatewayId
,
stationBasic
.
getFanGatewayId
());
lambdaQueryWrapper
.
eq
(
FanHealthIndex:
:
getAnalysisObjType
,
"测点"
);
LambdaQueryWrapper
<
FanHealthIndexDay
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>(
);
lambdaQueryWrapper
.
orderByDesc
(
FanHealthIndex:
:
getTs
);
lambdaQueryWrapper
.
eq
(
FanHealthIndex
Day:
:
getIndexAddress
,
indexAddress
);
lambdaQueryWrapper
.
eq
(
FanHealthIndex
:
:
getAnalysisType
,
"按10分钟"
);
lambdaQueryWrapper
.
eq
(
FanHealthIndexDay:
:
getGatewayId
,
stationBasic
.
getFanGatewayId
()
);
lambdaQueryWrapper
.
last
(
"limit 15"
);
lambdaQueryWrapper
.
eq
(
FanHealthIndexDay:
:
getAnalysisObjType
,
"测点"
);
lambdaQueryWrapper
.
le
(
FanHealthIndexDay:
:
getRecDate
,
endTime
);
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>(
);
lambdaQueryWrapper
.
ge
(
FanHealthIndexDay:
:
getRecDate
,
startTime
);
List
<
FanHealthIndex
>
fanHealthIndexList
=
fanHealthIndexMapper
.
selectList
(
lambdaQueryWrapper
);
List
<
FanHealthIndexDay
>
fanHealthIndexDayList
=
fanHealthIndexDayMapper
.
selectList
(
lambdaQueryWrapper
);
// List<IndicatorData> indicatorData = indicatorDataMapper.selectDataByAddressAndtime(indexAddress, startTime, endTime, stationBasic.getFanGatewayId());
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
String
>
time
=
new
ArrayList
<>();
List
<
String
>
time
=
new
ArrayList
<>();
List
<
Object
>
valueList
=
new
ArrayList
<>();
List
<
Object
>
valueList
=
new
ArrayList
<>();
fanHealthIndex
Day
List
.
forEach
(
item
->
{
fanHealthIndexList
.
forEach
(
item
->
{
time
.
add
(
item
.
getRecDate
()
.
substring
(
0
,
10
)
);
time
.
add
(
item
.
getRecDate
());
String
format
=
df
.
format
(
item
.
getHealthIndex
());
String
format
=
df
.
format
(
item
.
getHealthIndex
());
valueList
.
add
(
format
);
valueList
.
add
(
format
);
});
});
...
@@ -1623,24 +1620,22 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -1623,24 +1620,22 @@ public class TDBigScreenAnalyseController extends BaseController {
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
)
{
@RequestParam
(
value
=
"stationId"
,
required
=
false
)
String
stationId
)
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
String
startTime
=
DateUtils
.
convertDateToString
(
DateUtils
.
dateAddMinutes
(
new
Date
(),
-
10
),
DateUtils
.
DATE_TIME_PATTERN
);
String
endTime
=
DateUtils
.
convertDateToString
(
new
Date
(),
DateUtils
.
DATE_TIME_PATTERN
);
LambdaQueryWrapper
<
PvHealthIndexDay
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
PvHealthIndex
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
lambdaQueryWrapper
.
eq
(
PvHealthIndexDay:
:
getIndexAddress
,
indexAddress
);
lambdaQueryWrapper
.
eq
(
PvHealthIndex:
:
getIndexAddress
,
indexAddress
);
lambdaQueryWrapper
.
eq
(
PvHealthIndexDay:
:
getGatewayId
,
stationBasic
.
getFanGatewayId
());
lambdaQueryWrapper
.
eq
(
PvHealthIndex:
:
getGatewayId
,
stationBasic
.
getFanGatewayId
());
lambdaQueryWrapper
.
eq
(
PvHealthIndexDay:
:
getAnalysisObjType
,
"测点"
);
lambdaQueryWrapper
.
eq
(
PvHealthIndex:
:
getAnalysisObjType
,
"测点"
);
lambdaQueryWrapper
.
le
(
PvHealthIndexDay:
:
getRecDate
,
endTime
);
lambdaQueryWrapper
.
orderByDesc
(
PvHealthIndex:
:
getTs
);
lambdaQueryWrapper
.
ge
(
PvHealthIndexDay:
:
getRecDate
,
startTime
);
lambdaQueryWrapper
.
eq
(
PvHealthIndex:
:
getAnalysisType
,
"按10分钟"
);
lambdaQueryWrapper
.
last
(
"limit 15"
);
List
<
PvHealthIndexDay
>
fanHealthIndexDayList
=
pvHealthIndexDayMapper
.
selectList
(
lambdaQueryWrapper
);
List
<
PvHealthIndex
>
fanHealthIndexDayList
=
pvHealthIndexMapper
.
selectList
(
lambdaQueryWrapper
);
// List<IndicatorData> indicatorData = indicatorDataMapper.selectDataByAddressAndtime(indexAddress, startTime, endTime, stationBasic.getFanGatewayId());
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
String
>
time
=
new
ArrayList
<>();
List
<
String
>
time
=
new
ArrayList
<>();
List
<
Object
>
valueList
=
new
ArrayList
<>();
List
<
Object
>
valueList
=
new
ArrayList
<>();
fanHealthIndexDayList
.
forEach
(
item
->
{
fanHealthIndexDayList
.
forEach
(
item
->
{
time
.
add
(
item
.
getRecDate
()
.
substring
(
0
,
10
)
);
time
.
add
(
item
.
getRecDate
());
String
format
=
df
.
format
(
item
.
getHealthIndex
());
String
format
=
df
.
format
(
item
.
getHealthIndex
());
valueList
.
add
(
format
);
valueList
.
add
(
format
);
});
});
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/FanHealthIndexServiceImpl.java
View file @
9276b616
...
@@ -14,12 +14,15 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex;
...
@@ -14,12 +14,15 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.function.Function
;
import
java.util.function.Supplier
;
import
java.util.function.Supplier
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -49,6 +52,9 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
...
@@ -49,6 +52,9 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
@Autowired
@Autowired
private
IdxBizPvWeightMapper
idxBizPvWeightMapper
;
private
IdxBizPvWeightMapper
idxBizPvWeightMapper
;
@Value
(
"${analysis.weightRounding:false}"
)
private
Boolean
weightRounding
;
@Override
@Override
public
List
<
FanHealthIndex
>
getInfoListByGroupByCdFan
(
String
startTime
,
String
tableName
,
String
analysisObjectType
)
{
public
List
<
FanHealthIndex
>
getInfoListByGroupByCdFan
(
String
startTime
,
String
tableName
,
String
analysisObjectType
)
{
List
<
FanHealthIndex
>
fanHealthIndicesZxt
=
fanHealthIndexMapper
.
getInfoList
(
startTime
,
tableName
,
analysisObjectType
);
List
<
FanHealthIndex
>
fanHealthIndicesZxt
=
fanHealthIndexMapper
.
getInfoList
(
startTime
,
tableName
,
analysisObjectType
);
...
@@ -81,11 +87,8 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
...
@@ -81,11 +87,8 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
// 但如果没有配置子系统的权重,如何计算?
// 但如果没有配置子系统的权重,如何计算?
try
{
try
{
// 加权平均
// 加权平均
Double
totalHealthIndex
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubSystem
()
+
o
.
getPointName
(),
weightMap
)
*
o
.
getHealthIndex
()).
sum
();
Function
<
FanHealthIndex
,
String
>
assembleKey
=
o
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubSystem
()
+
o
.
getPointName
();
Double
totalAnomaly
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubSystem
()
+
o
.
getPointName
(),
weightMap
)
*
o
.
getAnomaly
()).
sum
();
this
.
weightedMean
(
assembleKey
,
fanHealthIndex
,
v
,
weightMap
);
Double
totalWeight
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubSystem
()
+
o
.
getPointName
(),
weightMap
)).
sum
();
fanHealthIndex
.
setAnomaly
(
totalAnomaly
/
totalWeight
);
fanHealthIndex
.
setHealthIndex
(
totalHealthIndex
/
totalWeight
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// 普通平均
// 普通平均
this
.
calculateAvg
(
fanHealthIndex
,
v
);
this
.
calculateAvg
(
fanHealthIndex
,
v
);
...
@@ -137,11 +140,8 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
...
@@ -137,11 +140,8 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
// 但如果没有配置子系统的权重,如何计算?
// 但如果没有配置子系统的权重,如何计算?
try
{
try
{
// 加权平均
// 加权平均
Double
totalHealthIndex
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubSystem
()
+
o
.
getPointName
(),
weightMap
)
*
o
.
getHealthIndex
()).
sum
();
Function
<
FanHealthIndex
,
String
>
assembleKey
=
o
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubSystem
()
+
o
.
getPointName
();
Double
totalAnomaly
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubSystem
()
+
o
.
getPointName
(),
weightMap
)
*
o
.
getAnomaly
()).
sum
();
this
.
weightedMean
(
assembleKey
,
fanHealthIndex
,
v
,
weightMap
);
Double
totalWeight
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubSystem
()
+
o
.
getPointName
(),
weightMap
)).
sum
();
fanHealthIndex
.
setAnomaly
(
totalAnomaly
/
totalWeight
);
fanHealthIndex
.
setHealthIndex
(
totalHealthIndex
/
totalWeight
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// 普通平均
// 普通平均
this
.
calculateAvg
(
fanHealthIndex
,
v
);
this
.
calculateAvg
(
fanHealthIndex
,
v
);
...
@@ -192,11 +192,8 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
...
@@ -192,11 +192,8 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
// 但如果没有配置子系统的权重,如何计算?
// 但如果没有配置子系统的权重,如何计算?
try
{
try
{
// 加权平均
// 加权平均
Double
totalHealthIndex
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubSystem
(),
weightMap
)
*
o
.
getHealthIndex
()).
sum
();
Function
<
FanHealthIndex
,
String
>
assembleKey
=
o
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubSystem
();
Double
totalAnomaly
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubSystem
(),
weightMap
)
*
o
.
getAnomaly
()).
sum
();
this
.
weightedMean
(
assembleKey
,
fanHealthIndex
,
v
,
weightMap
);
Double
totalWeight
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubSystem
(),
weightMap
)).
sum
();
fanHealthIndex
.
setAnomaly
(
totalAnomaly
/
totalWeight
);
fanHealthIndex
.
setHealthIndex
(
totalHealthIndex
/
totalWeight
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// 普通平均
// 普通平均
this
.
calculateAvg
(
fanHealthIndex
,
v
);
this
.
calculateAvg
(
fanHealthIndex
,
v
);
...
@@ -245,11 +242,8 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
...
@@ -245,11 +242,8 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
// 但如果没有配置子系统的权重,如何计算?
// 但如果没有配置子系统的权重,如何计算?
try
{
try
{
// 加权平均
// 加权平均
Double
totalHealthIndex
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
(),
weightMap
)
*
o
.
getHealthIndex
()).
sum
();
Function
<
FanHealthIndex
,
String
>
assembleKey
=
o
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
();
Double
totalAnomaly
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
(),
weightMap
)
*
o
.
getAnomaly
()).
sum
();
this
.
weightedMean
(
assembleKey
,
fanHealthIndex
,
v
,
weightMap
);
Double
totalWeight
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
(),
weightMap
)).
sum
();
fanHealthIndex
.
setAnomaly
(
totalAnomaly
/
totalWeight
);
fanHealthIndex
.
setHealthIndex
(
totalHealthIndex
/
totalWeight
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// 普通平均
// 普通平均
this
.
calculateAvg
(
fanHealthIndex
,
v
);
this
.
calculateAvg
(
fanHealthIndex
,
v
);
...
@@ -297,11 +291,8 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
...
@@ -297,11 +291,8 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
// 但如果没有配置子系统的权重,如何计算?
// 但如果没有配置子系统的权重,如何计算?
try
{
try
{
// 加权平均
// 加权平均
Double
totalHealthIndex
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
(),
weightMap
)
*
o
.
getHealthIndex
()).
sum
();
Function
<
FanHealthIndex
,
String
>
assembleKey
=
o
->
o
.
getArea
()
+
o
.
getStation
();
Double
totalAnomaly
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
(),
weightMap
)
*
o
.
getAnomaly
()).
sum
();
this
.
weightedMean
(
assembleKey
,
fanHealthIndex
,
v
,
weightMap
);
Double
totalWeight
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
(),
weightMap
)).
sum
();
fanHealthIndex
.
setAnomaly
(
totalAnomaly
/
totalWeight
);
fanHealthIndex
.
setHealthIndex
(
totalHealthIndex
/
totalWeight
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// 普通平均
// 普通平均
this
.
calculateAvg
(
fanHealthIndex
,
v
);
this
.
calculateAvg
(
fanHealthIndex
,
v
);
...
@@ -348,11 +339,8 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
...
@@ -348,11 +339,8 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
// 但如果没有配置子系统的权重,如何计算?
// 但如果没有配置子系统的权重,如何计算?
try
{
try
{
// 加权平均
// 加权平均
Double
totalHealthIndex
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
(),
weightMap
)
*
o
.
getHealthIndex
()).
sum
();
Function
<
FanHealthIndex
,
String
>
assembleKey
=
o
->
o
.
getArea
();
Double
totalAnomaly
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
(),
weightMap
)
*
o
.
getAnomaly
()).
sum
();
this
.
weightedMean
(
assembleKey
,
fanHealthIndex
,
v
,
weightMap
);
Double
totalWeight
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
(),
weightMap
)).
sum
();
fanHealthIndex
.
setAnomaly
(
totalAnomaly
/
totalWeight
);
fanHealthIndex
.
setHealthIndex
(
totalHealthIndex
/
totalWeight
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// 普通平均
// 普通平均
this
.
calculateAvg
(
fanHealthIndex
,
v
);
this
.
calculateAvg
(
fanHealthIndex
,
v
);
...
@@ -393,11 +381,8 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
...
@@ -393,11 +381,8 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
// 但如果没有配置子系统的权重,如何计算?
// 但如果没有配置子系统的权重,如何计算?
try
{
try
{
// 加权平均
// 加权平均
Double
totalHealthIndex
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getType
()
+
o
.
getArea
()
+
o
.
getStation
(),
weightMap
)
*
o
.
getHealthIndex
()).
sum
();
Function
<
HealthIndexDTO
,
String
>
assembleKey
=
o
->
o
.
getType
()
+
o
.
getArea
()
+
o
.
getStation
();
Double
totalAnomaly
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getType
()
+
o
.
getArea
()
+
o
.
getStation
(),
weightMap
)
*
o
.
getAnomaly
()).
sum
();
this
.
weightedMean
(
assembleKey
,
healthIndex
,
v
,
weightMap
);
Double
totalWeight
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getType
()
+
o
.
getArea
()
+
o
.
getStation
(),
weightMap
)).
sum
();
healthIndex
.
setAnomaly
(
totalAnomaly
/
totalWeight
);
healthIndex
.
setHealthIndex
(
totalHealthIndex
/
totalWeight
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// 普通平均
// 普通平均
this
.
calculateAvg
(
healthIndex
,
v
);
this
.
calculateAvg
(
healthIndex
,
v
);
...
@@ -438,11 +423,8 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
...
@@ -438,11 +423,8 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
// 但如果没有配置子系统的权重,如何计算?
// 但如果没有配置子系统的权重,如何计算?
try
{
try
{
// 加权平均
// 加权平均
Double
totalHealthIndex
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getType
()
+
o
.
getArea
(),
weightMap
)
*
o
.
getHealthIndex
()).
sum
();
Function
<
HealthIndexDTO
,
String
>
assembleKey
=
o
->
o
.
getType
()
+
o
.
getArea
();
Double
totalAnomaly
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getType
()
+
o
.
getArea
(),
weightMap
)
*
o
.
getAnomaly
()).
sum
();
this
.
weightedMean
(
assembleKey
,
healthIndex
,
v
,
weightMap
);
Double
totalWeight
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getType
()
+
o
.
getArea
(),
weightMap
)).
sum
();
healthIndex
.
setAnomaly
(
totalAnomaly
/
totalWeight
);
healthIndex
.
setHealthIndex
(
totalHealthIndex
/
totalWeight
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// 普通平均
// 普通平均
this
.
calculateAvg
(
healthIndex
,
v
);
this
.
calculateAvg
(
healthIndex
,
v
);
...
@@ -452,14 +434,30 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
...
@@ -452,14 +434,30 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
return
fanHealthIndicesZxtNews
;
return
fanHealthIndicesZxtNews
;
}
}
public
void
weightedMean
(
Function
<
HealthIndexDTO
,
String
>
assembleKey
,
HealthIndexDTO
healthIndex
,
List
<
HealthIndexDTO
>
v
,
Map
<
String
,
Float
>
weightMap
)
{
Double
totalHealthIndex
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
assembleKey
.
apply
(
o
),
weightMap
)
*
o
.
getHealthIndex
()).
sum
();
Double
totalAnomaly
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
assembleKey
.
apply
(
o
),
weightMap
)
*
o
.
getAnomaly
()).
sum
();
Double
totalWeight
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
assembleKey
.
apply
(
o
),
weightMap
)).
sum
();
healthIndex
.
setAnomaly
(
division
(
totalAnomaly
,
totalWeight
));
healthIndex
.
setHealthIndex
(
division
(
totalHealthIndex
,
totalWeight
));
}
public
void
weightedMean
(
Function
<
FanHealthIndex
,
String
>
assembleKey
,
FanHealthIndex
healthIndex
,
List
<
FanHealthIndex
>
v
,
Map
<
String
,
Float
>
weightMap
)
{
Double
totalHealthIndex
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
assembleKey
.
apply
(
o
),
weightMap
)
*
o
.
getHealthIndex
()).
sum
();
Double
totalAnomaly
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
assembleKey
.
apply
(
o
),
weightMap
)
*
o
.
getAnomaly
()).
sum
();
Double
totalWeight
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
assembleKey
.
apply
(
o
),
weightMap
)).
sum
();
healthIndex
.
setAnomaly
(
division
(
totalAnomaly
,
totalWeight
));
healthIndex
.
setHealthIndex
(
division
(
totalHealthIndex
,
totalWeight
));
}
public
void
calculateAvg
(
FanHealthIndex
healthIndex
,
List
<
FanHealthIndex
>
v
)
{
public
void
calculateAvg
(
FanHealthIndex
healthIndex
,
List
<
FanHealthIndex
>
v
)
{
// 普通平均
// 普通平均
Double
avgHealthIndex
=
v
.
stream
().
mapToDouble
(
o
->
o
.
getHealthIndex
()).
sum
();
Double
avgHealthIndex
=
v
.
stream
().
mapToDouble
(
o
->
o
.
getHealthIndex
()).
sum
();
Double
avgAnomaly
=
v
.
stream
().
mapToDouble
(
o
->
o
.
getAnomaly
()).
sum
();
Double
avgAnomaly
=
v
.
stream
().
mapToDouble
(
o
->
o
.
getAnomaly
()).
sum
();
Long
totalHealthIndex
=
v
.
stream
().
filter
(
o
->
o
.
getHealthIndex
()
!=
null
).
mapToDouble
(
o
->
o
.
getHealthIndex
()).
count
();
Long
totalHealthIndex
=
v
.
stream
().
filter
(
o
->
o
.
getHealthIndex
()
!=
null
).
mapToDouble
(
o
->
o
.
getHealthIndex
()).
count
();
Long
totalAnomaly
=
v
.
stream
().
filter
(
o
->
o
.
getAnomaly
()
!=
null
).
mapToDouble
(
o
->
o
.
getAnomaly
()).
count
();
Long
totalAnomaly
=
v
.
stream
().
filter
(
o
->
o
.
getAnomaly
()
!=
null
).
mapToDouble
(
o
->
o
.
getAnomaly
()).
count
();
healthIndex
.
setAnomaly
(
avgAnomaly
/
totalHealthIndex
);
healthIndex
.
setAnomaly
(
division
(
avgAnomaly
,
totalAnomaly
.
doubleValue
())
);
healthIndex
.
setHealthIndex
(
avgHealthIndex
/
totalAnomaly
);
healthIndex
.
setHealthIndex
(
division
(
avgHealthIndex
,
totalHealthIndex
.
doubleValue
())
);
}
}
public
void
calculateAvg
(
HealthIndexDTO
healthIndex
,
List
<
HealthIndexDTO
>
v
)
{
public
void
calculateAvg
(
HealthIndexDTO
healthIndex
,
List
<
HealthIndexDTO
>
v
)
{
...
@@ -468,8 +466,8 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
...
@@ -468,8 +466,8 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
Double
avgAnomaly
=
v
.
stream
().
mapToDouble
(
o
->
o
.
getAnomaly
()).
sum
();
Double
avgAnomaly
=
v
.
stream
().
mapToDouble
(
o
->
o
.
getAnomaly
()).
sum
();
Long
totalHealthIndex
=
v
.
stream
().
filter
(
o
->
o
.
getHealthIndex
()
!=
null
).
mapToDouble
(
o
->
o
.
getHealthIndex
()).
count
();
Long
totalHealthIndex
=
v
.
stream
().
filter
(
o
->
o
.
getHealthIndex
()
!=
null
).
mapToDouble
(
o
->
o
.
getHealthIndex
()).
count
();
Long
totalAnomaly
=
v
.
stream
().
filter
(
o
->
o
.
getAnomaly
()
!=
null
).
mapToDouble
(
o
->
o
.
getAnomaly
()).
count
();
Long
totalAnomaly
=
v
.
stream
().
filter
(
o
->
o
.
getAnomaly
()
!=
null
).
mapToDouble
(
o
->
o
.
getAnomaly
()).
count
();
healthIndex
.
setAnomaly
(
avgAnomaly
/
totalHealthIndex
);
healthIndex
.
setAnomaly
(
division
(
avgAnomaly
,
totalAnomaly
.
doubleValue
())
);
healthIndex
.
setHealthIndex
(
avgHealthIndex
/
totalAnomaly
);
healthIndex
.
setHealthIndex
(
division
(
avgHealthIndex
,
totalHealthIndex
.
doubleValue
())
);
}
}
public
Double
getWeight
(
Supplier
<
String
>
key
,
Map
<
String
,
Float
>
weightMap
)
{
public
Double
getWeight
(
Supplier
<
String
>
key
,
Map
<
String
,
Float
>
weightMap
)
{
...
@@ -513,4 +511,24 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
...
@@ -513,4 +511,24 @@ public class FanHealthIndexServiceImpl implements IFanHealthIndexService {
return
pvHealthIndex
;
return
pvHealthIndex
;
}
}
/**
* 计算的时候,会使用原始数据计算,页面显示数据会四舍五入到1位小数
*
* 启用weightRounding 配置则会四舍五入到小数点后1位
*
* @param a a
* @param b b
* @return {@link Double}
* @throws
* @author yangyang
* @date 2024/7/25 17:28
*/
private
Double
division
(
Double
a
,
Double
b
)
{
if
(
weightRounding
)
{
BigDecimal
c
=
new
BigDecimal
(
a
).
divide
(
new
BigDecimal
(
b
),
1
,
BigDecimal
.
ROUND_HALF_UP
);
return
c
.
doubleValue
();
}
return
a
/
b
;
}
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/PvHealthIndexServiceImpl.java
View file @
9276b616
...
@@ -9,11 +9,14 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex;
...
@@ -9,11 +9,14 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.function.Function
;
import
java.util.function.Supplier
;
import
java.util.function.Supplier
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -37,6 +40,9 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
...
@@ -37,6 +40,9 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
@Autowired
@Autowired
private
IdxBizPvWeightMapper
idxBizPvWeightMapper
;
private
IdxBizPvWeightMapper
idxBizPvWeightMapper
;
@Value
(
"${analysis.weightRounding:false}"
)
private
Boolean
weightRounding
;
@Override
@Override
public
List
<
PvHealthIndex
>
getInfoListByGroupByCdPv
(
String
startTime
,
String
tableName
,
String
analysisObjectType
)
{
public
List
<
PvHealthIndex
>
getInfoListByGroupByCdPv
(
String
startTime
,
String
tableName
,
String
analysisObjectType
)
{
List
<
PvHealthIndex
>
pvHealthIndices
=
pvHealthIndexMapper
.
getInfoList
(
startTime
,
tableName
,
analysisObjectType
);
List
<
PvHealthIndex
>
pvHealthIndices
=
pvHealthIndexMapper
.
getInfoList
(
startTime
,
tableName
,
analysisObjectType
);
...
@@ -70,11 +76,8 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
...
@@ -70,11 +76,8 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
// 但如果没有配置子系统的权重,如何计算?
// 但如果没有配置子系统的权重,如何计算?
try
{
try
{
// 加权平均
// 加权平均
Double
totalHealthIndex
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubarray
()
+
o
.
getPointName
(),
weightMap
)
*
o
.
getHealthIndex
()).
sum
();
Function
<
PvHealthIndex
,
String
>
assembleKey
=
o
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubarray
()
+
o
.
getPointName
();
Double
totalAnomaly
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubarray
()
+
o
.
getPointName
(),
weightMap
)
*
o
.
getAnomaly
()).
sum
();
this
.
weightedMean
(
assembleKey
,
pvHealthIndex
,
v
,
weightMap
);
Double
totalWeight
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubarray
()
+
o
.
getPointName
(),
weightMap
)).
sum
();
pvHealthIndex
.
setAnomaly
(
totalAnomaly
/
totalWeight
);
pvHealthIndex
.
setHealthIndex
(
totalHealthIndex
/
totalWeight
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// 普通平均
// 普通平均
this
.
calculateAvg
(
pvHealthIndex
,
v
);
this
.
calculateAvg
(
pvHealthIndex
,
v
);
...
@@ -127,11 +130,8 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
...
@@ -127,11 +130,8 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
// 但如果没有配置子系统的权重,如何计算?
// 但如果没有配置子系统的权重,如何计算?
try
{
try
{
// 加权平均
// 加权平均
Double
totalHealthIndex
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubarray
()
+
o
.
getPointName
(),
weightMap
)
*
o
.
getHealthIndex
()).
sum
();
Function
<
PvHealthIndex
,
String
>
assembleKey
=
o
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubarray
()
+
o
.
getPointName
();
Double
totalAnomaly
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubarray
()
+
o
.
getPointName
(),
weightMap
)
*
o
.
getAnomaly
()).
sum
();
this
.
weightedMean
(
assembleKey
,
pvHealthIndex
,
v
,
weightMap
);
Double
totalWeight
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubarray
()
+
o
.
getPointName
(),
weightMap
)).
sum
();
pvHealthIndex
.
setAnomaly
(
totalAnomaly
/
totalWeight
);
pvHealthIndex
.
setHealthIndex
(
totalHealthIndex
/
totalWeight
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// 普通平均
// 普通平均
this
.
calculateAvg
(
pvHealthIndex
,
v
);
this
.
calculateAvg
(
pvHealthIndex
,
v
);
...
@@ -183,11 +183,8 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
...
@@ -183,11 +183,8 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
// 但如果没有配置子系统的权重,如何计算?
// 但如果没有配置子系统的权重,如何计算?
try
{
try
{
// 加权平均
// 加权平均
Double
totalHealthIndex
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubarray
(),
weightMap
)
*
o
.
getHealthIndex
()).
sum
();
Function
<
PvHealthIndex
,
String
>
assembleKey
=
o
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubarray
();
Double
totalAnomaly
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubarray
(),
weightMap
)
*
o
.
getAnomaly
()).
sum
();
this
.
weightedMean
(
assembleKey
,
pvHealthIndex
,
v
,
weightMap
);
Double
totalWeight
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
()
+
o
.
getSubarray
(),
weightMap
)).
sum
();
pvHealthIndex
.
setAnomaly
(
totalAnomaly
/
totalWeight
);
pvHealthIndex
.
setHealthIndex
(
totalHealthIndex
/
totalWeight
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// 普通平均
// 普通平均
this
.
calculateAvg
(
pvHealthIndex
,
v
);
this
.
calculateAvg
(
pvHealthIndex
,
v
);
...
@@ -238,11 +235,8 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
...
@@ -238,11 +235,8 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
// 但如果没有配置子系统的权重,如何计算?
// 但如果没有配置子系统的权重,如何计算?
try
{
try
{
// 加权平均
// 加权平均
Double
totalHealthIndex
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
(),
weightMap
)
*
o
.
getHealthIndex
()).
sum
();
Function
<
PvHealthIndex
,
String
>
assembleKey
=
o
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
();
Double
totalAnomaly
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
(),
weightMap
)
*
o
.
getAnomaly
()).
sum
();
this
.
weightedMean
(
assembleKey
,
pvHealthIndex
,
v
,
weightMap
);
Double
totalWeight
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
()
+
o
.
getEquipmentName
(),
weightMap
)).
sum
();
pvHealthIndex
.
setAnomaly
(
totalAnomaly
/
totalWeight
);
pvHealthIndex
.
setHealthIndex
(
totalHealthIndex
/
totalWeight
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// 普通平均
// 普通平均
this
.
calculateAvg
(
pvHealthIndex
,
v
);
this
.
calculateAvg
(
pvHealthIndex
,
v
);
...
@@ -291,11 +285,8 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
...
@@ -291,11 +285,8 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
// 但如果没有配置子系统的权重,如何计算?
// 但如果没有配置子系统的权重,如何计算?
try
{
try
{
// 加权平均
// 加权平均
Double
totalHealthIndex
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
(),
weightMap
)
*
o
.
getHealthIndex
()).
sum
();
Function
<
PvHealthIndex
,
String
>
assembleKey
=
o
->
o
.
getArea
()
+
o
.
getStation
();
Double
totalAnomaly
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
(),
weightMap
)
*
o
.
getAnomaly
()).
sum
();
this
.
weightedMean
(
assembleKey
,
pvHealthIndex
,
v
,
weightMap
);
Double
totalWeight
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
()
+
o
.
getStation
(),
weightMap
)).
sum
();
pvHealthIndex
.
setAnomaly
(
totalAnomaly
/
totalWeight
);
pvHealthIndex
.
setHealthIndex
(
totalHealthIndex
/
totalWeight
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// 普通平均
// 普通平均
this
.
calculateAvg
(
pvHealthIndex
,
v
);
this
.
calculateAvg
(
pvHealthIndex
,
v
);
...
@@ -343,11 +334,8 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
...
@@ -343,11 +334,8 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
// 但如果没有配置子系统的权重,如何计算?
// 但如果没有配置子系统的权重,如何计算?
try
{
try
{
// 加权平均
// 加权平均
Double
totalHealthIndex
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
(),
weightMap
)
*
o
.
getHealthIndex
()).
sum
();
Function
<
PvHealthIndex
,
String
>
assembleKey
=
o
->
o
.
getArea
();
Double
totalAnomaly
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
(),
weightMap
)
*
o
.
getAnomaly
()).
sum
();
this
.
weightedMean
(
assembleKey
,
pvHealthIndex
,
v
,
weightMap
);
Double
totalWeight
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
o
.
getArea
(),
weightMap
)).
sum
();
pvHealthIndex
.
setAnomaly
(
totalAnomaly
/
totalWeight
);
pvHealthIndex
.
setHealthIndex
(
totalHealthIndex
/
totalWeight
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// 普通平均
// 普通平均
this
.
calculateAvg
(
pvHealthIndex
,
v
);
this
.
calculateAvg
(
pvHealthIndex
,
v
);
...
@@ -357,15 +345,44 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
...
@@ -357,15 +345,44 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
return
pvHealthIndexList
;
return
pvHealthIndexList
;
}
}
/**
* 加权平均
*
* @param assembleKey assembleKey
* @param healthIndex healthIndex
* @param v v
* @param weightMap weightMap
* @return {@link }
* @throws
* @author yangyang
* @date 2024/7/25 17:36
*/
public
void
weightedMean
(
Function
<
PvHealthIndex
,
String
>
assembleKey
,
PvHealthIndex
healthIndex
,
List
<
PvHealthIndex
>
v
,
Map
<
String
,
Float
>
weightMap
)
{
Double
totalHealthIndex
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
assembleKey
.
apply
(
o
),
weightMap
)
*
o
.
getHealthIndex
()).
sum
();
Double
totalAnomaly
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
assembleKey
.
apply
(
o
),
weightMap
)
*
o
.
getAnomaly
()).
sum
();
Double
totalWeight
=
v
.
stream
().
mapToDouble
(
o
->
getWeight
(()
->
assembleKey
.
apply
(
o
),
weightMap
)).
sum
();
healthIndex
.
setAnomaly
(
division
(
totalAnomaly
,
totalWeight
));
healthIndex
.
setHealthIndex
(
division
(
totalHealthIndex
,
totalWeight
));
}
/**
* 普通平均
*
* @param healthIndex healthIndex
* @param v v
* @return {@link }
* @throws
* @author yangyang
* @date 2024/7/25 17:37
*/
public
void
calculateAvg
(
PvHealthIndex
healthIndex
,
List
<
PvHealthIndex
>
v
)
{
public
void
calculateAvg
(
PvHealthIndex
healthIndex
,
List
<
PvHealthIndex
>
v
)
{
// 普通平均
// 普通平均
Double
avgHealthIndex
=
v
.
stream
().
mapToDouble
(
o
->
o
.
getHealthIndex
()).
sum
();
Double
avgHealthIndex
=
v
.
stream
().
mapToDouble
(
o
->
o
.
getHealthIndex
()).
sum
();
Double
avgAnomaly
=
v
.
stream
().
mapToDouble
(
o
->
o
.
getAnomaly
()).
sum
();
Double
avgAnomaly
=
v
.
stream
().
mapToDouble
(
o
->
o
.
getAnomaly
()).
sum
();
Long
totalHealthIndex
=
v
.
stream
().
filter
(
o
->
o
.
getHealthIndex
()
!=
null
).
mapToDouble
(
o
->
o
.
getHealthIndex
()).
count
();
Long
totalHealthIndex
=
v
.
stream
().
filter
(
o
->
o
.
getHealthIndex
()
!=
null
).
mapToDouble
(
o
->
o
.
getHealthIndex
()).
count
();
Long
totalAnomaly
=
v
.
stream
().
filter
(
o
->
o
.
getAnomaly
()
!=
null
).
mapToDouble
(
o
->
o
.
getAnomaly
()).
count
();
Long
totalAnomaly
=
v
.
stream
().
filter
(
o
->
o
.
getAnomaly
()
!=
null
).
mapToDouble
(
o
->
o
.
getAnomaly
()).
count
();
healthIndex
.
setAnomaly
(
avgAnomaly
/
totalHealthIndex
);
healthIndex
.
setAnomaly
(
division
(
avgAnomaly
,
totalAnomaly
.
doubleValue
())
);
healthIndex
.
setHealthIndex
(
avgHealthIndex
/
totalAnomaly
);
healthIndex
.
setHealthIndex
(
division
(
avgHealthIndex
,
totalHealthIndex
.
doubleValue
())
);
}
}
public
Double
getWeight
(
Supplier
<
String
>
key
,
Map
<
String
,
Float
>
weightMap
)
{
public
Double
getWeight
(
Supplier
<
String
>
key
,
Map
<
String
,
Float
>
weightMap
)
{
...
@@ -377,4 +394,24 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
...
@@ -377,4 +394,24 @@ public class PvHealthIndexServiceImpl implements IPvHealthIndexService {
return
weight
.
doubleValue
();
return
weight
.
doubleValue
();
}
}
/**
* 计算的时候,会使用原始数据计算,页面显示数据会四舍五入到1位小数
*
* 启用weightRounding 配置则会四舍五入到小数点后1位
*
* @param a a
* @param b b
* @return {@link Double}
* @throws
* @author yangyang
* @date 2024/7/25 17:28
*/
private
Double
division
(
Double
a
,
Double
b
)
{
if
(
weightRounding
)
{
BigDecimal
c
=
new
BigDecimal
(
a
).
divide
(
new
BigDecimal
(
b
),
1
,
BigDecimal
.
ROUND_HALF_UP
);
return
c
.
doubleValue
();
}
return
a
/
b
;
}
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/TdengineTimeServiceImpl.java
View file @
9276b616
...
@@ -474,14 +474,10 @@ public class TdengineTimeServiceImpl {
...
@@ -474,14 +474,10 @@ public class TdengineTimeServiceImpl {
}
}
public
void
printPv
(
String
desc
,
List
<
PvHealthIndex
>
olds
,
List
<
PvHealthIndex
>
news
)
{
public
void
printPv
(
String
desc
,
List
<
PvHealthIndex
>
olds
,
List
<
PvHealthIndex
>
news
)
{
try
{
olds
.
sort
(
Comparator
.
comparing
(
PvHealthIndex:
:
getArea
).
thenComparing
(
PvHealthIndex:
:
getStation
).
thenComparing
(
PvHealthIndex:
:
getSubarray
).
thenComparing
(
PvHealthIndex:
:
getEquipmentName
).
thenComparing
(
PvHealthIndex:
:
getPointName
));
olds
.
sort
(
Comparator
.
comparing
(
PvHealthIndex:
:
getArea
).
thenComparing
(
PvHealthIndex:
:
getStation
).
thenComparing
(
PvHealthIndex:
:
getEquipmentName
).
thenComparing
(
PvHealthIndex:
:
getSubarray
).
thenComparing
(
PvHealthIndex:
:
getPointName
));
news
.
sort
(
Comparator
.
comparing
(
PvHealthIndex:
:
getArea
).
thenComparing
(
PvHealthIndex:
:
getStation
).
thenComparing
(
PvHealthIndex:
:
getSubarray
).
thenComparing
(
PvHealthIndex:
:
getEquipmentName
).
thenComparing
(
PvHealthIndex:
:
getPointName
));
news
.
sort
(
Comparator
.
comparing
(
PvHealthIndex:
:
getArea
).
thenComparing
(
PvHealthIndex:
:
getStation
).
thenComparing
(
PvHealthIndex:
:
getEquipmentName
).
thenComparing
(
PvHealthIndex:
:
getSubarray
).
thenComparing
(
PvHealthIndex:
:
getPointName
));
log
.
info
(
"对比{} old => {}"
,
desc
,
olds
);
log
.
info
(
"对比{} old => {}"
,
desc
,
olds
);
log
.
info
(
"对比{} news => {}"
,
desc
,
news
);
log
.
info
(
"对比{} news => {}"
,
desc
,
news
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
public
void
insertMomentDataAll
(
String
recDate
)
throws
ParseException
{
public
void
insertMomentDataAll
(
String
recDate
)
throws
ParseException
{
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
View file @
9276b616
...
@@ -62,17 +62,16 @@
...
@@ -62,17 +62,16 @@
<if
test=
"analysisType == '按天' or analysisType == null or analysisType == ''"
>
<if
test=
"analysisType == '按天' or analysisType == null or analysisType == ''"
>
AND ANALYSIS_TYPE = '按天'
AND ANALYSIS_TYPE = '按天'
<!-- AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURDATE() - INTERVAL 1 DAY -->
<!-- AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURDATE() - INTERVAL 1 DAY -->
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = get_time_sub(1,'DAY')
</if>
</if>
<if
test=
"analysisType == '按小时'"
>
<if
test=
"analysisType == '按小时'"
>
AND ANALYSIS_TYPE = '按小时'
AND ANALYSIS_TYPE = '按小时'
<!--AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 59 MINUTE ) -->
<!--AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 59 MINUTE ) -->
AND REC_DATE >= get_time_sub(59,'MINUTE')
</if>
</if>
<if
test=
"analysisType == '按10分钟'"
>
<if
test=
"analysisType == '按10分钟'"
>
AND ANALYSIS_TYPE = '按10分钟'
AND ANALYSIS_TYPE = '按10分钟'
<!-- AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) -->
<!-- AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) -->
AND REC_DATE >= get_time_sub(9,'MINUTE')
</if>
</if>
<if
test=
"areaCode != null and areaCode != ''"
>
<if
test=
"areaCode != null and areaCode != ''"
>
AND ARAE like concat('%', #{areaCode}, '%')
AND ARAE like concat('%', #{areaCode}, '%')
...
@@ -96,17 +95,15 @@
...
@@ -96,17 +95,15 @@
<if
test=
"analysisType == '按天' or analysisType == null or analysisType == ''"
>
<if
test=
"analysisType == '按天' or analysisType == null or analysisType == ''"
>
AND ANALYSIS_TYPE = '按天'
AND ANALYSIS_TYPE = '按天'
<!-- AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURDATE() - INTERVAL 1 DAY -->
<!-- AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURDATE() - INTERVAL 1 DAY -->
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = get_time_sub(1,'DAY')
</if>
</if>
<if
test=
"analysisType == '按小时'"
>
<if
test=
"analysisType == '按小时'"
>
AND ANALYSIS_TYPE = '按小时'
AND ANALYSIS_TYPE = '按小时'
<!--AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 59 MINUTE ) -->
<!--AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 59 MINUTE ) -->
AND REC_DATE >= get_time_sub(59,'MINUTE')
</if>
</if>
<if
test=
"analysisType == '按10分钟'"
>
<if
test=
"analysisType == '按10分钟'"
>
AND ANALYSIS_TYPE = '按10分钟'
AND ANALYSIS_TYPE = '按10分钟'
<!-- AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) -->
<!-- AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) -->
AND REC_DATE >= get_time_sub(9,'MINUTE')
</if>
</if>
<if
test=
"areaCode != null and areaCode != ''"
>
<if
test=
"areaCode != null and areaCode != ''"
>
AND ARAE like concat('%', #{areaCode}, '%')
AND ARAE like concat('%', #{areaCode}, '%')
...
@@ -132,7 +129,6 @@
...
@@ -132,7 +129,6 @@
ANALYSIS_TYPE = '按10分钟'
ANALYSIS_TYPE = '按10分钟'
<!-- AND DATE_ADD(DATE_FORMAT( REC_DATE, '%Y-%m-%d' ),INTERVAL 1 DAY) = CURRENT_DATE-->
<!-- AND DATE_ADD(DATE_FORMAT( REC_DATE, '%Y-%m-%d' ),INTERVAL 1 DAY) = CURRENT_DATE-->
<!-- AND CURRENT_DATE = get_time_add(1,'DAY')-->
<!-- AND CURRENT_DATE = get_time_add(1,'DAY')-->
AND REC_DATE >= get_time_sub(9,'MINUTE')
<if
test=
"stationCode != null and stationCode != ''"
>
<if
test=
"stationCode != null and stationCode != ''"
>
AND GATEWAY_ID = #{stationCode}
AND GATEWAY_ID = #{stationCode}
AND ANALYSIS_OBJ_TYPE = '场站'
AND ANALYSIS_OBJ_TYPE = '场站'
...
@@ -250,7 +246,7 @@
...
@@ -250,7 +246,7 @@
AND ANALYSIS_TYPE = '按10分钟'
AND ANALYSIS_TYPE = '按10分钟'
<!-- AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE - INTERVAL 1 DAY-->
<!-- AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE - INTERVAL 1 DAY-->
<!--AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = get_time_sub(1,'DAY')-->
<!--AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = get_time_sub(1,'DAY')-->
AND REC_DATE >= get_time_sub(9,'MINUTE')
GROUP BY ARAE
GROUP BY ARAE
UNION ALL
UNION ALL
(
(
...
@@ -261,7 +257,6 @@
...
@@ -261,7 +257,6 @@
AND ANALYSIS_TYPE = '按10分钟'
AND ANALYSIS_TYPE = '按10分钟'
<!--AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE - INTERVAL 1 DAY-->
<!--AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURRENT_DATE - INTERVAL 1 DAY-->
<!--AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = get_time_sub(1,'DAY')-->
<!--AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = get_time_sub(1,'DAY')-->
AND REC_DATE >= get_time_sub(9,'MINUTE')
GROUP BY ARAE
GROUP BY ARAE
)
)
) a
) a
...
@@ -324,7 +319,6 @@ FROM (
...
@@ -324,7 +319,6 @@ FROM (
AND ANALYSIS_TYPE = '按10分钟'
AND ANALYSIS_TYPE = '按10分钟'
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')-->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')-->
AND REC_DATE >= get_time_sub(9,'MINUTE')
<if
test=
"areaCode != null and areaCode != ''"
>
<if
test=
"areaCode != null and areaCode != ''"
>
AND ARAE like concat('%', #{areaCode}, '%')
AND ARAE like concat('%', #{areaCode}, '%')
</if>
</if>
...
@@ -342,7 +336,6 @@ FROM (
...
@@ -342,7 +336,6 @@ FROM (
AND ANALYSIS_TYPE = '按10分钟'
AND ANALYSIS_TYPE = '按10分钟'
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')-->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')-->
AND REC_DATE >= get_time_sub(9,'MINUTE')
<if
test=
"areaCode != null and areaCode != ''"
>
<if
test=
"areaCode != null and areaCode != ''"
>
AND ARAE like concat('%', #{areaCode}, '%')
AND ARAE like concat('%', #{areaCode}, '%')
</if>
</if>
...
@@ -499,7 +492,6 @@ FROM (
...
@@ -499,7 +492,6 @@ FROM (
AND ANALYSIS_TYPE = '按10分钟'
AND ANALYSIS_TYPE = '按10分钟'
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')-->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')-->
AND REC_DATE >= get_time_sub(9,'MINUTE')
<if
test=
"equipmentName != null and equipmentName != ''"
>
<if
test=
"equipmentName != null and equipmentName != ''"
>
AND EQUIPMENT_NAME like concat( '%', #{equipmentName} ,'风机')
AND EQUIPMENT_NAME like concat( '%', #{equipmentName} ,'风机')
</if>
</if>
...
@@ -537,7 +529,6 @@ FROM (
...
@@ -537,7 +529,6 @@ FROM (
ANALYSIS_OBJ_TYPE = '设备'
ANALYSIS_OBJ_TYPE = '设备'
AND ANALYSIS_TYPE = '按10分钟'
AND ANALYSIS_TYPE = '按10分钟'
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')
<if
test=
"gatewayId != null and gatewayId != ''"
>
<if
test=
"gatewayId != null and gatewayId != ''"
>
AND GATEWAY_ID = #{gatewayId}
AND GATEWAY_ID = #{gatewayId}
</if>
</if>
...
@@ -633,7 +624,7 @@ FROM (
...
@@ -633,7 +624,7 @@ FROM (
<select
id=
"getPvInfoByPage"
resultType=
"java.util.Map"
>
<select
id=
"getPvInfoByPage"
resultType=
"java.util.Map"
>
SELECT
SELECT
SUBARRAY as subarray,
SUBARRAY as subarray,
STATION
AS station
Max(STATION)
AS station
FROM
FROM
idx_biz_pv_point_process_variable_classification
idx_biz_pv_point_process_variable_classification
<where>
<where>
...
@@ -648,7 +639,7 @@ FROM (
...
@@ -648,7 +639,7 @@ FROM (
</select>
</select>
<select
id=
"getPvHealthInfoList"
resultType=
"java.util.Map"
>
<select
id=
"getPvHealthInfoList"
resultType=
"java.util.Map"
>
SELECT
SELECT
IFNULL
( round(AVG( HEALTH_INDEX ), 2
), 0 ) AS avgHealthIndex,
IFNULL
( ROUND( MAX(HEALTH_INDEX), 2
), 0 ) AS avgHealthIndex,
SUBARRAY as subarray
SUBARRAY as subarray
FROM
FROM
pv_health_index_latest_data
pv_health_index_latest_data
...
@@ -656,7 +647,6 @@ FROM (
...
@@ -656,7 +647,6 @@ FROM (
ANALYSIS_OBJ_TYPE = '子阵'
ANALYSIS_OBJ_TYPE = '子阵'
AND ANALYSIS_TYPE = '按10分钟'
AND ANALYSIS_TYPE = '按10分钟'
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')
<if
test=
"gatewayId != null and gatewayId != ''"
>
<if
test=
"gatewayId != null and gatewayId != ''"
>
AND GATEWAY_ID = #{gatewayId}
AND GATEWAY_ID = #{gatewayId}
</if>
</if>
...
@@ -666,6 +656,8 @@ FROM (
...
@@ -666,6 +656,8 @@ FROM (
</select>
</select>
<select
id=
"getPvSubSystemInfo"
resultType=
"java.util.Map"
>
<select
id=
"getPvSubSystemInfo"
resultType=
"java.util.Map"
>
SELECT
SELECT
IFNULL ( ROUND( MAX(HEALTH_INDEX), 2 ), 100 ) AS avgHealthIndex
round(IFNULL( AVG( HEALTH_INDEX ), 100 ), 1) AS avgHealthIndex,
round(IFNULL( AVG( HEALTH_INDEX ), 100 ), 1) AS avgHealthIndex,
EQUIPMENT_NAME AS equipmentName
EQUIPMENT_NAME AS equipmentName
FROM
FROM
...
@@ -675,7 +667,6 @@ FROM (
...
@@ -675,7 +667,6 @@ FROM (
AND ANALYSIS_TYPE = '按10分钟'
AND ANALYSIS_TYPE = '按10分钟'
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURRENT_DATE - INTERVAL 1 DAY-->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')-->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')-->
AND REC_DATE >= get_time_sub(9,'MINUTE')
<if
test=
"subarray != null and subarray != ''"
>
<if
test=
"subarray != null and subarray != ''"
>
AND SUBARRAY = concat('#', #{subarray})
AND SUBARRAY = concat('#', #{subarray})
</if>
</if>
...
@@ -706,7 +697,7 @@ FROM (
...
@@ -706,7 +697,7 @@ FROM (
</select>
</select>
<select
id=
"getPvHealthInfoBySubSystem"
resultType=
"java.util.Map"
>
<select
id=
"getPvHealthInfoBySubSystem"
resultType=
"java.util.Map"
>
SELECT
SELECT
IFNULL(HEALTH_INDEX, 100
) AS healthIndex,
MAX(IFNULL(HEALTH_INDEX, 100)
) AS healthIndex,
POINT_NAME AS pointName
POINT_NAME AS pointName
FROM
FROM
pv_health_index_latest_data
pv_health_index_latest_data
...
@@ -1403,17 +1394,15 @@ FROM (
...
@@ -1403,17 +1394,15 @@ FROM (
<if
test=
"analysisType == '按天' or analysisType == null or analysisType == ''"
>
<if
test=
"analysisType == '按天' or analysisType == null or analysisType == ''"
>
AND ANALYSIS_TYPE = '按天'
AND ANALYSIS_TYPE = '按天'
<!-- AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURDATE() - INTERVAL 1 DAY -->
<!-- AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURDATE() - INTERVAL 1 DAY -->
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = get_time_sub(1,'DAY')
</if>
</if>
<if
test=
"analysisType == '按小时'"
>
<if
test=
"analysisType == '按小时'"
>
AND ANALYSIS_TYPE = '按小时'
AND ANALYSIS_TYPE = '按小时'
<!--AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 59 MINUTE ) -->
<!--AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 59 MINUTE ) -->
AND REC_DATE >= get_time_sub(59,'MINUTE')
</if>
</if>
<if
test=
"analysisType == '按10分钟'"
>
<if
test=
"analysisType == '按10分钟'"
>
AND ANALYSIS_TYPE = '按10分钟'
AND ANALYSIS_TYPE = '按10分钟'
<!-- AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) -->
<!-- AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) -->
AND REC_DATE >= get_time_sub(9,'MINUTE')
</if>
</if>
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
and GATEWAY_ID in
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
and GATEWAY_ID in
<foreach
item=
"item"
index=
"index"
collection=
"gatewayIds"
open=
"("
separator=
","
close=
")"
>
<foreach
item=
"item"
index=
"index"
collection=
"gatewayIds"
open=
"("
separator=
","
close=
")"
>
...
@@ -1432,17 +1421,15 @@ FROM (
...
@@ -1432,17 +1421,15 @@ FROM (
<if
test=
"analysisType == '按天' or analysisType == null or analysisType == ''"
>
<if
test=
"analysisType == '按天' or analysisType == null or analysisType == ''"
>
AND ANALYSIS_TYPE = '按天'
AND ANALYSIS_TYPE = '按天'
<!-- AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURDATE() - INTERVAL 1 DAY -->
<!-- AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURDATE() - INTERVAL 1 DAY -->
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = get_time_sub(1,'DAY')
</if>
</if>
<if
test=
"analysisType == '按小时'"
>
<if
test=
"analysisType == '按小时'"
>
AND ANALYSIS_TYPE = '按小时'
AND ANALYSIS_TYPE = '按小时'
<!--AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 59 MINUTE ) -->
<!--AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 59 MINUTE ) -->
AND REC_DATE >= get_time_sub(59,'MINUTE')
</if>
</if>
<if
test=
"analysisType == '按10分钟'"
>
<if
test=
"analysisType == '按10分钟'"
>
AND ANALYSIS_TYPE = '按10分钟'
AND ANALYSIS_TYPE = '按10分钟'
<!-- AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) -->
<!-- AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) -->
AND REC_DATE >= get_time_sub(9,'MINUTE')
</if>
</if>
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
and GATEWAY_ID in
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
and GATEWAY_ID in
<foreach
item=
"item"
index=
"index"
collection=
"gatewayIds"
open=
"("
separator=
","
close=
")"
>
<foreach
item=
"item"
index=
"index"
collection=
"gatewayIds"
open=
"("
separator=
","
close=
")"
>
...
@@ -1467,17 +1454,15 @@ FROM (
...
@@ -1467,17 +1454,15 @@ FROM (
<if
test=
"analysisType == '按天' or analysisType == null or analysisType == ''"
>
<if
test=
"analysisType == '按天' or analysisType == null or analysisType == ''"
>
AND ANALYSIS_TYPE = '按天'
AND ANALYSIS_TYPE = '按天'
<!-- AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURDATE() - INTERVAL 1 DAY -->
<!-- AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURDATE() - INTERVAL 1 DAY -->
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = get_time_sub(1,'DAY')
</if>
</if>
<if
test=
"analysisType == '按小时'"
>
<if
test=
"analysisType == '按小时'"
>
AND ANALYSIS_TYPE = '按小时'
AND ANALYSIS_TYPE = '按小时'
<!--AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 59 MINUTE ) -->
<!--AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 59 MINUTE ) -->
AND REC_DATE >= get_time_sub(59,'MINUTE')
</if>
</if>
<if
test=
"analysisType == '按10分钟'"
>
<if
test=
"analysisType == '按10分钟'"
>
AND ANALYSIS_TYPE = '按10分钟'
AND ANALYSIS_TYPE = '按10分钟'
<!-- AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) -->
<!-- AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) -->
AND REC_DATE >= get_time_sub(9,'MINUTE')
</if>
</if>
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
and GATEWAY_ID in
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
and GATEWAY_ID in
<foreach
item=
"item"
index=
"index"
collection=
"gatewayIds"
open=
"("
separator=
","
close=
")"
>
<foreach
item=
"item"
index=
"index"
collection=
"gatewayIds"
open=
"("
separator=
","
close=
")"
>
...
@@ -1496,17 +1481,15 @@ FROM (
...
@@ -1496,17 +1481,15 @@ FROM (
<if
test=
"analysisType == '按天' or analysisType == null or analysisType == ''"
>
<if
test=
"analysisType == '按天' or analysisType == null or analysisType == ''"
>
AND ANALYSIS_TYPE = '按天'
AND ANALYSIS_TYPE = '按天'
<!-- AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURDATE() - INTERVAL 1 DAY -->
<!-- AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURDATE() - INTERVAL 1 DAY -->
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = get_time_sub(1,'DAY')
</if>
</if>
<if
test=
"analysisType == '按小时'"
>
<if
test=
"analysisType == '按小时'"
>
AND ANALYSIS_TYPE = '按小时'
AND ANALYSIS_TYPE = '按小时'
<!--AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 59 MINUTE ) -->
<!--AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 59 MINUTE ) -->
AND REC_DATE >= get_time_sub(59,'MINUTE')
</if>
</if>
<if
test=
"analysisType == '按10分钟'"
>
<if
test=
"analysisType == '按10分钟'"
>
AND ANALYSIS_TYPE = '按10分钟'
AND ANALYSIS_TYPE = '按10分钟'
<!-- AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) -->
<!-- AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) -->
AND REC_DATE >= get_time_sub(9,'MINUTE')
</if>
</if>
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
and GATEWAY_ID in
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
and GATEWAY_ID in
<foreach
item=
"item"
index=
"index"
collection=
"gatewayIds"
open=
"("
separator=
","
close=
")"
>
<foreach
item=
"item"
index=
"index"
collection=
"gatewayIds"
open=
"("
separator=
","
close=
")"
>
...
@@ -1534,17 +1517,15 @@ FROM (
...
@@ -1534,17 +1517,15 @@ FROM (
<if
test=
"analysisType == '按天' or analysisType == null or analysisType == ''"
>
<if
test=
"analysisType == '按天' or analysisType == null or analysisType == ''"
>
AND ANALYSIS_TYPE = '按天'
AND ANALYSIS_TYPE = '按天'
<!-- AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURDATE() - INTERVAL 1 DAY -->
<!-- AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURDATE() - INTERVAL 1 DAY -->
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = get_time_sub(1,'DAY')
</if>
</if>
<if
test=
"analysisType == '按小时'"
>
<if
test=
"analysisType == '按小时'"
>
AND ANALYSIS_TYPE = '按小时'
AND ANALYSIS_TYPE = '按小时'
<!--AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 59 MINUTE ) -->
<!--AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 59 MINUTE ) -->
AND REC_DATE >= get_time_sub(59,'MINUTE')
</if>
</if>
<if
test=
"analysisType == '按10分钟'"
>
<if
test=
"analysisType == '按10分钟'"
>
AND ANALYSIS_TYPE = '按10分钟'
AND ANALYSIS_TYPE = '按10分钟'
<!-- AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) -->
<!-- AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) -->
AND REC_DATE >= get_time_sub(9,'MINUTE')
</if>
</if>
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
and GATEWAY_ID in
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
and GATEWAY_ID in
<foreach
item=
"item"
index=
"index"
collection=
"gatewayIds"
open=
"("
separator=
","
close=
")"
>
<foreach
item=
"item"
index=
"index"
collection=
"gatewayIds"
open=
"("
separator=
","
close=
")"
>
...
@@ -1563,17 +1544,15 @@ FROM (
...
@@ -1563,17 +1544,15 @@ FROM (
<if
test=
"analysisType == '按天' or analysisType == null or analysisType == ''"
>
<if
test=
"analysisType == '按天' or analysisType == null or analysisType == ''"
>
AND ANALYSIS_TYPE = '按天'
AND ANALYSIS_TYPE = '按天'
<!-- AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURDATE() - INTERVAL 1 DAY -->
<!-- AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURDATE() - INTERVAL 1 DAY -->
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = get_time_sub(1,'DAY')
</if>
</if>
<if
test=
"analysisType == '按小时'"
>
<if
test=
"analysisType == '按小时'"
>
AND ANALYSIS_TYPE = '按小时'
AND ANALYSIS_TYPE = '按小时'
<!--AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 59 MINUTE ) -->
<!--AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 59 MINUTE ) -->
AND REC_DATE >= get_time_sub(59,'MINUTE')
</if>
</if>
<if
test=
"analysisType == '按10分钟'"
>
<if
test=
"analysisType == '按10分钟'"
>
AND ANALYSIS_TYPE = '按10分钟'
AND ANALYSIS_TYPE = '按10分钟'
<!-- AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) -->
<!-- AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) -->
AND REC_DATE >= get_time_sub(9,'MINUTE')
</if>
</if>
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
and GATEWAY_ID in
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
and GATEWAY_ID in
<foreach
item=
"item"
index=
"index"
collection=
"gatewayIds"
open=
"("
separator=
","
close=
")"
>
<foreach
item=
"item"
index=
"index"
collection=
"gatewayIds"
open=
"("
separator=
","
close=
")"
>
...
@@ -1599,17 +1578,15 @@ FROM (
...
@@ -1599,17 +1578,15 @@ FROM (
<if
test=
"analysisType == '按天' or analysisType == null or analysisType == ''"
>
<if
test=
"analysisType == '按天' or analysisType == null or analysisType == ''"
>
AND ANALYSIS_TYPE = '按天'
AND ANALYSIS_TYPE = '按天'
<!-- AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURDATE() - INTERVAL 1 DAY -->
<!-- AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURDATE() - INTERVAL 1 DAY -->
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = get_time_sub(1,'DAY')
</if>
</if>
<if
test=
"analysisType == '按小时'"
>
<if
test=
"analysisType == '按小时'"
>
AND ANALYSIS_TYPE = '按小时'
AND ANALYSIS_TYPE = '按小时'
<!--AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 59 MINUTE ) -->
<!--AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 59 MINUTE ) -->
AND REC_DATE >= get_time_sub(59,'MINUTE')
</if>
</if>
<if
test=
"analysisType == '按10分钟'"
>
<if
test=
"analysisType == '按10分钟'"
>
AND ANALYSIS_TYPE = '按10分钟'
AND ANALYSIS_TYPE = '按10分钟'
<!-- AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) -->
<!-- AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) -->
AND REC_DATE >= get_time_sub(9,'MINUTE')
</if>
</if>
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
and GATEWAY_ID in
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
and GATEWAY_ID in
<foreach
item=
"item"
index=
"index"
collection=
"gatewayIds"
open=
"("
separator=
","
close=
")"
>
<foreach
item=
"item"
index=
"index"
collection=
"gatewayIds"
open=
"("
separator=
","
close=
")"
>
...
@@ -1628,17 +1605,15 @@ FROM (
...
@@ -1628,17 +1605,15 @@ FROM (
<if
test=
"analysisType == '按天' or analysisType == null or analysisType == ''"
>
<if
test=
"analysisType == '按天' or analysisType == null or analysisType == ''"
>
AND ANALYSIS_TYPE = '按天'
AND ANALYSIS_TYPE = '按天'
<!-- AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURDATE() - INTERVAL 1 DAY -->
<!-- AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = CURDATE() - INTERVAL 1 DAY -->
AND DATE_FORMAT(REC_DATE, '%Y-%m-%d') = get_time_sub(1,'DAY')
</if>
</if>
<if
test=
"analysisType == '按小时'"
>
<if
test=
"analysisType == '按小时'"
>
AND ANALYSIS_TYPE = '按小时'
AND ANALYSIS_TYPE = '按小时'
<!--AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 59 MINUTE ) -->
<!--AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 59 MINUTE ) -->
AND REC_DATE >= get_time_sub(59,'MINUTE')
</if>
</if>
<if
test=
"analysisType == '按10分钟'"
>
<if
test=
"analysisType == '按10分钟'"
>
AND ANALYSIS_TYPE = '按10分钟'
AND ANALYSIS_TYPE = '按10分钟'
<!-- AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) -->
<!-- AND REC_DATE >= DATE_SUB( NOW(), INTERVAL 9 MINUTE ) -->
AND REC_DATE >= get_time_sub(9,'MINUTE')
</if>
</if>
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
and GATEWAY_ID in
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
and GATEWAY_ID in
<foreach
item=
"item"
index=
"index"
collection=
"gatewayIds"
open=
"("
separator=
","
close=
")"
>
<foreach
item=
"item"
index=
"index"
collection=
"gatewayIds"
open=
"("
separator=
","
close=
")"
>
...
@@ -1713,7 +1688,6 @@ FROM (
...
@@ -1713,7 +1688,6 @@ FROM (
ANALYSIS_TYPE = '按10分钟'
ANALYSIS_TYPE = '按10分钟'
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURDATE() - INTERVAL 1 DAY-->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURDATE() - INTERVAL 1 DAY-->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY') -->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY') -->
AND REC_DATE >= get_time_sub(9,'MINUTE')
<if
test=
"areaCode != null and areaCode != ''"
>
<if
test=
"areaCode != null and areaCode != ''"
>
AND ARAE like concat('%', #{areaCode}, '%')
AND ARAE like concat('%', #{areaCode}, '%')
AND ANALYSIS_OBJ_TYPE = '片区'
AND ANALYSIS_OBJ_TYPE = '片区'
...
@@ -1736,7 +1710,6 @@ FROM (
...
@@ -1736,7 +1710,6 @@ FROM (
ANALYSIS_TYPE = '按10分钟'
ANALYSIS_TYPE = '按10分钟'
<!-- AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURDATE() - INTERVAL 1 DAY-->
<!-- AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = CURDATE() - INTERVAL 1 DAY-->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')-->
<!--AND DATE_FORMAT( REC_DATE, '%Y-%m-%d' ) = get_time_sub(1,'DAY')-->
AND REC_DATE >= get_time_sub(9,'MINUTE')
<if
test=
"areaCode != null and areaCode != ''"
>
<if
test=
"areaCode != null and areaCode != ''"
>
AND ARAE like concat('%', #{areaCode}, '%')
AND ARAE like concat('%', #{areaCode}, '%')
AND ANALYSIS_OBJ_TYPE = '片区'
AND ANALYSIS_OBJ_TYPE = '片区'
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/EarningsForecastImpl.java
View file @
9276b616
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.map.MapBuilder
;
import
cn.hutool.core.map.MapBuilder
;
import
cn.hutool.http.HttpUtil
;
import
cn.hutool.http.HttpUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic
;
import
com.yeejoin.amos.boot.module.jxiop.api.entity.StationBasic
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper
;
import
com.yeejoin.amos.boot.module.jxiop.api.mapper.StationBasicMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESMoonPowerGeneration
;
import
com.yeejoin.amos.boot.module.jxiop.biz.ESDto.ESMoonPowerGeneration
;
...
@@ -33,8 +35,16 @@ public class EarningsForecastImpl {
...
@@ -33,8 +35,16 @@ public class EarningsForecastImpl {
private
StationBasicMapper
stationBasicMapper
;
private
StationBasicMapper
stationBasicMapper
;
//收益 时间曲线图数据组装
//收益 时间曲线图数据组装
public
Object
earningsForecastSJQXT
(
Long
stationId
,
String
type
){
public
Object
earningsForecastSJQXT
(
Long
stationId
,
String
type
){
List
<
Map
<
String
,
String
>>
list
=
commonMapper
.
selectAgo10Month
();
List
<
Map
<
String
,
String
>>
lastThreeMonth
=
commonMapper
.
selectLast3Month
();
List
<
String
>
beforeMonth
=
DateUtils
.
getBeforeCurrentMonth
(-
10
,
false
);
List
<
String
>
afterMonth
=
DateUtils
.
getBeforeCurrentMonth
(
3
,
true
);
List
<
Map
<
String
,
String
>>
list
=
beforeMonth
.
stream
()
.
map
(
month
->
MapBuilder
.<
String
,
String
>
create
().
put
(
"MonthYear"
,
month
).
build
())
.
collect
(
Collectors
.
toList
());
List
<
Map
<
String
,
String
>>
lastThreeMonth
=
afterMonth
.
stream
()
.
map
(
month
->
MapBuilder
.<
String
,
String
>
create
().
put
(
"MonthYear"
,
month
).
build
())
.
collect
(
Collectors
.
toList
());
Map
<
String
,
List
<
String
>>
queryCondtion1
=
new
HashMap
<>();
Map
<
String
,
List
<
String
>>
queryCondtion1
=
new
HashMap
<>();
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
...
@@ -124,10 +134,14 @@ public class EarningsForecastImpl {
...
@@ -124,10 +134,14 @@ public class EarningsForecastImpl {
//收益 折线图数据组装
//收益 折线图数据组装
public
Object
earningsForecastZXT
(
Long
stationId
,
String
type
){
public
Object
earningsForecastZXT
(
Long
stationId
,
String
type
){
List
<
Map
<
String
,
String
>>
list
=
commonMapper
.
selectAgo10Month
();
List
<
String
>
beforeMonth
=
DateUtils
.
getBeforeCurrentMonth
(-
10
,
false
);
List
<
Map
<
String
,
String
>>
lastThreeMonth
=
commonMapper
.
selectLast3Month
();
List
<
String
>
afterMonth
=
DateUtils
.
getBeforeCurrentMonth
(
3
,
true
);
List
<
Map
<
String
,
String
>>
list
=
beforeMonth
.
stream
()
.
map
(
month
->
MapBuilder
.<
String
,
String
>
create
().
put
(
"MonthYear"
,
month
).
build
())
.
collect
(
Collectors
.
toList
());
List
<
Map
<
String
,
String
>>
lastThreeMonth
=
afterMonth
.
stream
()
.
map
(
month
->
MapBuilder
.<
String
,
String
>
create
().
put
(
"MonthYear"
,
month
).
build
())
.
collect
(
Collectors
.
toList
());
Map
<
String
,
List
<
String
>>
queryCondtion1
=
new
HashMap
<>();
Map
<
String
,
List
<
String
>>
queryCondtion1
=
new
HashMap
<>();
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
if
(
type
.
equals
(
"FDZ"
)){
if
(
type
.
equals
(
"FDZ"
)){
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/mapper2/SjglZsjZsbtzMapper.java
View file @
9276b616
...
@@ -24,6 +24,9 @@ public interface SjglZsjZsbtzMapper extends BaseMapper<SjglZsjZsbtz> {
...
@@ -24,6 +24,9 @@ public interface SjglZsjZsbtzMapper extends BaseMapper<SjglZsjZsbtz> {
List
<
Map
<
String
,
Object
>>
getStationInfoMapByStationWerks
(
String
WERKS
,
String
DATAID
);
List
<
Map
<
String
,
Object
>>
getStationInfoMapByStationWerks
(
String
WERKS
,
String
DATAID
);
List
<
Map
<
String
,
Object
>>
getStationInfoMapByStationWerksNew
(
String
WERKS
,
String
DATAID
);
List
<
Map
<
String
,
Object
>>
getStationInfoMapByStationGFWerks
(
String
WERKS
,
String
DATAID
);
List
<
Map
<
String
,
Object
>>
getStationInfoMapByStationGFWerks
(
String
WERKS
,
String
DATAID
);
List
<
Map
<
String
,
Object
>>
getStationInfoMapByStationGFWerksNew
(
String
WERKS
,
String
DATAID
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
View file @
9276b616
...
@@ -1227,8 +1227,26 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
...
@@ -1227,8 +1227,26 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
.
filter
(
esEquipments
->
esEquipments
.
getEquipmentIndexName
().
equals
(
"有功功率"
))
.
filter
(
esEquipments
->
esEquipments
.
getEquipmentIndexName
().
equals
(
"有功功率"
))
.
collect
(
Collectors
.
toMap
(
ESEquipments:
:
getEquipmentNumber
,
ESEquipments:
:
getValueF
));
.
collect
(
Collectors
.
toMap
(
ESEquipments:
:
getEquipmentNumber
,
ESEquipments:
:
getValueF
));
TpriDmpDatabook
tpriDmpDatabook
=
tpriDmpDatabookServiceImpl
.
getTpriDmpDatabookByDataName
(
"风机"
);
TpriDmpDatabook
tpriDmpDatabook
=
tpriDmpDatabookServiceImpl
.
getTpriDmpDatabookByDataName
(
"风机"
);
List
<
Map
<
String
,
Object
>>
dataMaps
=
sjglZsjZsbtzServiceImpl
.
sjglZsjZsbtzMapper
// List<Map<String, Object>> dataMaps = sjglZsjZsbtzServiceImpl.sjglZsjZsbtzMapper
.
getStationInfoMapByStationWerks
(
werks
,
tpriDmpDatabook
.
getDataid
().
toString
());
// .getStationInfoMapByStationWerks(werks, tpriDmpDatabook.getDataid().toString());
List
<
Map
<
String
,
Object
>>
dataMapss
=
sjglZsjZsbtzServiceImpl
.
sjglZsjZsbtzMapper
.
getStationInfoMapByStationWerksNew
(
werks
,
tpriDmpDatabook
.
getDataid
().
toString
());
Map
<
String
,
List
<
Map
<
String
,
Object
>>>
dataResult
=
dataMapss
.
stream
().
collect
(
Collectors
.
groupingBy
(
map
->
(
String
)
map
.
get
(
"name"
)));
List
<
Map
<
String
,
Object
>>
dataMaps
=
new
ArrayList
<>();
dataResult
.
keySet
().
forEach
(
m
->{
String
equipNum
=
dataResult
.
get
(
m
).
stream
()
.
map
(
map
->
map
.
get
(
"equipNum"
).
toString
().
replace
(
m
+
"#"
,
""
))
.
reduce
((
a
,
b
)
->
a
+
","
+
b
)
.
orElse
(
""
);
Map
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
hashMap
.
put
(
"name"
,
m
.
replace
(
"#"
,
""
));
hashMap
.
put
(
"equipNum"
,
equipNum
);
dataMaps
.
add
(
hashMap
);
});
// 获取风机列表
// 获取风机列表
List
<
ESEquipmentsDTO
>
fanStatusList
=
getFanStatusList
(
stationId
);
List
<
ESEquipmentsDTO
>
fanStatusList
=
getFanStatusList
(
stationId
);
fanStatusList
.
forEach
(
equipments
->
{
fanStatusList
.
forEach
(
equipments
->
{
...
@@ -2360,8 +2378,28 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
...
@@ -2360,8 +2378,28 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
map
.
put
(
"state"
+
number
,
equipStatesMap
.
get
(
esEquipments
.
getEquipmentNumber
()));
map
.
put
(
"state"
+
number
,
equipStatesMap
.
get
(
esEquipments
.
getEquipmentNumber
()));
maps
.
add
(
map
);
maps
.
add
(
map
);
}
}
List
<
Map
<
String
,
Object
>>
dataMaps
=
sjglZsjZsbtzServiceImpl
.
sjglZsjZsbtzMapper
// List<Map<String, Object>> dataMaps = sjglZsjZsbtzServiceImpl.sjglZsjZsbtzMapper
.
getStationInfoMapByStationGFWerks
(
werks
,
"集电线"
);
// .getStationInfoMapByStationGFWerks(werks, "集电线");
List
<
Map
<
String
,
Object
>>
dataMapss
=
sjglZsjZsbtzServiceImpl
.
sjglZsjZsbtzMapper
.
getStationInfoMapByStationGFWerksNew
(
werks
,
"集电线"
);
Map
<
String
,
List
<
Map
<
String
,
Object
>>>
dataResult
=
dataMapss
.
stream
().
collect
(
Collectors
.
groupingBy
(
map
->
(
String
)
map
.
get
(
"name"
)));
List
<
Map
<
String
,
Object
>>
dataMaps
=
new
ArrayList
<>();
dataResult
.
keySet
().
forEach
(
m
->{
String
equipNum
=
dataResult
.
get
(
m
).
stream
()
.
map
(
map
->
map
.
get
(
"equipNum"
).
toString
().
replace
(
m
,
""
))
.
reduce
((
a
,
b
)
->
a
+
","
+
b
)
.
orElse
(
""
);
Map
<
String
,
Object
>
hashMap
=
new
HashMap
<>();
hashMap
.
put
(
"name"
,
m
.
replace
(
"#"
,
""
));
hashMap
.
put
(
"equipNum"
,
equipNum
);
dataMaps
.
add
(
hashMap
);
});
int
i
=
0
;
int
i
=
0
;
// 逆变器需要根据所属集电线分类组装 下面循环是将同一子阵下的不同逆变器组装为消息数据
// 逆变器需要根据所属集电线分类组装 下面循环是将同一子阵下的不同逆变器组装为消息数据
for
(
Map
<
String
,
Object
>
dataMap
:
dataMaps
)
{
for
(
Map
<
String
,
Object
>
dataMap
:
dataMaps
)
{
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-monitor-biz/src/main/resources/mapper/cluster/SjglZsjZsbtzMapper.xml
View file @
9276b616
...
@@ -18,7 +18,31 @@
...
@@ -18,7 +18,31 @@
FSB
FSB
</select>
</select>
<select
id=
"getStationInfoMapByStationWerksNew"
resultType=
"map"
>
SELECT
SUBSTRING(sjgl_zsj_zsbtz.SBMC, 1, 4) AS name,
REPLACE(sjgl_zsj_zsbtz.SBMC, '风机系统', '') as equipNum
FROM
sjgl_zsj_zsbtz
WHERE
FSB IN (
SELECT
DBID
FROM
sjgl_zsj_zsbtz
WHERE
MACHGENRE = (
SELECT
DATAID
FROM
tpri_dmp_databook
WHERE
MACHGENRE = #{DATAID} and WERKS = #{WERKS}
)
)
</select>
<select
id=
"getStationInfoMapByStationGFWerks"
resultType=
"map"
>
<select
id=
"getStationInfoMapByStationGFWerks"
resultType=
"map"
>
SELECT LEFT
SELECT LEFT
...
@@ -37,6 +61,17 @@
...
@@ -37,6 +61,17 @@
B.FSB
B.FSB
</select>
</select>
<select
id=
"getStationInfoMapByStationGFWerksNew"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.entity.SjglZsjZsbtz"
>
SELECT
REPLACE(sjgl_zsj_zsbtz.SBMC, '光伏阵区系统', '') as equipNum,
SUBSTRING(sjgl_zsj_zsbtz.SBMC, 1, LOCATE('#', sjgl_zsj_zsbtz.SBMC)) AS name
FROM
sjgl_zsj_zsbtz
WHERE
FSB IN ( SELECT DBID FROM sjgl_zsj_zsbtz WHERE MACHGENRE = ( SELECT DATAID FROM tpri_dmp_databook WHERE DATANAME = #{DATAID} ) AND WERKS = #{WERKS} )
</select>
<select
id=
"getEquipQrcodeInfo"
resultType=
"com.yeejoin.amos.boot.module.jxiop.api.entity.StationQrCodeStatistics"
>
<select
id=
"getEquipQrcodeInfo"
resultType=
"com.yeejoin.amos.boot.module.jxiop.api.entity.StationQrCodeStatistics"
>
SELECT
SELECT
WERKS AS code,
WERKS AS code,
...
...
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