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
4e98bb8f
Commit
4e98bb8f
authored
Nov 09, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 td
parent
2223c204
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
127 additions
and
118 deletions
+127
-118
TDBigScreenAnalyseController.java
...le/jxiop/biz/controller/TDBigScreenAnalyseController.java
+5
-5
IdxBizFanHealthIndexMapper.java
.../module/jxiop/biz/mapper2/IdxBizFanHealthIndexMapper.java
+1
-10
FanHealthIndexMapper.java
...boot/module/jxiop/biz/tdMapper2/FanHealthIndexMapper.java
+16
-0
IdxBizFanHealthIndexMapper.xml
...n/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
+0
-103
FanHealthIndex.xml
...iz/src/main/resources/mapper/tdengine2/FanHealthIndex.xml
+105
-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 @
4e98bb8f
...
@@ -360,7 +360,7 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -360,7 +360,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 +534,7 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -534,7 +534,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 +636,7 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -636,7 +636,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
=
idxBizF
anHealthIndexMapper
.
getPvWarningInfoBySubSystemTd
(
equipmentName
,
stationBasic
.
getFanGatewayId
());
List
<
Map
<
String
,
Object
>>
healthListInfo
=
f
anHealthIndexMapper
.
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 +675,12 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -675,12 +675,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 @
4e98bb8f
...
@@ -42,8 +42,6 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
...
@@ -42,8 +42,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 +63,6 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
...
@@ -65,7 +63,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,7 +83,6 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
...
@@ -86,7 +83,6 @@ 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
>>
getPvWarningInfoBySubSystemTd
(
@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
);
...
@@ -143,7 +139,6 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
...
@@ -143,7 +139,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
,
...
@@ -151,11 +146,7 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
...
@@ -151,11 +146,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 @
4e98bb8f
...
@@ -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,19 @@ public interface FanHealthIndexMapper extends BaseMapper<FanHealthIndex> {
...
@@ -71,4 +72,19 @@ 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
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
View file @
4e98bb8f
...
@@ -1667,107 +1667,4 @@
...
@@ -1667,107 +1667,4 @@
) a
) a
</select>
</select>
<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>
</mapper>
</mapper>
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/FanHealthIndex.xml
View file @
4e98bb8f
...
@@ -229,4 +229,109 @@
...
@@ -229,4 +229,109 @@
<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>
</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