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
7747c69b
Commit
7747c69b
authored
Sep 19, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分析需求API
parent
50a037b2
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
562 additions
and
2 deletions
+562
-2
pom.xml
...t-system-jxiop/amos-boot-module-jxiop-analyse-biz/pom.xml
+6
-0
BigScreenAnalyseController.java
...dule/jxiop/biz/controller/BigScreenAnalyseController.java
+223
-0
IdxBizFanWarningRecord.java
.../boot/module/jxiop/biz/entity/IdxBizFanWarningRecord.java
+4
-1
IdxBizFanHealthIndexMapper.java
.../module/jxiop/biz/mapper2/IdxBizFanHealthIndexMapper.java
+17
-0
IdxBizFanWarningRecordMapper.java
...odule/jxiop/biz/mapper2/IdxBizFanWarningRecordMapper.java
+12
-0
IdxBizFanHealthIndexMapper.xml
...n/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
+216
-0
IdxBizFanWarningRecordMapper.xml
...resources/mapper/cluster/IdxBizFanWarningRecordMapper.xml
+83
-0
MonitorFanIndicatorImpl.java
...odule/jxiop/biz/service/impl/MonitorFanIndicatorImpl.java
+1
-1
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/pom.xml
View file @
7747c69b
...
...
@@ -31,6 +31,12 @@
<version>
5.7.22
</version>
</dependency>
<dependency>
<groupId>
com.amosframework.boot
</groupId>
<artifactId>
amos-boot-module-jxiop-api
</artifactId>
<version>
1.0.0
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
com.yeejoin
</groupId>
<artifactId>
amos-component-influxdb
</artifactId>
<version>
1.8.5-SNAPSHOT
</version>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/BigScreenAnalyseController.java
0 → 100644
View file @
7747c69b
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
controller
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
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.biz.entity.IdxBizFanWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanHealthIndexMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanWarningRecordMapper
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@RestController
@Api
(
tags
=
"智能分析 - 大屏API"
)
@RequestMapping
(
value
=
"/bigScreenAnalyse"
)
public
class
BigScreenAnalyseController
extends
BaseController
{
@Autowired
IdxBizFanHealthIndexMapper
idxBizFanHealthIndexMapper
;
@Autowired
IdxBizFanWarningRecordMapper
idxBizFanWarningRecordMapper
;
@Autowired
StationBasicMapper
stationBasicMapper
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"场站设备健康状态指数与趋势 - 仪表盘"
,
notes
=
"场站设备健康状态指数与趋势 - 仪表盘"
)
@GetMapping
(
value
=
"/getHealthScoreInfo"
)
public
ResponseModel
<
BigDecimal
>
getHealthScoreInfo
(
@RequestParam
(
required
=
false
)
String
areaCode
,
@RequestParam
(
required
=
false
)
String
stationCode
)
{
return
ResponseHelper
.
buildResponse
(
idxBizFanHealthIndexMapper
.
getHealthScoreInfo
(
areaCode
,
stationCode
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"场站设备健康状态指数与趋势 - 折线图"
,
notes
=
"场站设备健康状态指数与趋势 - 折线图"
)
@GetMapping
(
value
=
"/getHealthListInfo"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getHealthListInfo
(
@RequestParam
(
required
=
false
)
String
areaCode
,
@RequestParam
(
required
=
false
)
String
stationCode
)
{
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
healthListInfo
=
idxBizFanHealthIndexMapper
.
getHealthListInfo
(
areaCode
,
stationCode
);
List
<
String
>
time
=
new
ArrayList
<>();
List
<
String
>
valueList
=
new
ArrayList
<>();
healthListInfo
.
forEach
(
item
->
{
time
.
add
(
item
.
get
(
"date"
).
toString
());
valueList
.
add
(
item
.
get
(
"avgHealthIndex"
).
toString
());
});
List
<
Map
<
String
,
Object
>>
arrayList
=
new
ArrayList
<>();
HashMap
<
String
,
Object
>
stringStringHashMap
=
new
HashMap
<>();
stringStringHashMap
.
put
(
"data"
,
valueList
);
arrayList
.
add
(
stringStringHashMap
);
resultMap
.
put
(
"axisData"
,
time
);
resultMap
.
put
(
"seriesData"
,
arrayList
);
return
ResponseHelper
.
buildResponse
(
resultMap
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"全域各片区设备预警情况(条) "
,
notes
=
"全域各片区设备预警情况(条) "
)
@GetMapping
(
value
=
"/getAllEquipAlarmInfo"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getAllEquipAlarmInfo
(
@RequestParam
(
required
=
false
)
String
tableName
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
allEquipAlarmInfo
=
idxBizFanHealthIndexMapper
.
getAllEquipAlarmInfo
(
tableName
);
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
(
"area"
).
toString
(),
Integer
.
parseInt
(
item
.
get
(
"num"
).
toString
()));
}
else
if
(
"注意"
.
equals
(
item
.
get
(
"warningName"
)))
{
zyMap
.
put
(
item
.
get
(
"area"
).
toString
(),
Integer
.
parseInt
(
item
.
get
(
"num"
).
toString
()));
}
else
if
(
"警告"
.
equals
(
item
.
get
(
"warningName"
)))
{
jgMap
.
put
(
item
.
get
(
"area"
).
toString
(),
Integer
.
parseInt
(
item
.
get
(
"num"
).
toString
()));
}
});
List
<
Integer
>
wxList
=
new
ArrayList
<>();
List
<
Integer
>
zyList
=
new
ArrayList
<>();
List
<
Integer
>
jgList
=
new
ArrayList
<>();
List
<
String
>
list
=
new
ArrayList
<>();
if
(
"idx_biz_fan_warning_record"
.
equals
(
tableName
))
{
list
=
Arrays
.
asList
(
"华中片区"
,
"西北片区"
,
"西南片区"
,
"华南片区"
,
"华东片区"
,
"东北片区"
,
"华北片区"
);
}
else
{
list
=
Arrays
.
asList
(
"华北片区"
,
"东北片区"
,
"华东片区"
,
"华南片区"
,
"西南片区"
,
"西北片区"
,
"华中片区"
);
}
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
<>();
wxMapResult
.
put
(
"data"
,
wxList
);
wxMapResult
.
put
(
"name"
,
"危险"
);
HashMap
<
String
,
Object
>
zyMapResult
=
new
HashMap
<>();
zyMapResult
.
put
(
"data"
,
zyList
);
zyMapResult
.
put
(
"name"
,
"注意"
);
HashMap
<
String
,
Object
>
jgMapResult
=
new
HashMap
<>();
jgMapResult
.
put
(
"data"
,
jgList
);
jgMapResult
.
put
(
"name"
,
"警告"
);
List
<
Map
<
String
,
Object
>>
hashMaps
=
Arrays
.
asList
(
wxMapResult
,
zyMapResult
,
jgMapResult
);
resultMap
.
put
(
"axisData"
,
list
);
resultMap
.
put
(
"seriesData"
,
hashMaps
);
return
ResponseHelper
.
buildResponse
(
resultMap
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"全域各片区设备健康状态指数 "
,
notes
=
"全域各片区设备健康状态指数 "
)
@GetMapping
(
value
=
"/getHealthInfoByArea"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getHealthInfoByArea
()
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
healthListInfo
=
idxBizFanHealthIndexMapper
.
getHealthInfoByArea
();
Map
<
String
,
BigDecimal
>
collect
=
healthListInfo
.
stream
().
collect
(
Collectors
.
toMap
(
t
->
t
.
get
(
"area"
).
toString
(),
t
->
new
BigDecimal
(
t
.
get
(
"healthIndex"
).
toString
())));
List
<
String
>
list
=
Arrays
.
asList
(
"华中片区"
,
"西北片区"
,
"西南片区"
,
"华南片区"
,
"华东片区"
,
"东北片区"
,
"华北片区"
);
List
<
Object
>
seriesData
=
new
ArrayList
<>();
list
.
forEach
(
item
->
seriesData
.
add
(
collect
.
getOrDefault
(
item
,
new
BigDecimal
(
"0"
))));
resultMap
.
put
(
"axisData"
,
list
);
resultMap
.
put
(
"seriesData"
,
seriesData
);
return
ResponseHelper
.
buildResponse
(
resultMap
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"全域各场站设备实时预警处置信息"
,
notes
=
"全域各场站设备实时预警处置信息"
)
@GetMapping
(
value
=
"/getEquipWarningInfoByPage"
)
public
ResponseModel
<
IPage
<
IdxBizFanWarningRecord
>>
getEquipWarningInfoByPage
(
@RequestParam
(
value
=
"arae"
,
required
=
false
)
String
arae
,
@RequestParam
(
value
=
"station"
,
required
=
false
)
String
station
,
@RequestParam
(
value
=
"stationType"
,
required
=
false
)
String
stationType
,
@RequestParam
(
value
=
"current"
,
required
=
false
)
Integer
current
,
@RequestParam
(
value
=
"size"
,
required
=
false
)
Integer
size
)
{
Integer
count
=
idxBizFanWarningRecordMapper
.
getEquipWarningInfoByPageCount
(
arae
,
station
,
stationType
);
List
<
IdxBizFanWarningRecord
>
idxBizFanWarningRecordIPage
=
idxBizFanWarningRecordMapper
.
getEquipWarningInfoByPage
(
arae
,
station
,
stationType
,
current
,
size
);
Page
<
IdxBizFanWarningRecord
>
idxBizFanWarningRecordPage
=
new
Page
<>(
current
,
size
);
idxBizFanWarningRecordPage
.
setRecords
(
idxBizFanWarningRecordIPage
);
idxBizFanWarningRecordPage
.
setTotal
(
count
);
return
ResponseHelper
.
buildResponse
(
idxBizFanWarningRecordPage
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"各场站设备预警情况(条) "
,
notes
=
"各场站设备预警情况(条) "
)
@GetMapping
(
value
=
"/getAllEquipAlarmInfoByStation"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getAllEquipAlarmInfoByStation
()
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
allEquipAlarmInfo
=
idxBizFanHealthIndexMapper
.
getAllEquipAlarmInfoByStation
();
HashMap
<
String
,
Integer
>
wxMap
=
new
HashMap
<>();
HashMap
<
String
,
Integer
>
zyMap
=
new
HashMap
<>();
HashMap
<
String
,
Integer
>
jgMap
=
new
HashMap
<>();
Set
<
String
>
list
=
new
HashSet
<>();
allEquipAlarmInfo
.
forEach
(
item
->
{
if
(
"危险"
.
equals
(
item
.
get
(
"warningName"
)))
{
wxMap
.
put
(
item
.
get
(
"station"
).
toString
(),
Integer
.
parseInt
(
item
.
get
(
"num"
).
toString
()));
}
else
if
(
"注意"
.
equals
(
item
.
get
(
"warningName"
)))
{
zyMap
.
put
(
item
.
get
(
"station"
).
toString
(),
Integer
.
parseInt
(
item
.
get
(
"num"
).
toString
()));
}
else
if
(
"警告"
.
equals
(
item
.
get
(
"warningName"
)))
{
jgMap
.
put
(
item
.
get
(
"station"
).
toString
(),
Integer
.
parseInt
(
item
.
get
(
"num"
).
toString
()));
}
list
.
add
(
item
.
get
(
"station"
).
toString
());
});
List
<
Integer
>
wxList
=
new
ArrayList
<>();
List
<
Integer
>
zyList
=
new
ArrayList
<>();
List
<
Integer
>
jgList
=
new
ArrayList
<>();
// List<StationBasic> stationBasics = stationBasicMapper.selectList(null);
// List<String> list = stationBasics.stream().map(StationBasic::getStationName).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
<>();
wxMapResult
.
put
(
"data"
,
wxList
);
wxMapResult
.
put
(
"name"
,
"危险"
);
HashMap
<
String
,
Object
>
zyMapResult
=
new
HashMap
<>();
zyMapResult
.
put
(
"data"
,
zyList
);
zyMapResult
.
put
(
"name"
,
"注意"
);
HashMap
<
String
,
Object
>
jgMapResult
=
new
HashMap
<>();
jgMapResult
.
put
(
"data"
,
jgList
);
jgMapResult
.
put
(
"name"
,
"警告"
);
List
<
Map
<
String
,
Object
>>
hashMaps
=
Arrays
.
asList
(
wxMapResult
,
zyMapResult
,
jgMapResult
);
resultMap
.
put
(
"axisData"
,
list
);
resultMap
.
put
(
"seriesData"
,
hashMaps
);
return
ResponseHelper
.
buildResponse
(
resultMap
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"各场站健康状态指数 "
,
notes
=
"各场站健康状态指数 "
)
@GetMapping
(
value
=
"/getHealthInfoByStation"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getHealthInfoByArea
(
@RequestParam
(
required
=
false
)
String
areaCode
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
healthListInfo
=
idxBizFanHealthIndexMapper
.
getHealthInfoByStation
(
areaCode
);
Map
<
String
,
BigDecimal
>
collect
=
healthListInfo
.
stream
().
collect
(
Collectors
.
toMap
(
t
->
t
.
get
(
"area"
).
toString
(),
t
->
new
BigDecimal
(
t
.
get
(
"healthIndex"
).
toString
())));
List
<
StationBasic
>
stationBasics
=
stationBasicMapper
.
selectList
(
new
LambdaQueryWrapper
<
StationBasic
>().
eq
(
StationBasic:
:
getAreaName
,
areaCode
));
List
<
String
>
list
=
stationBasics
.
stream
().
map
(
StationBasic:
:
getStationName
).
collect
(
Collectors
.
toList
());
List
<
Object
>
seriesData
=
new
ArrayList
<>();
list
.
forEach
(
item
->
seriesData
.
add
(
collect
.
getOrDefault
(
item
,
new
BigDecimal
(
"0"
))));
resultMap
.
put
(
"axisData"
,
list
);
resultMap
.
put
(
"seriesData"
,
seriesData
);
return
ResponseHelper
.
buildResponse
(
resultMap
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/entity/IdxBizFanWarningRecord.java
View file @
7747c69b
...
...
@@ -2,12 +2,15 @@ package com.yeejoin.amos.boot.module.jxiop.biz.entity;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.time.LocalDateTime
;
import
java.util.Date
;
/**
*
...
...
@@ -39,7 +42,7 @@ public class IdxBizFanWarningRecord{
*
*/
@TableField
(
"REC_DATE"
)
private
LocalDateTim
e
recDate
;
private
Dat
e
recDate
;
/**
*
...
...
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 @
7747c69b
...
...
@@ -2,6 +2,11 @@ package com.yeejoin.amos.boot.module.jxiop.biz.mapper2;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthIndex
;
import
org.apache.ibatis.annotations.Param
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.Map
;
/**
* Mapper 接口
...
...
@@ -11,4 +16,16 @@ import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanHealthIndex;
*/
public
interface
IdxBizFanHealthIndexMapper
extends
BaseMapper
<
IdxBizFanHealthIndex
>
{
BigDecimal
getHealthScoreInfo
(
@Param
(
"areaCode"
)
String
areaCode
,
@Param
(
"stationCode"
)
String
stationCode
);
List
<
Map
<
String
,
Object
>>
getHealthListInfo
(
@Param
(
"areaCode"
)
String
areaCode
,
@Param
(
"stationCode"
)
String
stationCode
);
List
<
Map
<
String
,
Object
>>
getAllEquipAlarmInfo
(
@Param
(
"tableName"
)
String
tableName
);
List
<
Map
<
String
,
Object
>>
getHealthInfoByArea
();
List
<
Map
<
String
,
Object
>>
getAllEquipAlarmInfoByStation
();
List
<
Map
<
String
,
Object
>>
getHealthInfoByStation
(
@Param
(
"areaCode"
)
String
areaCode
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/mapper2/IdxBizFanWarningRecordMapper.java
View file @
7747c69b
...
...
@@ -2,6 +2,9 @@ package com.yeejoin.amos.boot.module.jxiop.biz.mapper2;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRecord
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* Mapper 接口
...
...
@@ -11,4 +14,13 @@ import com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRecord;
*/
public
interface
IdxBizFanWarningRecordMapper
extends
BaseMapper
<
IdxBizFanWarningRecord
>
{
List
<
IdxBizFanWarningRecord
>
getEquipWarningInfoByPage
(
@Param
(
"arae"
)
String
arae
,
@Param
(
"station"
)
String
station
,
@Param
(
"stationType"
)
String
stationType
,
@Param
(
"current"
)
Integer
current
,
@Param
(
"size"
)
Integer
size
);
Integer
getEquipWarningInfoByPageCount
(
@Param
(
"arae"
)
String
arae
,
@Param
(
"station"
)
String
station
,
@Param
(
"stationType"
)
String
stationType
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
View file @
7747c69b
...
...
@@ -2,4 +2,220 @@
<!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.mapper2.IdxBizFanHealthIndexMapper"
>
<select
id=
"getHealthScoreInfo"
resultType=
"java.math.BigDecimal"
>
SELECT
avg( a.avgHealthIndex ) AS healthIndex
FROM
(
SELECT
IFNULL( AVG( HEALTH_INDEX ), 0 ) AS avgHealthIndex
FROM
idx_biz_fan_health_index
<where>
ANALYSIS_TYPE = '按天'
AND
DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = DATE_FORMAT( NOW(), "%Y-%m-%d" )
<if
test=
"areaCode != null and areaCode != ''"
>
AND ARAE = #{areaCode}
</if>
<if
test=
"stationCode != null and stationCode != ''"
>
AND STATION = #{stationCode}
</if>
<if
test=
"stationCode == null or stationCode == ''"
>
AND ( STATION IS NULL OR STATION = '' )
</if>
</where>
UNION ALL
(
SELECT
IFNULL( AVG( HEALTH_INDEX ), 0 ) AS avgHealthIndex
FROM
idx_biz_pv_health_index
<where>
ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = DATE_FORMAT( NOW(), "%Y-%m-%d" )
<if
test=
"areaCode != null and areaCode != ''"
>
AND ARAE = #{areaCode}
</if>
<if
test=
"stationCode != null and stationCode != ''"
>
AND STATION = #{stationCode}
</if>
<if
test=
"stationCode == null or stationCode == ''"
>
AND ( STATION IS NULL OR STATION = '' )
</if>
</where>
)
) a
</select>
<select
id=
"getHealthListInfo"
resultType=
"java.util.Map"
>
SELECT
IFNULL( AVG( HEALTH_INDEX ), 0 ) AS avgHealthIndex,
a.date
FROM
(
SELECT
DATE_FORMAT( DATE_ADD(( DATE( DATE_ADD( now(), INTERVAL - 15 DAY ))), INTERVAL @s DAY ), '%Y-%m-%d' ) AS date,
@s := @s + 1 AS `index`
FROM
mysql.help_topic,
( SELECT @s := 1 ) temp
WHERE
DATEDIFF( now(), DATE( DATE_ADD( now(), INTERVAL - 15 DAY )) ) >= @s
) a
LEFT JOIN (
SELECT
HEALTH_INDEX,
DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) AS recDate
FROM
idx_biz_pv_health_index
<where>
ANALYSIS_TYPE = '按天'
<if
test=
"areaCode != null and areaCode != ''"
>
AND ARAE = #{areaCode}
</if>
<if
test=
"stationCode != null and stationCode != ''"
>
AND STATION = #{stationCode}
</if>
<if
test=
"stationCode == null or stationCode == ''"
>
AND ( STATION IS NULL OR STATION = '' )
</if>
</where>
UNION ALL
(
SELECT
HEALTH_INDEX,
DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) AS recDate
FROM
idx_biz_fan_health_index
<where>
ANALYSIS_TYPE = '按天'
<if
test=
"areaCode != null and areaCode != ''"
>
AND ARAE = #{areaCode}
</if>
<if
test=
"stationCode != null and stationCode != ''"
>
AND STATION = #{stationCode}
</if>
<if
test=
"stationCode == null or stationCode == ''"
>
AND ( STATION IS NULL OR STATION = '' )
</if>
</where>
)
) b ON DATE_FORMAT( b.recDate, "%Y-%m-%d" ) = a.date
GROUP BY
a.date
</select>
<select
id=
"getAllEquipAlarmInfo"
resultType=
"java.util.Map"
>
SELECT
ARAE as area,
WARNING_NAME as warningName,
count(1) as num
FROM
${tableName} a
group by ARAE,
WARNING_NAME
</select>
<select
id=
"getHealthInfoByArea"
resultType=
"java.util.Map"
>
SELECT
ARAE as area,
avg( a.avgHealthIndex ) AS healthIndex
FROM
(
SELECT
IFNULL( AVG( HEALTH_INDEX ), 0 ) AS avgHealthIndex,
ARAE
FROM
idx_biz_fan_health_index
WHERE
( STATION IS NULL OR STATION = '' )
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = DATE_FORMAT( NOW(), "%Y-%m-%d" )
GROUP BY
ARAE UNION ALL
(
SELECT
IFNULL( AVG( HEALTH_INDEX ), 0 ) AS avgHealthIndex,
ARAE
FROM
idx_biz_pv_health_index
WHERE
( STATION IS NULL OR STATION = '' )
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = DATE_FORMAT( NOW(), "%Y-%m-%d" )
GROUP BY
ARAE
)
) a
GROUP BY
a.ARAE
</select>
<select
id=
"getAllEquipAlarmInfoByStation"
resultType=
"java.util.Map"
>
SELECT
STATION as station,
WARNING_NAME as warningName,
count(1) as num
FROM
idx_biz_fan_warning_record
group by STATION,
WARNING_NAME
union all
SELECT
STATION as station,
WARNING_NAME as warningName,
count(1) as num
FROM
idx_biz_pv_warning_record
group by STATION,
WARNING_NAME
</select>
<select
id=
"getHealthInfoByStation"
resultType=
"java.util.Map"
>
SELECT
a.STATION as station,
avg( a.avgHealthIndex ) AS healthIndex
FROM
(
SELECT
IFNULL( AVG( HEALTH_INDEX ), 0 ) AS avgHealthIndex,
STATION
FROM
idx_biz_fan_health_index
<where>
( STATION IS NOT NULL OR STATION != '' )
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = DATE_FORMAT( NOW(), "%Y-%m-%d" )
<if
test=
"areaCode != null and areaCode != ''"
>
AND ARAE = #{areaCode}
</if>
</where>
GROUP BY
STATION UNION ALL
(
SELECT
IFNULL( AVG( HEALTH_INDEX ), 0 ) AS avgHealthIndex,
ARAE
FROM
idx_biz_pv_health_index
<where>
( STATION IS NOT NULL OR STATION != '' )
AND ANALYSIS_TYPE = '按天'
AND DATE_FORMAT( REC_DATE, "%Y-%m-%d" ) = DATE_FORMAT( NOW(), "%Y-%m-%d" )
<if
test=
"areaCode != null and areaCode != ''"
>
AND ARAE = #{areaCode}
</if>
</where>
GROUP BY
STATION
)
) a
GROUP BY
a.STATION
</select>
</mapper>
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/cluster/IdxBizFanWarningRecordMapper.xml
View file @
7747c69b
<?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">
<mapper
namespace=
"com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizFanWarningRecordMapper"
>
<select
id=
"getEquipWarningInfoByPage"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.entity.IdxBizFanWarningRecord"
>
SELECT
a.*
FROM
(
SELECT
REC_DATE AS recDate,
STATION AS station,
EQUIPMENT_NAME AS equipmentName,
CONTENT AS content,
WARNING_NAME AS warningName,
DISPOSOTION_STATE AS disposotionState,
ARAE AS arae,
'pv' AS stationType
FROM
idx_biz_pv_warning_record UNION ALL
SELECT
REC_DATE AS recDate,
STATION AS station,
EQUIPMENT_NAME AS equipmentName,
CONTENT AS content,
WARNING_NAME AS warningName,
DISPOSOTION_STATE AS disposotionState,
ARAE AS arae,
'fan' AS stationType
FROM
idx_biz_fan_warning_record
) a
<where>
<if
test=
"arae != '' and arae != null"
>
AND a.arae = #{arae}
</if>
<if
test=
"station != '' and station != null"
>
AND a.station = #{station}
</if>
<if
test=
"stationType != '' and stationType != null"
>
AND a.stationType = #{stationType}
</if>
</where>
limit #{current}, #{size}
</select>
<select
id=
"getEquipWarningInfoByPageCount"
resultType=
"java.lang.Integer"
>
SELECT
count(1)
FROM
(
SELECT
REC_DATE AS recDate,
STATION AS station,
EQUIPMENT_NAME AS equipmentName,
CONTENT AS content,
WARNING_NAME AS warningName,
DISPOSOTION_STATE AS disposotionState,
ARAE AS arae,
'pv' AS stationType
FROM
idx_biz_pv_warning_record UNION ALL
SELECT
REC_DATE AS recDate,
STATION AS station,
EQUIPMENT_NAME AS equipmentName,
CONTENT AS content,
WARNING_NAME AS warningName,
DISPOSOTION_STATE AS disposotionState,
ARAE AS arae,
'fan' AS stationType
FROM
idx_biz_fan_warning_record
) a
<where>
<if
test=
"arae != '' and arae != null"
>
AND a.arae = #{arae}
</if>
<if
test=
"station != '' and station != null"
>
AND a.station = #{station}
</if>
<if
test=
"stationType != '' and stationType != null"
>
AND a.stationType = #{stationType}
</if>
</where>
</select>
</mapper>
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 @
7747c69b
...
...
@@ -992,7 +992,7 @@ public class MonitorFanIndicatorImpl implements IMonitorFanIndicator {
//构建平台数据
DataGridMock
DataGridMock
=
new
DataGridMock
(
current
,
resultList
.
size
(),
false
,
current
,
resultList
);
ColModel
colModelEquipmentNumber
=
new
ColModel
(
"equipmentNumber"
,
"equipmentNumber"
,
"风机编码"
,
"风机编码"
,
"dataGrid"
,
"equipmentNumber"
);
ColModel
colModelPower
=
new
ColModel
(
"power"
,
"power"
,
"有功功率(
MV)"
,
"有功功率(MV
)"
,
"dataGrid"
,
"power"
);
ColModel
colModelPower
=
new
ColModel
(
"power"
,
"power"
,
"有功功率(
kW)"
,
"有功功率(kW
)"
,
"dataGrid"
,
"power"
);
ColModel
colModelWindSpeed
=
new
ColModel
(
"windSpeed"
,
"windSpeed"
,
"风速(m/s)"
,
"风速(m/s)"
,
"dataGrid"
,
"windSpeed"
);
ColModel
colModelWind
=
new
ColModel
(
"wind"
,
"wind"
,
"风向(°)"
,
"风向(°)"
,
"dataGrid"
,
"wind"
);
ColModel
colModelElectricity
=
new
ColModel
(
"electricity"
,
"electricity"
,
"日发电量(万KWh)"
,
"日发电量(万KWh)"
,
"dataGrid"
,
"electricity"
);
...
...
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