Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
57ae2ad8
Commit
57ae2ad8
authored
Nov 10, 2023
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
e6b1d263
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
131 additions
and
28 deletions
+131
-28
TDBigScreenAnalyseController.java
...le/jxiop/biz/controller/TDBigScreenAnalyseController.java
+11
-25
FanWaringRecordMapper.java
...oot/module/jxiop/biz/tdMapper2/FanWaringRecordMapper.java
+3
-0
FanWarningRecord.xml
.../src/main/resources/mapper/tdengine2/FanWarningRecord.xml
+116
-2
PvWarningRecord.xml
...z/src/main/resources/mapper/tdengine2/PvWarningRecord.xml
+1
-1
No files found.
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 @
57ae2ad8
...
@@ -399,42 +399,28 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -399,42 +399,28 @@ public class TDBigScreenAnalyseController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"片区设备预警统计分析 - 右下角柱状图 "
,
notes
=
"片区设备预警统计分析 - 右下角柱状图 "
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"片区设备预警统计分析 - 右下角柱状图 "
,
notes
=
"片区设备预警统计分析 - 右下角柱状图 "
)
@GetMapping
(
value
=
"/getAllEquipAlarmInfoAnalysis"
)
@GetMapping
(
value
=
"/getAllEquipAlarmInfoAnalysis"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getAllEquipAlarmInfoAnalysis
(
@RequestParam
(
required
=
false
)
String
stationType
,
public
ResponseModel
<
Map
<
String
,
Object
>>
getAllEquipAlarmInfoAnalysis
(
@RequestParam
(
required
=
false
)
String
stationType
,
@RequestParam
(
required
=
false
)
String
ar
ea
Code
)
{
@RequestParam
(
required
=
false
)
String
ar
ae
Code
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
allEquipAlarmInfo
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
allEquipAlarmInfo
=
new
ArrayList
<>();
if
(
CharSequenceUtil
.
isNotEmpty
(
stationType
))
{
if
(
CharSequenceUtil
.
isNotEmpty
(
stationType
))
{
if
(
"fan"
.
equals
(
stationType
))
{
if
(
"fan"
.
equals
(
stationType
))
{
allEquipAlarmInfo
=
idxBizFanHealthIndexMapper
.
getAllEquipAlarmInfoAnalysisByStationType
(
"idx_biz_fan_warning_record"
,
areaCode
,
"风电"
)
;
stationType
=
"风电"
;
}
else
if
(
"pv"
.
equals
(
stationType
))
{
}
else
if
(
"pv"
.
equals
(
stationType
))
{
allEquipAlarmInfo
=
idxBizFanHealthIndexMapper
.
getAllEquipAlarmInfoAnalysisByStationType
(
"idx_biz_pv_warning_record"
,
areaCode
,
"光伏"
);
stationType
=
"光伏"
;
}
}
else
{
allEquipAlarmInfo
=
idxBizFanHealthIndexMapper
.
getAllEquipAlarmInfoAnalysisByArea
(
areaCode
);
}
}
HashMap
<
String
,
Integer
>
wxMap
=
new
HashMap
<>();
HashMap
<
String
,
Integer
>
zyMap
=
new
HashMap
<>();
HashMap
<
String
,
Integer
>
jgMap
=
new
HashMap
<>();
allEquipAlarmInfo
.
forEach
(
item
->
{
if
(
"危险"
.
equals
(
item
.
get
(
"warningName"
)))
{
wxMap
.
put
(
item
.
get
(
"pointName"
).
toString
(),
Integer
.
parseInt
(
item
.
get
(
"num"
).
toString
()));
}
else
if
(
"注意"
.
equals
(
item
.
get
(
"warningName"
)))
{
zyMap
.
put
(
item
.
get
(
"pointName"
).
toString
(),
Integer
.
parseInt
(
item
.
get
(
"num"
).
toString
()));
}
else
if
(
"警告"
.
equals
(
item
.
get
(
"warningName"
)))
{
jgMap
.
put
(
item
.
get
(
"pointName"
).
toString
(),
Integer
.
parseInt
(
item
.
get
(
"num"
).
toString
()));
}
}
}
);
allEquipAlarmInfo
=
fanWaringRecordMapper
.
getAllEquipAlarmInfoAnalysisByArea
(
araeCode
,
stationType
);
List
<
Integer
>
wxList
=
new
ArrayList
<>();
List
<
Integer
>
wxList
=
new
ArrayList
<>();
List
<
Integer
>
zyList
=
new
ArrayList
<>();
List
<
Integer
>
zyList
=
new
ArrayList
<>();
List
<
Integer
>
jgList
=
new
ArrayList
<>();
List
<
Integer
>
jgList
=
new
ArrayList
<>();
List
<
String
>
list
=
new
ArrayList
<>();
for
(
Map
<
String
,
Object
>
map
:
allEquipAlarmInfo
)
{
wxList
.
add
(
Integer
.
valueOf
(
map
.
get
(
"危险"
).
toString
()));
zyList
.
add
(
Integer
.
valueOf
(
map
.
get
(
"注意"
).
toString
()));
jgList
.
add
(
Integer
.
valueOf
(
map
.
get
(
"警告"
).
toString
()));
list
.
add
(
map
.
get
(
"EQUIPMENT_NAME"
).
toString
());
List
<
String
>
list
=
allEquipAlarmInfo
.
stream
().
map
(
t
->
t
.
get
(
"pointName"
).
toString
()).
distinct
().
collect
(
Collectors
.
toList
());
}
list
.
forEach
(
item
->
{
wxList
.
add
(
wxMap
.
getOrDefault
(
item
,
0
));
zyList
.
add
(
zyMap
.
getOrDefault
(
item
,
0
));
jgList
.
add
(
jgMap
.
getOrDefault
(
item
,
0
));
});
HashMap
<
String
,
Object
>
wxMapResult
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
wxMapResult
=
new
HashMap
<>();
wxMapResult
.
put
(
"data"
,
wxList
);
wxMapResult
.
put
(
"data"
,
wxList
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tdMapper2/FanWaringRecordMapper.java
View file @
57ae2ad8
...
@@ -43,4 +43,7 @@ public interface FanWaringRecordMapper extends BaseMapper<FanWarningRecord> {
...
@@ -43,4 +43,7 @@ public interface FanWaringRecordMapper extends BaseMapper<FanWarningRecord> {
@Param
(
"endDate"
)
String
endDate
);
@Param
(
"endDate"
)
String
endDate
);
List
<
FanWarningRecord
>
getEquipWarningInfoByPage
(
String
arae
,
String
station
,
String
stationType
,
Integer
current
,
Integer
size
,
String
warningName
,
String
stationId
,
String
startDate
,
String
endDate
);
List
<
FanWarningRecord
>
getEquipWarningInfoByPage
(
String
arae
,
String
station
,
String
stationType
,
Integer
current
,
Integer
size
,
String
warningName
,
String
stationId
,
String
startDate
,
String
endDate
);
List
<
Map
<
String
,
Object
>>
getAllEquipAlarmInfoAnalysisByArea
(
String
araeCode
,
String
stationType
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/FanWarningRecord.xml
View file @
57ae2ad8
...
@@ -237,11 +237,11 @@
...
@@ -237,11 +237,11 @@
<select
id=
"getAllEquipAlarmInfo"
resultType=
"map"
>
<select
id=
"getAllEquipAlarmInfo"
resultType=
"map"
>
select arae as area,
select arae as area,
warning_name as warning
n
ame,
warning_name as warning
N
ame,
count(1) as num
count(1) as num
from analysis_data.fan_warning_record a
from analysis_data.fan_warning_record a
where (a.disposotion_state = '未处置')
where (a.disposotion_state = '未处置')
or (a.disposotion_state = '已处置' and a.
disposotion_date
>(now()-3d -8h ))
or (a.disposotion_state = '已处置' and a.
ts
>(now()-3d -8h ))
group by arae,
group by arae,
warning_name
warning_name
...
@@ -376,4 +376,118 @@
...
@@ -376,4 +376,118 @@
</if>
</if>
</where>
) b
</where>
) b
</select>
</select>
<select
id=
"getAllEquipAlarmInfoAnalysisByArea"
resultType=
"map"
>
select
*
from
(
select
concat('风电-',`b`.`EQUIPMENT_NAME`) as `EQUIPMENT_NAME`,
`b`.`STATION` as `STATION`,
`b`.`arae` as `arae`,
`b`.`警告` as `警告`,
`b`.`注意` as `注意`,
`b`.`危险` as `危险`,
'风电' as stationType,
sum(((`b`.`注意` + `b`.`危险`) + `b`.`警告`)) as `sort`
from
(
select
`a`.`EQUIPMENT_NAME` as `EQUIPMENT_NAME`,
a.`STATION` as `STATION`,
`a`.`arae` as `arae`,
max(case `a`.`WARNING_NAME` when '危险' then `a`.`num` else 0 end) as `危险`,
max(case `a`.`WARNING_NAME` when '注意' then `a`.`num` else 0 end) as `注意`,
max(case `a`.`WARNING_NAME` when '警告' then `a`.`num` else 0 end) as `警告`
from
(
select
`warning_name` as `WARNING_NAME`,
`point_name` as `EQUIPMENT_NAME`,
`station` as `STATION`,
`arae` as `arae`,
count(1) as `num`
from
analysis_data.fan_warning_record
where
`status` = 0
or (`status` = 1
and `ts` > (now() - 3D - 8h))
group by
`station`,
`point_name`,
`warning_name`,arae) a
group by
`a`.`EQUIPMENT_NAME`,
a.`STATION`,a.`arae`) b
group by
`b`.`EQUIPMENT_NAME`,
`b`.`STATION`,
`b`.`arae`,
`b`.`警告`,
`b`.`注意`,
`b`.`危险`
union all
(
select
concat('光伏-',`b`.`EQUIPMENT_NAME`) as `EQUIPMENT_NAME`,
`b`.`STATION` as `STATION`,
`b`.`arae` as `arae`,
`b`.`警告` as `警告`,
`b`.`注意` as `注意`,
`b`.`危险` as `危险`,
'光伏' as stationType,
sum(((`b`.`注意` + `b`.`危险`) + `b`.`警告`)) as `sort`
from
(
select
`a`.`EQUIPMENT_NAME` as `EQUIPMENT_NAME`,
a.`STATION` as `STATION`,
a.`arae` as `arae`,
max(case `a`.`WARNING_NAME` when '危险' then `a`.`num` else 0 end) as `危险`,
max(case `a`.`WARNING_NAME` when '注意' then `a`.`num` else 0 end) as `注意`,
max(case `a`.`WARNING_NAME` when '警告' then `a`.`num` else 0 end) as `警告`
from
(
select
`warning_name` as `WARNING_NAME`,
`point_name` as `EQUIPMENT_NAME`,
`station` as `STATION`,
`arae` as `arae`,
count(1) as `num`
from
analysis_data.pv_warning_record
where
`status` = 0
or (`status` = 1
and `ts` > (now() - 3D - 8h))
group by
`station`,
`point_name`,
`warning_name`,arae) a
group by
`a`.`EQUIPMENT_NAME`,
a.`STATION`,a.`arae`) b
group by
`b`.`EQUIPMENT_NAME`,
`b`.`STATION`,
`b`.`arae`,
`b`.`警告`,
`b`.`注意`,
`b`.`危险`
)) b
<where>
<if
test=
"stationType != '' and stationType != null"
>
and b.stationtype = #{stationType}
</if>
<if
test=
"araeCode != '' and araeCode != null"
>
and b.arae = #{araeCode}
</if>
</where>
order by b.`sort` desc
</select>
</mapper>
</mapper>
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/PvWarningRecord.xml
View file @
57ae2ad8
...
@@ -252,7 +252,7 @@
...
@@ -252,7 +252,7 @@
<select
id=
"getAllEquipAlarmInfo"
resultType=
"map"
>
<select
id=
"getAllEquipAlarmInfo"
resultType=
"map"
>
select arae as area,
select arae as area,
warning_name as warning
n
ame,
warning_name as warning
N
ame,
count(1) as num
count(1) as num
from analysis_data.pv_warning_record a
from analysis_data.pv_warning_record a
where (a.disposotion_state = '未处置')
where (a.disposotion_state = '未处置')
...
...
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