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
f0b14a47
Commit
f0b14a47
authored
Nov 07, 2023
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
风电预警设备层接口
parent
9f7d2709
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
196 additions
and
49 deletions
+196
-49
IdxBizFanHealthIndexController.java
.../jxiop/biz/controller/IdxBizFanHealthIndexController.java
+34
-0
IdxBizFanWarningRecordController.java
...xiop/biz/controller/IdxBizFanWarningRecordController.java
+21
-0
IdxBizFanHealthIndexMapper.java
.../module/jxiop/biz/mapper2/IdxBizFanHealthIndexMapper.java
+1
-1
IdxBizFanHealthIndexServiceImpl.java
...iop/biz/service/impl/IdxBizFanHealthIndexServiceImpl.java
+2
-2
FanWaringRecordMapper.java
...oot/module/jxiop/biz/tdMapper2/FanWaringRecordMapper.java
+6
-0
IdxBizFanHealthIndexMapper.xml
...n/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
+18
-18
FanWarningRecord.xml
.../src/main/resources/mapper/tdengine2/FanWarningRecord.xml
+114
-28
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/IdxBizFanHealthIndexController.java
View file @
f0b14a47
...
...
@@ -15,7 +15,9 @@ import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanPointTagMapper;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvPointTagMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanHealthIndexServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanHealthIndexDayMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndexDay
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -51,6 +53,8 @@ public class IdxBizFanHealthIndexController extends BaseController {
IdxBizPvPointTagMapper
idxBizPvPointTagMapper
;
@Autowired
FanHealthIndexDayMapper
fanHealthIndexDayMapper
;
@Autowired
FanWaringRecordMapper
fanWarningRecord
;
/**
* 新增
*
...
...
@@ -403,4 +407,34 @@ public class IdxBizFanHealthIndexController extends BaseController {
return
ResponseHelper
.
buildResponse
(
maps
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"预警监测设备级统计td"
,
notes
=
"预警监测设备级统计td"
)
@GetMapping
(
value
=
"/selectPointNum"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
selectPointNum
(
@RequestParam
(
required
=
false
)
String
STATION
,
@RequestParam
(
required
=
false
)
String
SUBSYSTEM
,
@RequestParam
(
required
=
false
)
String
EQUIPMENTNAME
)
{
List
<
FanWarningRecord
>
idxBizPvWarningRecordList
=
fanWarningRecord
.
warningData
(
STATION
,
EQUIPMENTNAME
,
SUBSYSTEM
);
int
total
=
idxBizFanHealthIndexServiceImpl
.
pointNum
(
STATION
,
SUBSYSTEM
,
EQUIPMENTNAME
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map1
=
new
HashMap
<>();
Map
<
String
,
Object
>
warningNum
=
new
HashMap
<>();
Map
<
String
,
Object
>
pointNum
=
new
HashMap
<>();
map1
.
put
(
"name"
,
"危险"
);
map1
.
put
(
"value"
,
idxBizPvWarningRecordList
.
stream
().
filter
(
e
->
e
.
getWarningName
().
equals
(
"危险"
)).
count
());
map
.
put
(
"name"
,
"警告"
);
map
.
put
(
"value"
,
idxBizPvWarningRecordList
.
stream
().
filter
(
e
->
e
.
getWarningName
().
equals
(
"警告"
)).
count
());
warningNum
.
put
(
"name"
,
"注意"
);
warningNum
.
put
(
"value"
,
idxBizPvWarningRecordList
.
stream
().
filter
(
e
->
e
.
getWarningName
().
equals
(
"注意"
)).
count
());
pointNum
.
put
(
"name"
,
"安全"
);
pointNum
.
put
(
"value"
,
total
-
idxBizPvWarningRecordList
.
size
());
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
list
.
add
(
pointNum
);
list
.
add
(
warningNum
);
list
.
add
(
map
);
list
.
add
(
map1
);
return
ResponseHelper
.
buildResponse
(
list
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/IdxBizFanWarningRecordController.java
View file @
f0b14a47
...
...
@@ -14,6 +14,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanWarningRecor
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanWarningRuleSetServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizPvWarningRuleSetServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.beanutils.BeanMap
;
...
...
@@ -341,4 +342,24 @@ public class IdxBizFanWarningRecordController extends BaseController {
return
ResponseHelper
.
buildResponse
(
maps
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/selectEquipWarningTotal"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"预警信息统计富文本"
,
notes
=
"预警信息统计富文本"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
selectEquipWarningTotal
(
@RequestParam
String
STATION
,
@RequestParam
String
EQUIPMENTNAME
)
{
List
<
Map
<
String
,
Object
>>
maps
=
fanWaringRecordMapper
.
selectEquipWarningTotal
(
STATION
,
EQUIPMENTNAME
);
return
ResponseHelper
.
buildResponse
(
maps
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/selectWarningPoint"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"预警监测设备右侧预警重复列表"
,
notes
=
"预警监测设备右侧预警重复列表"
)
public
ResponseModel
<
List
<
FanWarningRecord
>>
selectFanWarningNum
(
@RequestParam
String
STATION
,
@RequestParam
String
EQUIPMENTNAME
)
{
List
<
FanWarningRecord
>
maps
=
fanWaringRecordMapper
.
selectWarningPoint
(
STATION
,
EQUIPMENTNAME
);
return
ResponseHelper
.
buildResponse
(
maps
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/mapper2/IdxBizFanHealthIndexMapper.java
View file @
f0b14a47
...
...
@@ -131,7 +131,7 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
Map
<
String
,
Object
>
queryForLeftTableListByPointNum
(
String
STATION
,
String
HEALTHLEVEL
,
String
EQUIPMENTNAME
,
String
POINTNAME
);
List
<
IdxBizFanWarningRecord
>
warningData
(
String
STATION
,
String
SUBARRAY
,
String
EQUIPMENTNAME
);
Integer
pointNum
(
String
STATION
,
String
SUB
ARRAY
,
String
EQUIPMENTNAME
);
Integer
pointNum
(
String
STATION
,
String
SUB
SYSTEM
,
String
EQUIPMENTNAME
);
Map
<
String
,
Object
>
getPvEquipStatusByStation
(
String
station
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/IdxBizFanHealthIndexServiceImpl.java
View file @
f0b14a47
...
...
@@ -203,8 +203,8 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth
return
this
.
getBaseMapper
().
queryForLeftTableListByPointNum
(
STATION
,
HEALTHLEVEL
,
EQUIPMENTNAME
,
POINTNAME
);
}
public
int
pointNum
(
String
STATION
,
String
SUB
ARRAY
,
String
EQUIPMENTNAME
)
{
return
this
.
getBaseMapper
().
pointNum
(
STATION
,
SUB
ARRAY
,
EQUIPMENTNAME
);
public
int
pointNum
(
String
STATION
,
String
SUB
SYSTEM
,
String
EQUIPMENTNAME
)
{
return
this
.
getBaseMapper
().
pointNum
(
STATION
,
SUB
SYSTEM
,
EQUIPMENTNAME
);
}
public
List
<
IdxBizFanWarningRecord
>
warningData
(
String
STATION
,
String
SUBARRAY
,
String
EQUIPMENTNAME
)
{
...
...
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 @
f0b14a47
...
...
@@ -10,4 +10,10 @@ import java.util.Map;
public
interface
FanWaringRecordMapper
extends
BaseMapper
<
FanWarningRecord
>
{
public
List
<
Map
<
String
,
Object
>>
selectFanWarningNum
(
String
station
);
public
List
<
FanWarningRecord
>
warningData
(
String
STATION
,
String
EQUIPMENTNAME
,
String
SUBSYSTEM
);
public
List
<
FanWarningRecord
>
selectWarningPoint
(
String
STATION
,
String
EQUIPMENTNAME
);
public
List
<
Map
<
String
,
Object
>>
selectEquipWarningTotal
(
String
STATION
,
String
EQUIPMENTNAME
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
View file @
f0b14a47
...
...
@@ -1165,22 +1165,22 @@
</select>
<select
id=
"warningData"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRecord"
>
SELECT
*
FROM
idx_biz_fan_warning_record re
WHERE
re.`STATUS` = 0
<if
test=
"EQUIPMENTNAME != '' and EQUIPMENTNAME != null"
>
AND re.EQUIPMENT_NAME = #{EQUIPMENTNAME}
</if>
<if
test=
"SUBARRAY != null and SUBARRAY != '' "
>
AND re.SUBARRAY = #{SUBARRAY}
</if>
<if
test=
"STATION != null and STATION != '' "
>
AND re.STATION = #{STATION}
</if>
</select>
SELECT
*
FROM
idx_biz_fan_warning_record re
WHERE
re.`STATUS` = 0
<if
test=
"EQUIPMENTNAME != '' and EQUIPMENTNAME != null"
>
AND re.EQUIPMENT_NAME = #{EQUIPMENTNAME}
</if>
<if
test=
"SUBARRAY != null and SUBARRAY != '' "
>
AND re.SUBARRAY = #{SUBARRAY}
</if>
<if
test=
"STATION != null and STATION != '' "
>
AND re.STATION = #{STATION}
</if>
</select>
<select
id=
"pointNum"
resultType=
"int"
>
SELECT
...
...
@@ -1192,8 +1192,8 @@
<if
test=
"EQUIPMENTNAME != '' and EQUIPMENTNAME != null"
>
AND cl.EQUIPMENT_NAME = #{EQUIPMENTNAME}
</if>
<if
test=
"SUB
ARRAY != null and SUBARRAY
!= '' "
>
AND cl.SUB
ARRAY = #{SUBARRAY
}
<if
test=
"SUB
SYSTEM != null and SUBSYSTEM
!= '' "
>
AND cl.SUB
_SYSTEM = #{SUBSYSTEM
}
</if>
<if
test=
"STATION != null and STATION != '' "
>
AND cl.STATION = #{STATION}
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/FanWarningRecord.xml
View file @
f0b14a47
...
...
@@ -4,37 +4,123 @@
<select
id=
"selectFanWarningNum"
resultType=
"map"
>
SELECT `b`.`EQUIPMENT_NAME`
AS `EQUIPMENT_NAME`,
`b`.`STATION`
AS `STATION`,
`b`.`警告`
AS `警告`,
`b`.`注意`
AS `注意`,
`b`.`危险`
AS `危险`,
sum(((`b`.`注意` + `b`.`危险`) + `b`.`警告`)) AS `sort`
FROM (select `a`.`EQUIPMENT_NAME`
as `EQUIPMENT_NAME`,
a.`STATION`
as `STATION`,
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`,
`equipment_name` as `EQUIPMENT_NAME`,
`station`
as `STATION`,
count(1)
as `num`
from analysis_data.fan_warning_record
where `status` = 0
or (`status` = 1
and `ts` > (now() - 3D - 8h))
<if
test=
"station != null"
>
and station = #{station}
</if>
group by `station`,
`equipment_name`,
`warning_name`) a
group by `a`.`EQUIPMENT_NAME`, a.`STATION`) b
SELECT `b`.`EQUIPMENT_NAME` AS `EQUIPMENT_NAME`,
`b`.`STATION`
AS `STATION`,
`b`.`警告`
AS `警告`,
`b`.`注意`
AS `注意`,
`b`.`危险`
AS `危险`,
sum(((`b`.`注意` + `b`.`危险`) + `b`.`警告`)) AS `sort`
FROM (select `a`.`EQUIPMENT_NAME` as `EQUIPMENT_NAME`,
a.`STATION`
as `STATION`,
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`,
`equipment_name` as `EQUIPMENT_NAME`,
`station`
as `STATION`,
count(1)
as `num`
from analysis_data.fan_warning_record
where `status` = 0
or (`status` = 1
and `ts` > (now() - 3D - 8h))
<if
test=
"station != null"
>
and station = #{station}
</if>
group by `station`,
`equipment_name`,
`warning_name`) a
group by `a`.`EQUIPMENT_NAME`, a.`STATION`) b
GROUP BY `b`.`EQUIPMENT_NAME`,
`b`.`STATION`, `b`.`警告`, `b`.`注意`, `b`.`危险`
`b`.`STATION`, `b`.`警告`, `b`.`注意`, `b`.`危险`
order by sort DESC
</select>
<select
id=
"warningData"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord"
>
SELECT
warning_name as WarningName
FROM
analysis_data.fan_warning_record re
WHERE
re.`status` = 0
<if
test=
"EQUIPMENTNAME != '' and EQUIPMENTNAME != null"
>
AND re.equipment_name = #{EQUIPMENTNAME}
</if>
<if
test=
"SUBSYSTEM != null and SUBSYSTEM != '' "
>
AND re.sub_system = #{SUBSYSTEM}
</if>
<if
test=
"STATION != null and STATION != '' "
>
AND re.station = #{STATION}
</if>
</select>
<select
id=
"selectWarningPoint"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord"
>
SELECT
a.station,
a.warning_name,
a.content,
a.equipment_name,
a.point_name,
a.rec_date
from
analysis_data.fan_warning_record a
where
a.status = 0
<if
test=
"STATION != null and STATION != '' "
>
AND a.station = #{STATION}
</if>
<if
test=
"EQUIPMENTNAME != '' and EQUIPMENTNAME != null"
>
AND a.equipment_name = #{EQUIPMENTNAME}
</if>
group by
station,
equipment_name,
point_name,
rec_date ,
content,
warning_name
</select>
<select
id=
"selectEquipWarningTotal"
resultType=
"map"
>
SELECT
`STATION` AS `STATION`,
`EQUIPMENT_NAME` AS `EQUIPMENT_NAME`,
max( ( case `WARNING_NAME` WHEN '注意' THEN `num` ELSE 0 END ) ) AS `zhuyi`,
max( ( case `WARNING_NAME` WHEN '警告' THEN `num` ELSE 0 END ) ) AS `jinggao`,
max( ( case `WARNING_NAME` WHEN '危险' THEN `num` ELSE 0 END ) ) AS `weixian`,
sum(
(
(
( CASE `WARNING_NAME` WHEN '注意' THEN `num` ELSE 0 END ) + ( case `WARNING_NAME` WHEN '警告' THEN `num` ELSE 0 END
)
) + ( case `WARNING_NAME` WHEN '危险' THEN `num` ELSE 0 END )
)
) AS `total`
FROM
(
select
`z`.`station` as `STATION`,
`z`.`equipment_name` as `EQUIPMENT_NAME`,
`z`.`warning_name` as `WARNING_NAME`,
count( 1 ) as `num`
from
analysis_data.fan_warning_record z where
( `z`.`status` = 0 )
<if
test=
"STATION != null and STATION != '' "
>
AND z.station = #{STATION}
</if>
<if
test=
"EQUIPMENTNAME != '' and EQUIPMENTNAME != null"
>
AND z.equipment_name = #{EQUIPMENTNAME}
</if>
group by
`z`.`station`,
`z`.`warning_name`,
`z`.`equipment_name`
) b
GROUP BY
`b`.`STATION`,
`b`.`EQUIPMENT_NAME`
</select>
</mapper>
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