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
e6b1d263
Commit
e6b1d263
authored
Nov 09, 2023
by
chenzhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://39.98.45.134:8090/moa/amos-boot-biz
into developer
parents
71f9d999
a26efcfc
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
193 additions
and
102 deletions
+193
-102
TDBigScreenAnalyseController.java
...le/jxiop/biz/controller/TDBigScreenAnalyseController.java
+13
-11
IdxBizFanHealthIndexMapper.java
.../module/jxiop/biz/mapper2/IdxBizFanHealthIndexMapper.java
+3
-9
FanHealthIndexMapper.java
...boot/module/jxiop/biz/tdMapper2/FanHealthIndexMapper.java
+17
-0
IdxBizFanHealthIndexMapper.xml
...n/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
+9
-82
FanHealthIndex.xml
...iz/src/main/resources/mapper/tdengine2/FanHealthIndex.xml
+151
-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/TDBigScreenAnalyseController.java
View file @
e6b1d263
...
@@ -128,18 +128,20 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -128,18 +128,20 @@ public class TDBigScreenAnalyseController extends BaseController {
}
}
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
healthListInfo
=
idxBizFanHealthIndexMapper
.
getHealthListInfo
(
areaCode
,
stationCode
);
List
<
Map
<
String
,
String
>>
dateInfoBy15
=
idxBizFanHealthIndexMapper
.
getDateInfoBy15
();
List
<
String
>
time
=
new
ArrayList
<>();
List
<
String
>
valueList
=
new
ArrayList
<>();
List
<
String
>
valueList
=
new
ArrayList
<>();
healthListInfo
.
forEach
(
item
->
{
String
finalStationCode
=
stationCode
;
time
.
add
(
item
.
get
(
"date"
).
toString
());
dateInfoBy15
.
forEach
(
item
->
{
valueList
.
add
(
item
.
get
(
"avgHealthIndex"
).
toString
().
replace
(
".0"
,
""
));
String
healthListInfo
=
fanHealthIndexMapper
.
getInfoByDate
(
areaCode
,
finalStationCode
,
item
.
get
(
"date"
));
valueList
.
add
(
StrUtil
.
isNotEmpty
(
healthListInfo
)
?
healthListInfo
:
"100"
);
});
});
List
<
Map
<
String
,
Object
>>
arrayList
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
arrayList
=
new
ArrayList
<>();
HashMap
<
String
,
Object
>
stringStringHashMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
stringStringHashMap
=
new
HashMap
<>();
stringStringHashMap
.
put
(
"data"
,
valueList
);
stringStringHashMap
.
put
(
"data"
,
valueList
);
arrayList
.
add
(
stringStringHashMap
);
arrayList
.
add
(
stringStringHashMap
);
resultMap
.
put
(
"axisData"
,
time
);
resultMap
.
put
(
"axisData"
,
dateInfoBy15
);
resultMap
.
put
(
"seriesData"
,
arrayList
);
resultMap
.
put
(
"seriesData"
,
arrayList
);
return
ResponseHelper
.
buildResponse
(
resultMap
);
return
ResponseHelper
.
buildResponse
(
resultMap
);
}
}
...
@@ -360,7 +362,7 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -360,7 +362,7 @@ public class TDBigScreenAnalyseController extends BaseController {
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationCode
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationCode
);
stationCode
=
stationBasic
.
getFanGatewayId
();
stationCode
=
stationBasic
.
getFanGatewayId
();
}
}
List
<
Map
<
String
,
Object
>>
list
=
idxBizF
anHealthIndexMapper
.
equipWarningRadarMapByTd
(
stationCode
);
List
<
Map
<
String
,
Object
>>
list
=
f
anHealthIndexMapper
.
equipWarningRadarMapByTd
(
stationCode
);
Map
<
String
,
Integer
>
warningNumMap
=
list
.
stream
().
collect
(
Collectors
.
toMap
(
t
->
t
.
get
(
"warningName"
).
toString
(),
t
->
Integer
.
parseInt
(
t
.
get
(
"num"
).
toString
())));
Map
<
String
,
Integer
>
warningNumMap
=
list
.
stream
().
collect
(
Collectors
.
toMap
(
t
->
t
.
get
(
"warningName"
).
toString
(),
t
->
Integer
.
parseInt
(
t
.
get
(
"num"
).
toString
())));
List
<
String
>
warningList
=
Arrays
.
asList
(
"危险"
,
"注意"
,
"警告"
);
List
<
String
>
warningList
=
Arrays
.
asList
(
"危险"
,
"注意"
,
"警告"
);
List
<
Integer
>
data
=
new
ArrayList
<>();
List
<
Integer
>
data
=
new
ArrayList
<>();
...
@@ -534,7 +536,7 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -534,7 +536,7 @@ public class TDBigScreenAnalyseController extends BaseController {
subSystem
=
java
.
net
.
URLDecoder
.
decode
(
subSystem
,
"UTF-8"
);
subSystem
=
java
.
net
.
URLDecoder
.
decode
(
subSystem
,
"UTF-8"
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
// List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getHealthInfoBySubSystem(subSystem, stationBasic.getFanGatewayId());
// List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getHealthInfoBySubSystem(subSystem, stationBasic.getFanGatewayId());
List
<
Map
<
String
,
Object
>>
healthListInfo
=
idxBizF
anHealthIndexMapper
.
getWarningInfoBySubSystemTd
(
subSystem
,
stationBasic
.
getFanGatewayId
());
List
<
Map
<
String
,
Object
>>
healthListInfo
=
f
anHealthIndexMapper
.
getWarningInfoBySubSystemTd
(
subSystem
,
stationBasic
.
getFanGatewayId
());
Map
<
Object
,
String
>
equipmentHealthIndexMap
=
healthListInfo
.
stream
().
collect
(
Collectors
.
toMap
(
t
->
t
.
get
(
"pointName"
),
t
->
t
.
get
(
"warningName"
).
toString
()));
Map
<
Object
,
String
>
equipmentHealthIndexMap
=
healthListInfo
.
stream
().
collect
(
Collectors
.
toMap
(
t
->
t
.
get
(
"pointName"
),
t
->
t
.
get
(
"warningName"
).
toString
()));
List
<
Map
<
String
,
Object
>>
pointNameList
=
idxBizFanHealthIndexMapper
.
getPointNameListBySumSystem
(
stationBasic
.
getFanGatewayId
(),
subSystem
);
List
<
Map
<
String
,
Object
>>
pointNameList
=
idxBizFanHealthIndexMapper
.
getPointNameListBySumSystem
(
stationBasic
.
getFanGatewayId
(),
subSystem
);
pointNameList
.
forEach
(
item
->
{
pointNameList
.
forEach
(
item
->
{
...
@@ -636,7 +638,7 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -636,7 +638,7 @@ public class TDBigScreenAnalyseController extends BaseController {
equipmentName
=
java
.
net
.
URLDecoder
.
decode
(
equipmentName
,
"UTF-8"
);
equipmentName
=
java
.
net
.
URLDecoder
.
decode
(
equipmentName
,
"UTF-8"
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
// List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getPvHealthInfoBySubSystem(equipmentName, stationBasic.getFanGatewayId());
// List<Map<String, Object>> healthListInfo = idxBizFanHealthIndexMapper.getPvHealthInfoBySubSystem(equipmentName, stationBasic.getFanGatewayId());
List
<
Map
<
String
,
Object
>>
healthListInfo
=
idxBizFanHealthIndexMapper
.
getPvWarningInfoBySubSystem
(
equipmentName
,
stationBasic
.
getFanGatewayId
());
List
<
Map
<
String
,
Object
>>
healthListInfo
=
fanHealthIndexMapper
.
getPvWarningInfoBySubSystemTd
(
equipmentName
,
stationBasic
.
getFanGatewayId
());
Map
<
Object
,
String
>
equipmentHealthIndexMap
=
healthListInfo
.
stream
().
collect
(
Collectors
.
toMap
(
t
->
t
.
get
(
"pointName"
),
t
->
t
.
get
(
"warningName"
).
toString
()));
Map
<
Object
,
String
>
equipmentHealthIndexMap
=
healthListInfo
.
stream
().
collect
(
Collectors
.
toMap
(
t
->
t
.
get
(
"pointName"
),
t
->
t
.
get
(
"warningName"
).
toString
()));
List
<
Map
<
String
,
Object
>>
pointNameList
=
idxBizFanHealthIndexMapper
.
getPvPointNameListBySumSystem
(
stationBasic
.
getFanGatewayId
(),
equipmentName
);
List
<
Map
<
String
,
Object
>>
pointNameList
=
idxBizFanHealthIndexMapper
.
getPvPointNameListBySumSystem
(
stationBasic
.
getFanGatewayId
(),
equipmentName
);
pointNameList
.
forEach
(
item
->
{
pointNameList
.
forEach
(
item
->
{
...
@@ -675,12 +677,12 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -675,12 +677,12 @@ public class TDBigScreenAnalyseController extends BaseController {
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
List
<
Map
<
String
,
Object
>>
resultListData
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
resultListData
=
new
ArrayList
<>();
String
recDate
=
idxBizF
anHealthIndexMapper
.
getRecDateByIndexAddressTs
(
stationBasic
.
getFanGatewayId
(),
indexAddress
,
tableName
);
String
recDate
=
f
anHealthIndexMapper
.
getRecDateByIndexAddressTs
(
stationBasic
.
getFanGatewayId
(),
indexAddress
,
tableName
);
if
(
CharSequenceUtil
.
isNotEmpty
(
recDate
))
{
if
(
CharSequenceUtil
.
isNotEmpty
(
recDate
))
{
Date
date
=
DateUtils
.
dateParse
(
recDate
,
DATE_TIME_PATTERN
);
Date
date
=
DateUtils
.
dateParse
(
recDate
,
DATE_TIME_PATTERN
);
String
datejian8
=
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
date
,
-
8
),
DATE_TIME_PATTERN
);
String
datejian8
=
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
date
,
-
8
),
DATE_TIME_PATTERN
);
String
datejian20
=
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
date
,
-
20
),
DATE_TIME_PATTERN
);
String
datejian20
=
DateUtils
.
dateFormat
(
DateUtils
.
dateAddHours
(
date
,
-
20
),
DATE_TIME_PATTERN
);
resultListData
=
idxBizF
anHealthIndexMapper
.
getInfoListByTableNameTs
(
stationBasic
.
getFanGatewayId
(),
indexAddress
,
tableName2
,
datejian8
,
datejian20
);
resultListData
=
f
anHealthIndexMapper
.
getInfoListByTableNameTs
(
stationBasic
.
getFanGatewayId
(),
indexAddress
,
tableName2
,
datejian8
,
datejian20
);
}
}
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
String
>
time
=
new
ArrayList
<>();
List
<
String
>
time
=
new
ArrayList
<>();
...
...
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 @
e6b1d263
...
@@ -28,6 +28,7 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
...
@@ -28,6 +28,7 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
BigDecimal
getHealthScoreInfoByParam
(
@Param
(
"areaCode"
)
String
areaCode
,
@Param
(
"stationCode"
)
String
stationCode
,
@Param
(
"analysisType"
)
String
analysisType
);
BigDecimal
getHealthScoreInfoByParam
(
@Param
(
"areaCode"
)
String
areaCode
,
@Param
(
"stationCode"
)
String
stationCode
,
@Param
(
"analysisType"
)
String
analysisType
);
List
<
Map
<
String
,
String
>>
getDateInfoBy15
();
List
<
Map
<
String
,
Object
>>
getHealthListInfo
(
@Param
(
"areaCode"
)
String
areaCode
,
@Param
(
"stationCode"
)
String
stationCode
);
List
<
Map
<
String
,
Object
>>
getHealthListInfo
(
@Param
(
"areaCode"
)
String
areaCode
,
@Param
(
"stationCode"
)
String
stationCode
);
...
@@ -42,8 +43,6 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
...
@@ -42,8 +43,6 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
List
<
Map
<
String
,
Object
>>
equipWarningRadarMap
(
@Param
(
"stationCode"
)
String
stationCode
);
List
<
Map
<
String
,
Object
>>
equipWarningRadarMap
(
@Param
(
"stationCode"
)
String
stationCode
);
List
<
Map
<
String
,
Object
>>
equipWarningRadarMapByTd
(
@Param
(
"stationCode"
)
String
stationCode
);
List
<
Map
<
String
,
Object
>>
getAllEquipAlarmInfoAnalysisByStationType
(
@Param
(
"tableName"
)
String
tableName
,
List
<
Map
<
String
,
Object
>>
getAllEquipAlarmInfoAnalysisByStationType
(
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"areaCode"
)
String
areaCode
,
@Param
(
"areaCode"
)
String
areaCode
,
@Param
(
"stationType"
)
String
stationType
);
@Param
(
"stationType"
)
String
stationType
);
...
@@ -65,7 +64,6 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
...
@@ -65,7 +64,6 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
List
<
Map
<
String
,
Object
>>
getWarningInfoBySubSystem
(
@Param
(
"subSystem"
)
String
subSystem
,
@Param
(
"gatewayId"
)
String
gatewayId
);
List
<
Map
<
String
,
Object
>>
getWarningInfoBySubSystem
(
@Param
(
"subSystem"
)
String
subSystem
,
@Param
(
"gatewayId"
)
String
gatewayId
);
List
<
Map
<
String
,
Object
>>
getWarningInfoBySubSystemTd
(
@Param
(
"subSystem"
)
String
subSystem
,
@Param
(
"gatewayId"
)
String
gatewayId
);
...
@@ -86,6 +84,7 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
...
@@ -86,6 +84,7 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
List
<
Map
<
String
,
Object
>>
getPvHealthInfoBySubSystem
(
@Param
(
"equipmentName"
)
String
equipmentName
,
@Param
(
"gatewayId"
)
String
gatewayId
);
List
<
Map
<
String
,
Object
>>
getPvHealthInfoBySubSystem
(
@Param
(
"equipmentName"
)
String
equipmentName
,
@Param
(
"gatewayId"
)
String
gatewayId
);
List
<
Map
<
String
,
Object
>>
getPvWarningInfoBySubSystem
(
@Param
(
"equipmentName"
)
String
equipmentName
,
@Param
(
"gatewayId"
)
String
gatewayId
);
List
<
Map
<
String
,
Object
>>
getPvWarningInfoBySubSystem
(
@Param
(
"equipmentName"
)
String
equipmentName
,
@Param
(
"gatewayId"
)
String
gatewayId
);
List
<
Map
<
String
,
Object
>>
getPvPointNameListBySumSystem
(
@Param
(
"gatewayId"
)
String
gatewayId
,
@Param
(
"equipmentName"
)
String
equipmentName
);
List
<
Map
<
String
,
Object
>>
getPvPointNameListBySumSystem
(
@Param
(
"gatewayId"
)
String
gatewayId
,
@Param
(
"equipmentName"
)
String
equipmentName
);
...
@@ -141,7 +140,6 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
...
@@ -141,7 +140,6 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
String
getRecDateByIndexAddress
(
@Param
(
"fanGatewayId"
)
String
fanGatewayId
,
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"tableName"
)
String
tableName
);
String
getRecDateByIndexAddress
(
@Param
(
"fanGatewayId"
)
String
fanGatewayId
,
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"tableName"
)
String
tableName
);
String
getRecDateByIndexAddressTs
(
@Param
(
"fanGatewayId"
)
String
fanGatewayId
,
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"tableName"
)
String
tableName
);
List
<
Map
<
String
,
Object
>>
getInfoListByTableName
(
@Param
(
"fanGatewayId"
)
String
fanGatewayId
,
List
<
Map
<
String
,
Object
>>
getInfoListByTableName
(
@Param
(
"fanGatewayId"
)
String
fanGatewayId
,
...
@@ -149,11 +147,7 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
...
@@ -149,11 +147,7 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"recDate"
)
String
recDate
);
@Param
(
"recDate"
)
String
recDate
);
List
<
Map
<
String
,
Object
>>
getInfoListByTableNameTs
(
@Param
(
"fanGatewayId"
)
String
fanGatewayId
,
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"recDate"
)
String
recDate
,
@Param
(
"date12"
)
String
date12
);
int
getIsWarningByPointId
(
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"fanGatewayId"
)
String
fanGatewayId
,
@Param
(
"tableName"
)
String
tableName
);
int
getIsWarningByPointId
(
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"fanGatewayId"
)
String
fanGatewayId
,
@Param
(
"tableName"
)
String
tableName
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tdMapper2/FanHealthIndexMapper.java
View file @
e6b1d263
...
@@ -9,6 +9,7 @@ import org.apache.ibatis.annotations.Param;
...
@@ -9,6 +9,7 @@ import org.apache.ibatis.annotations.Param;
import
org.apache.ibatis.annotations.Select
;
import
org.apache.ibatis.annotations.Select
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
public
interface
FanHealthIndexMapper
extends
BaseMapper
<
FanHealthIndex
>
{
public
interface
FanHealthIndexMapper
extends
BaseMapper
<
FanHealthIndex
>
{
@Select
(
"<script>"
+
@Select
(
"<script>"
+
...
@@ -71,4 +72,20 @@ public interface FanHealthIndexMapper extends BaseMapper<FanHealthIndex> {
...
@@ -71,4 +72,20 @@ public interface FanHealthIndexMapper extends BaseMapper<FanHealthIndex> {
List
<
FanHealthIndex
>
getInfoByPage
(
@Param
(
"dto"
)
FanHealthIndexDto
dto
);
List
<
FanHealthIndex
>
getInfoByPage
(
@Param
(
"dto"
)
FanHealthIndexDto
dto
);
Integer
getInfoByPageTotal
(
@Param
(
"dto"
)
FanHealthIndexDto
dto
);
Integer
getInfoByPageTotal
(
@Param
(
"dto"
)
FanHealthIndexDto
dto
);
List
<
Map
<
String
,
Object
>>
equipWarningRadarMapByTd
(
@Param
(
"stationCode"
)
String
stationCode
);
List
<
Map
<
String
,
Object
>>
getInfoListByTableNameTs
(
@Param
(
"fanGatewayId"
)
String
fanGatewayId
,
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"recDate"
)
String
recDate
,
@Param
(
"date12"
)
String
date12
);
String
getRecDateByIndexAddressTs
(
@Param
(
"fanGatewayId"
)
String
fanGatewayId
,
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"tableName"
)
String
tableName
);
List
<
Map
<
String
,
Object
>>
getPvWarningInfoBySubSystemTd
(
@Param
(
"equipmentName"
)
String
equipmentName
,
@Param
(
"gatewayId"
)
String
gatewayId
);
List
<
Map
<
String
,
Object
>>
getWarningInfoBySubSystemTd
(
@Param
(
"subSystem"
)
String
subSystem
,
@Param
(
"gatewayId"
)
String
gatewayId
);
String
getInfoByDate
(
@Param
(
"areaCode"
)
String
areaCode
,
@Param
(
"stationCode"
)
String
stationCode
,
@Param
(
"date"
)
String
date
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
View file @
e6b1d263
...
@@ -142,6 +142,7 @@
...
@@ -142,6 +142,7 @@
</select>
</select>
<select
id=
"getHealthListInfo"
resultType=
"java.util.Map"
>
<select
id=
"getHealthListInfo"
resultType=
"java.util.Map"
>
SELECT
SELECT
CEILING(IFNULL( AVG( HEALTH_INDEX ), 100 )) AS avgHealthIndex,
CEILING(IFNULL( AVG( HEALTH_INDEX ), 100 )) AS avgHealthIndex,
...
@@ -616,7 +617,7 @@
...
@@ -616,7 +617,7 @@
IFNULL( round(AVG( HEALTH_INDEX ), 2), 0 ) AS avgHealthIndex,
IFNULL( round(AVG( HEALTH_INDEX ), 2), 0 ) AS avgHealthIndex,
SUBARRAY as subarray
SUBARRAY as subarray
FROM
FROM
idx_biz_pv_health_index
pv_health_index_latest_data
<where>
<where>
ANALYSIS_OBJ_TYPE = '子阵'
ANALYSIS_OBJ_TYPE = '子阵'
AND ANALYSIS_TYPE = '按天'
AND ANALYSIS_TYPE = '按天'
...
@@ -634,7 +635,7 @@
...
@@ -634,7 +635,7 @@
CEILING(IFNULL( AVG( HEALTH_INDEX ), 100 )) AS avgHealthIndex,
CEILING(IFNULL( AVG( HEALTH_INDEX ), 100 )) AS avgHealthIndex,
EQUIPMENT_NAME AS equipmentName
EQUIPMENT_NAME AS equipmentName
FROM
FROM
idx_biz_pv_health_index
pv_health_index_latest_data
<where>
<where>
ANALYSIS_OBJ_TYPE = '设备'
ANALYSIS_OBJ_TYPE = '设备'
AND ANALYSIS_TYPE = '按天'
AND ANALYSIS_TYPE = '按天'
...
@@ -1667,88 +1668,14 @@
...
@@ -1667,88 +1668,14 @@
) a
) a
</select>
</select>
<select
id=
"equipWarningRadarMapByTd"
resultType=
"java.util.Map"
>
<select
id=
"getDateInfoBy15"
resultType=
"java.util.Map"
>
select
a.warningName,
count(1) as num
from
(
select
warning_name as warningName
from
analysis_data.fan_warning_record
<where>
((disposotion_state = '未处置')
or (disposotion_state = '已处置'
and ts > now - 3d - 8h))
<if
test=
"stationCode != null and stationCode != ''"
>
and gateway_id = #{stationCode}
</if>
</where>
union all
(select
warning_name as warningName
from
analysis_data.pv_warning_record
<where>
((disposotion_state = '未处置')
or (
disposotion_state = '已处置'
and ts > now - 3d - 8h ))
<if
test=
"stationCode != null and stationCode != ''"
>
and gateway_id = #{stationCode}
</if>
</where>
)
) a
group by
a.warningName
</select>
<select
id=
"getWarningInfoBySubSystemTd"
resultType=
"java.util.Map"
>
SELECT
SELECT
point_name as pointName,
DATE_FORMAT( DATE_ADD(( DATE( DATE_ADD( now(), INTERVAL - 15 DAY ))), INTERVAL @s DAY ), '%Y-%m-%d' ) AS date,
warning_name as warningName,
@s := @s + 1 AS `index`
last(ts)
FROM
fan_warning_record
<where>
disposotion_state = '未处置'
<if
test=
"subSystem != null and subSystem != ''"
>
AND sub_system = #{subSystem}
</if>
<if
test=
"gatewayId != null and gatewayId != ''"
>
AND gateway_id = #{gatewayId}
</if>
</where>
group by point_name
</select>
<select
id=
"getRecDateByIndexAddressTs"
resultType=
"java.lang.String"
>
SELECT
rec_date
FROM
${tableName}
WHERE
index_address = #{indexAddress}
AND disposotion_state = '未处置'
and gateway_id = #{fanGatewayId}
ORDER BY
ts DESC
LIMIT 1
</select>
<select
id=
"getInfoListByTableNameTs"
resultType=
"java.util.Map"
>
SELECT
*,
CEIL(health_index) as healthIndex
FROM
FROM
${tableName}
mysql.help_topic,
( SELECT @s := 1 ) temp
WHERE
WHERE
#{recDate} >= ts
DATEDIFF( now(), DATE( DATE_ADD( now(), INTERVAL - 15 DAY )) ) >= @s
AND ts >= #{date12}
AND analysis_type = '按时刻'
AND index_address = #{indexAddress}
AND gateway_id = #{fanGatewayId}
</select>
</select>
</mapper>
</mapper>
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/FanHealthIndex.xml
View file @
e6b1d263
...
@@ -229,4 +229,155 @@
...
@@ -229,4 +229,155 @@
<delete
id=
"deleteAllDataByTableName"
>
<delete
id=
"deleteAllDataByTableName"
>
delete from ${tableName} where analysis_type = #{analysisType}
delete from ${tableName} where analysis_type = #{analysisType}
</delete>
</delete>
<select
id=
"equipWarningRadarMapByTd"
resultType=
"java.util.Map"
>
select
a.warningName,
count(1) as num
from
(
select
warning_name as warningName
from
analysis_data.fan_warning_record
<where>
((disposotion_state = '未处置')
or (disposotion_state = '已处置'
and ts > now - 3d - 8h))
<if
test=
"stationCode != null and stationCode != ''"
>
and gateway_id = #{stationCode}
</if>
</where>
union all
(select
warning_name as warningName
from
analysis_data.pv_warning_record
<where>
((disposotion_state = '未处置')
or (
disposotion_state = '已处置'
and ts > now - 3d - 8h ))
<if
test=
"stationCode != null and stationCode != ''"
>
and gateway_id = #{stationCode}
</if>
</where>
)
) a
group by
a.warningName
</select>
<select
id=
"getWarningInfoBySubSystemTd"
resultType=
"java.util.Map"
>
SELECT
point_name as pointName,
warning_name as warningName,
last(ts)
FROM
fan_warning_record
<where>
disposotion_state = '未处置'
<if
test=
"subSystem != null and subSystem != ''"
>
AND sub_system = #{subSystem}
</if>
<if
test=
"gatewayId != null and gatewayId != ''"
>
AND gateway_id = #{gatewayId}
</if>
</where>
group by point_name
</select>
<select
id=
"getRecDateByIndexAddressTs"
resultType=
"java.lang.String"
>
SELECT
rec_date
FROM
${tableName}
WHERE
index_address = #{indexAddress}
AND disposotion_state = '未处置'
and gateway_id = #{fanGatewayId}
ORDER BY
ts DESC
LIMIT 1
</select>
<select
id=
"getInfoListByTableNameTs"
resultType=
"java.util.Map"
>
SELECT
*,
CEIL(health_index) as healthIndex
FROM
${tableName}
WHERE
#{recDate} >= ts
AND ts >= #{date12}
AND analysis_type = '按时刻'
AND index_address = #{indexAddress}
AND gateway_id = #{fanGatewayId}
</select>
<select
id=
"getPvWarningInfoBySubSystemTd"
resultType=
"java.util.Map"
>
SELECT
point_name as pointName,
warning_name as warningName,
last(ts)
FROM
pv_warning_record
<where>
disposotion_state = '未处置'
<if
test=
"equipmentName != null and equipmentName != ''"
>
AND equipment_name = #{equipmentName}
</if>
<if
test=
"gatewayId != null and gatewayId != ''"
>
AND gateway_id = #{gatewayId}
</if>
</where>
group by point_name
</select>
<select
id=
"getInfoByDate"
resultType=
"java.lang.String"
>
select ceil(avg(b.health_index)) as healthIndex from
(SELECT
health_index
FROM
pv_health_index_day
<where>
rec_date = concat(#{date}, ' 00:00:00')
<if
test=
"areaCode != null and areaCode != ''"
>
AND area like concat('%', #{areaCode}, '%')
AND analysis_obj_type = '片区'
</if>
<if
test=
"stationCode != null and stationCode != ''"
>
AND gateway_id = #{stationCode}
AND analysis_obj_type = '场站'
</if>
<if
test=
"(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')"
>
AND analysis_obj_type = '片区'
</if>
</where>
UNION ALL
(
SELECT
health_index
FROM
fan_health_index_day
<where>
rec_date = concat(#{date}, ' 00:00:00')
<if
test=
"areaCode != null and areaCode != ''"
>
AND area like concat('%', #{areaCode}, '%')
AND analysis_obj_type = '片区'
</if>
<if
test=
"stationCode != null and stationCode != ''"
>
AND gateway_id = #{stationCode}
AND analysis_obj_type = '场站'
</if>
<if
test=
"(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')"
>
AND analysis_obj_type = '片区'
</if>
</where>
)) b
</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