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
9f7d2709
Commit
9f7d2709
authored
Nov 06, 2023
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TDENGINE 风机预警
parent
19a96358
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
0 deletions
+55
-0
IdxBizFanWarningRecordController.java
...xiop/biz/controller/IdxBizFanWarningRecordController.java
+14
-0
FanWaringRecordMapper.java
...oot/module/jxiop/biz/tdMapper2/FanWaringRecordMapper.java
+5
-0
FanWarningRecord.xml
.../src/main/resources/mapper/tdengine2/FanWarningRecord.xml
+36
-0
No files found.
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 @
9f7d2709
...
@@ -13,6 +13,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWarningRuleSet;
...
@@ -13,6 +13,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizPvWarningRuleSet;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanWarningRecordServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanWarningRecordServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanWarningRuleSetServiceImpl
;
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.service.impl.IdxBizPvWarningRuleSetServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.beanutils.BeanMap
;
import
org.apache.commons.beanutils.BeanMap
;
...
@@ -50,6 +51,9 @@ public class IdxBizFanWarningRecordController extends BaseController {
...
@@ -50,6 +51,9 @@ public class IdxBizFanWarningRecordController extends BaseController {
@Autowired
@Autowired
IdxBizPvWarningRuleSetServiceImpl
idxBizPvWarningRuleSetService
;
IdxBizPvWarningRuleSetServiceImpl
idxBizPvWarningRuleSetService
;
@Autowired
FanWaringRecordMapper
fanWaringRecordMapper
;
/**
/**
* 新增
* 新增
*
*
...
@@ -327,4 +331,14 @@ public class IdxBizFanWarningRecordController extends BaseController {
...
@@ -327,4 +331,14 @@ public class IdxBizFanWarningRecordController extends BaseController {
boolean
b
=
idxBizFanWarningRuleSetService
.
updateBatchById
(
idxBizFanWarningRecordList
);
boolean
b
=
idxBizFanWarningRuleSetService
.
updateBatchById
(
idxBizFanWarningRecordList
);
return
ResponseHelper
.
buildResponse
(
b
);
return
ResponseHelper
.
buildResponse
(
b
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/selectFanWarningNum"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询各风机预警状况"
,
notes
=
"查询各风机预警状况"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
selectFanWarningNum
(
@RequestParam
String
station
)
{
List
<
Map
<
String
,
Object
>>
maps
=
fanWaringRecordMapper
.
selectFanWarningNum
(
station
);
return
ResponseHelper
.
buildResponse
(
maps
);
}
}
}
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 @
9f7d2709
...
@@ -2,7 +2,12 @@ package com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2;
...
@@ -2,7 +2,12 @@ package com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord
;
import
org.apache.ibatis.annotations.Select
;
import
java.util.List
;
import
java.util.Map
;
public
interface
FanWaringRecordMapper
extends
BaseMapper
<
FanWarningRecord
>
{
public
interface
FanWaringRecordMapper
extends
BaseMapper
<
FanWarningRecord
>
{
public
List
<
Map
<
String
,
Object
>>
selectFanWarningNum
(
String
station
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/FanWarningRecord.xml
View file @
9f7d2709
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper"
>
<mapper
namespace=
"com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper"
>
<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
GROUP BY `b`.`EQUIPMENT_NAME`,
`b`.`STATION`, `b`.`警告`, `b`.`注意`, `b`.`危险`
order by sort DESC
</select>
</mapper>
</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