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
35384dae
Commit
35384dae
authored
Jan 26, 2024
by
tangwei
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
754577e3
677885e3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
107 additions
and
36 deletions
+107
-36
BigScreenAnalyseController.java
...dule/jxiop/biz/controller/BigScreenAnalyseController.java
+17
-2
IdxBizFanHealthIndexController.java
.../jxiop/biz/controller/IdxBizFanHealthIndexController.java
+0
-0
IdxBizPvHealthIndexController.java
...e/jxiop/biz/controller/IdxBizPvHealthIndexController.java
+28
-12
IdxBizFanHealthIndexMapper.java
.../module/jxiop/biz/mapper2/IdxBizFanHealthIndexMapper.java
+3
-3
IdxBizFanHealthIndexServiceImpl.java
...iop/biz/service/impl/IdxBizFanHealthIndexServiceImpl.java
+2
-2
FanHealthIndexDayMapper.java
...t/module/jxiop/biz/tdMapper2/FanHealthIndexDayMapper.java
+4
-1
FanHealthIndexHourMapper.java
.../module/jxiop/biz/tdMapper2/FanHealthIndexHourMapper.java
+2
-1
FanHealthIndexMomentMapper.java
...odule/jxiop/biz/tdMapper2/FanHealthIndexMomentMapper.java
+2
-1
PvHealthIndexDayMapper.java
...ot/module/jxiop/biz/tdMapper2/PvHealthIndexDayMapper.java
+2
-1
PvHealthIndexHourMapper.java
...t/module/jxiop/biz/tdMapper2/PvHealthIndexHourMapper.java
+2
-1
PvHealthIndexMomentMapper.java
...module/jxiop/biz/tdMapper2/PvHealthIndexMomentMapper.java
+2
-1
IndicatorDataMapper.java
...s/boot/module/jxiop/biz/tdmapper/IndicatorDataMapper.java
+2
-2
IdxBizFanHealthIndexMapper.xml
...n/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
+16
-4
IdxBizTableMapper.xml
...z/src/main/resources/mapper/cluster/IdxBizTableMapper.xml
+10
-5
IndicatorData.xml
...-biz/src/main/resources/mapper/tdengine/IndicatorData.xml
+15
-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/BigScreenAnalyseController.java
View file @
35384dae
...
@@ -17,6 +17,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallDataDTO;
...
@@ -17,6 +17,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallDataDTO;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallInfoDTO
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallInfoDTO
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.*
;
import
com.yeejoin.amos.boot.module.jxiop.biz.entity.*
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.*
;
import
com.yeejoin.amos.boot.module.jxiop.biz.mapper2.*
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.IPermissionService
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl
;
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
;
...
@@ -77,6 +78,8 @@ public class BigScreenAnalyseController extends BaseController {
...
@@ -77,6 +78,8 @@ public class BigScreenAnalyseController extends BaseController {
@Autowired
@Autowired
RiskWarningFeign
riskWarningFeign
;
RiskWarningFeign
riskWarningFeign
;
@Autowired
IPermissionService
permissionService
;
@Autowired
@Autowired
...
@@ -107,14 +110,14 @@ public class BigScreenAnalyseController extends BaseController {
...
@@ -107,14 +110,14 @@ public class BigScreenAnalyseController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"场站设备健康状态指数与趋势 - 折线图"
,
notes
=
"场站设备健康状态指数与趋势 - 折线图"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"场站设备健康状态指数与趋势 - 折线图"
,
notes
=
"场站设备健康状态指数与趋势 - 折线图"
)
@GetMapping
(
value
=
"/getHealthListInfo"
)
@GetMapping
(
value
=
"/getHealthListInfo"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getHealthListInfo
(
@RequestParam
(
required
=
false
)
String
areaCode
,
@RequestParam
(
required
=
false
)
String
stationCode
)
{
public
ResponseModel
<
Map
<
String
,
Object
>>
getHealthListInfo
(
@RequestParam
(
required
=
false
)
String
areaCode
,
@RequestParam
(
required
=
false
)
String
stationCode
)
{
List
<
String
>
gatewayIds
=
this
.
getGatewayIds
();
if
(
StrUtil
.
isNotEmpty
(
stationCode
))
{
if
(
StrUtil
.
isNotEmpty
(
stationCode
))
{
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationCode
);
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationCode
);
stationCode
=
stationBasic
.
getFanGatewayId
();
stationCode
=
stationBasic
.
getFanGatewayId
();
}
}
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
healthListInfo
=
idxBizFanHealthIndexMapper
.
getHealthListInfo
(
areaCode
,
stationCode
);
List
<
Map
<
String
,
Object
>>
healthListInfo
=
idxBizFanHealthIndexMapper
.
getHealthListInfo
(
areaCode
,
stationCode
,
gatewayIds
);
List
<
String
>
time
=
new
ArrayList
<>();
List
<
String
>
time
=
new
ArrayList
<>();
List
<
String
>
valueList
=
new
ArrayList
<>();
List
<
String
>
valueList
=
new
ArrayList
<>();
healthListInfo
.
forEach
(
item
->
{
healthListInfo
.
forEach
(
item
->
{
...
@@ -1151,4 +1154,16 @@ private FanHealthIndexDayMapper fanHealthIndexDayMapper;
...
@@ -1151,4 +1154,16 @@ private FanHealthIndexDayMapper fanHealthIndexDayMapper;
return
ResponseHelper
.
buildResponse
(
true
);
return
ResponseHelper
.
buildResponse
(
true
);
}
}
/**
* 获取用户权限(此处使用gatewayId)
*
* @return gatewayIds
*/
private
List
<
String
>
getGatewayIds
()
{
List
<
String
>
permissions
=
permissionService
.
getCurrentUserPermissions
();
if
(
Objects
.
isNull
(
permissions
))
{
permissions
=
Collections
.
emptyList
();
}
return
permissions
;
}
}
}
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 @
35384dae
This diff is collapsed.
Click to expand it.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/IdxBizPvHealthIndexController.java
View file @
35384dae
This diff is collapsed.
Click to expand it.
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 @
35384dae
...
@@ -34,13 +34,13 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
...
@@ -34,13 +34,13 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
List
<
Map
<
String
,
String
>>
getDateInfoBy15
();
List
<
Map
<
String
,
String
>>
getDateInfoBy15
();
List
<
Map
<
String
,
String
>>
getDateInfo
(
Date
startTime
,
Date
endTime
);
List
<
Map
<
String
,
String
>>
getDateInfo
(
Date
startTime
,
Date
endTime
);
List
<
Map
<
String
,
String
>>
getHourInfo
(
Date
startTime
,
Date
endTime
);
List
<
Map
<
String
,
String
>>
getHourInfo
(
Date
startTime
,
Date
endTime
);
List
<
Map
<
String
,
String
>>
getMomentInfo
(
Date
startTime
,
Date
endTime
);
List
<
Map
<
String
,
String
>>
getMomentInfo
(
Date
startTime
,
Date
endTime
);
List
<
Map
<
String
,
Object
>>
getHealthListInfo
(
@Param
(
"areaCode"
)
String
areaCode
,
List
<
Map
<
String
,
Object
>>
getHealthListInfo
(
@Param
(
"areaCode"
)
String
areaCode
,
@Param
(
"stationCode"
)
String
stationCode
);
@Param
(
"stationCode"
)
String
stationCode
,
@Param
(
"gatewayIds"
)
List
<
String
>
gatewayIds
);
List
<
Map
<
String
,
Object
>>
getAllEquipAlarmInfo
(
@Param
(
"tableName"
)
String
tableName
);
List
<
Map
<
String
,
Object
>>
getAllEquipAlarmInfo
(
@Param
(
"tableName"
)
String
tableName
);
...
...
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 @
35384dae
...
@@ -73,7 +73,7 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth
...
@@ -73,7 +73,7 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth
public
final
DecimalFormat
dfSS
=
new
DecimalFormat
(
"0.00"
);
public
final
DecimalFormat
dfSS
=
new
DecimalFormat
(
"0.00"
);
public
Object
getqyt
(
String
type
,
String
address
,
String
statioName
,
String
equipmentName
,
String
arae
,
String
startTime
,
String
endTime
){
public
Object
getqyt
(
String
type
,
String
address
,
String
statioName
,
String
equipmentName
,
String
arae
,
String
startTime
,
String
endTime
,
List
<
String
>
gatewayIds
){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
try
{
try
{
//获取场站网关
//获取场站网关
...
@@ -118,7 +118,7 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth
...
@@ -118,7 +118,7 @@ public class IdxBizFanHealthIndexServiceImpl extends BaseService<IdxBizFanHealth
endTime
=
sdf
.
format
(
currentDayEndTime
);
endTime
=
sdf
.
format
(
currentDayEndTime
);
}
}
List
<
IndicatorData
>
indicatorDataListActivePowers
=
new
ArrayList
<>();
List
<
IndicatorData
>
indicatorDataListActivePowers
=
new
ArrayList
<>();
indicatorDataListActivePowers
=
indicatorDataMapper
.
selectDataByequipmentIndexNameAndtimeAndEquipmentNumber
(
tdid
,
startTime
,
endTime
);
indicatorDataListActivePowers
=
indicatorDataMapper
.
selectDataByequipmentIndexNameAndtimeAndEquipmentNumber
(
tdid
,
startTime
,
endTime
,
gatewayIds
);
List
<
String
>
axisData
=
new
ArrayList
<>();
List
<
String
>
axisData
=
new
ArrayList
<>();
List
<
String
>
activePowers
=
new
ArrayList
<>();
List
<
String
>
activePowers
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
indicatorDataListActivePowers
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
indicatorDataListActivePowers
.
size
();
i
++)
{
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tdMapper2/FanHealthIndexDayMapper.java
View file @
35384dae
...
@@ -21,11 +21,14 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> {
...
@@ -21,11 +21,14 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> {
"<if test='healthLevel!= null'>AND health_level = #{healthLevel} </if>"
+
"<if test='healthLevel!= null'>AND health_level = #{healthLevel} </if>"
+
"<if test='subSystem!= null'>AND sub_system = #{subSystem} </if> "
+
"<if test='subSystem!= null'>AND sub_system = #{subSystem} </if> "
+
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>"
+
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>"
+
"<if test='gatewayIds != null and gatewayIds.size() > 0'>AND GATEWAY_ID IN <foreach collection='gatewayIds' item='gatewayId' open='(' separator=',' close=')'>#{gatewayId}</foreach></if>"
+
"order by health_index "
+
"order by health_index "
+
"<if test='current != null and size != null'>limit ${current},${size} </if>"
+
"<if test='current != null and size != null'>limit ${current},${size} </if>"
+
"</script>"
)
"</script>"
)
List
<
FanHealthIndexDay
>
selectData
(
@Param
(
"healthLevel"
)
String
healthLevel
,
@Param
(
"area"
)
String
area
,
@Param
(
"equipmentName"
)
String
equipmentName
,
@Param
(
"subSystem"
)
String
subSystem
,
@Param
(
"analysisType"
)
String
analysisType
,
@Param
(
"analysisObjType"
)
String
analysisObjType
,
@Param
(
"station"
)
String
station
,
@Param
(
"pointName"
)
String
pointName
,
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"startTimeTop"
)
String
startTimeTop
,
@Param
(
"endTimeTop"
)
String
endTimeTop
,
List
<
FanHealthIndexDay
>
selectData
(
@Param
(
"healthLevel"
)
String
healthLevel
,
@Param
(
"area"
)
String
area
,
@Param
(
"equipmentName"
)
String
equipmentName
,
@Param
(
"subSystem"
)
String
subSystem
,
@Param
(
"analysisType"
)
String
analysisType
,
@Param
(
"analysisObjType"
)
String
analysisObjType
,
@Param
(
"station"
)
String
station
,
@Param
(
"pointName"
)
String
pointName
,
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"startTimeTop"
)
String
startTimeTop
,
@Param
(
"endTimeTop"
)
String
endTimeTop
,
@Param
(
"current"
)
Integer
current
,
@Param
(
"size"
)
Integer
size
);
@Param
(
"current"
)
Integer
current
,
@Param
(
"size"
)
Integer
size
,
@Param
(
"gatewayIds"
)
List
<
String
>
gatewayIds
);
@Select
(
"<script>"
+
@Select
(
"<script>"
+
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tdMapper2/FanHealthIndexHourMapper.java
View file @
35384dae
...
@@ -20,9 +20,10 @@ public interface FanHealthIndexHourMapper extends BaseMapper<FanHealthIndexHour>
...
@@ -20,9 +20,10 @@ public interface FanHealthIndexHourMapper extends BaseMapper<FanHealthIndexHour>
"<if test='healthLevel!= null'>AND health_level = #{healthLevel} </if>"
+
"<if test='healthLevel!= null'>AND health_level = #{healthLevel} </if>"
+
"<if test='subSystem!= null'>AND sub_system = #{subSystem} </if> "
+
"<if test='subSystem!= null'>AND sub_system = #{subSystem} </if> "
+
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>"
+
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>"
+
"<if test='gatewayIds != null and gatewayIds.size() > 0'>AND GATEWAY_ID IN <foreach collection='gatewayIds' item='gatewayId' open='(' separator=',' close=')'>#{gatewayId}</foreach></if>"
+
"order by health_index "
+
"order by health_index "
+
"<if test='current != null and size != null'>limit ${current},${size} </if>"
+
"<if test='current != null and size != null'>limit ${current},${size} </if>"
+
"</script>"
)
"</script>"
)
List
<
FanHealthIndexHour
>
selectData
(
@Param
(
"healthLevel"
)
String
healthLevel
,
@Param
(
"area"
)
String
area
,
@Param
(
"equipmentName"
)
String
equipmentName
,
@Param
(
"subSystem"
)
String
subSystem
,
@Param
(
"analysisType"
)
String
analysisType
,
@Param
(
"analysisObjType"
)
String
analysisObjType
,
@Param
(
"station"
)
String
station
,
@Param
(
"pointName"
)
String
pointName
,
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"startTimeTop"
)
String
startTimeTop
,
@Param
(
"endTimeTop"
)
String
endTimeTop
,
@Param
(
"current"
)
Integer
current
,
@Param
(
"size"
)
Integer
size
);
List
<
FanHealthIndexHour
>
selectData
(
@Param
(
"healthLevel"
)
String
healthLevel
,
@Param
(
"area"
)
String
area
,
@Param
(
"equipmentName"
)
String
equipmentName
,
@Param
(
"subSystem"
)
String
subSystem
,
@Param
(
"analysisType"
)
String
analysisType
,
@Param
(
"analysisObjType"
)
String
analysisObjType
,
@Param
(
"station"
)
String
station
,
@Param
(
"pointName"
)
String
pointName
,
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"startTimeTop"
)
String
startTimeTop
,
@Param
(
"endTimeTop"
)
String
endTimeTop
,
@Param
(
"current"
)
Integer
current
,
@Param
(
"size"
)
Integer
size
,
@Param
(
"gatewayIds"
)
List
<
String
>
gatewayIds
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tdMapper2/FanHealthIndexMomentMapper.java
View file @
35384dae
...
@@ -20,9 +20,10 @@ public interface FanHealthIndexMomentMapper extends BaseMapper<FanHealthIndexMom
...
@@ -20,9 +20,10 @@ public interface FanHealthIndexMomentMapper extends BaseMapper<FanHealthIndexMom
"<if test='healthLevel!= null'>AND health_level = #{healthLevel} </if>"
+
"<if test='healthLevel!= null'>AND health_level = #{healthLevel} </if>"
+
"<if test='subSystem!= null'>AND sub_system = #{subSystem} </if> "
+
"<if test='subSystem!= null'>AND sub_system = #{subSystem} </if> "
+
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>"
+
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>"
+
"<if test='gatewayIds != null and gatewayIds.size() > 0'>AND GATEWAY_ID IN <foreach collection='gatewayIds' item='gatewayId' open='(' separator=',' close=')'>#{gatewayId}</foreach></if>"
+
"order by health_index "
+
"order by health_index "
+
"<if test='current != null and size != null'>limit ${current},${size} </if>"
+
"<if test='current != null and size != null'>limit ${current},${size} </if>"
+
"</script>"
)
"</script>"
)
List
<
FanHealthIndexMoment
>
selectData
(
@Param
(
"healthLevel"
)
String
healthLevel
,
@Param
(
"area"
)
String
area
,
@Param
(
"equipmentName"
)
String
equipmentName
,
@Param
(
"subSystem"
)
String
subSystem
,
@Param
(
"analysisType"
)
String
analysisType
,
@Param
(
"analysisObjType"
)
String
analysisObjType
,
@Param
(
"station"
)
String
station
,
@Param
(
"pointName"
)
String
pointName
,
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"startTimeTop"
)
String
startTimeTop
,
@Param
(
"endTimeTop"
)
String
endTimeTop
,
@Param
(
"current"
)
Integer
current
,
@Param
(
"size"
)
Integer
size
);
List
<
FanHealthIndexMoment
>
selectData
(
@Param
(
"healthLevel"
)
String
healthLevel
,
@Param
(
"area"
)
String
area
,
@Param
(
"equipmentName"
)
String
equipmentName
,
@Param
(
"subSystem"
)
String
subSystem
,
@Param
(
"analysisType"
)
String
analysisType
,
@Param
(
"analysisObjType"
)
String
analysisObjType
,
@Param
(
"station"
)
String
station
,
@Param
(
"pointName"
)
String
pointName
,
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"startTimeTop"
)
String
startTimeTop
,
@Param
(
"endTimeTop"
)
String
endTimeTop
,
@Param
(
"current"
)
Integer
current
,
@Param
(
"size"
)
Integer
size
,
@Param
(
"gatewayIds"
)
List
<
String
>
gatewayIds
);
}
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tdMapper2/PvHealthIndexDayMapper.java
View file @
35384dae
...
@@ -22,6 +22,7 @@ public interface PvHealthIndexDayMapper extends BaseMapper<PvHealthIndexDay> {
...
@@ -22,6 +22,7 @@ public interface PvHealthIndexDayMapper extends BaseMapper<PvHealthIndexDay> {
"<if test='healthLevel!= null '>AND health_level = #{healthLevel} </if>"
+
"<if test='healthLevel!= null '>AND health_level = #{healthLevel} </if>"
+
"<if test='subarray!= null'>AND subarray = #{subarray} </if> "
+
"<if test='subarray!= null'>AND subarray = #{subarray} </if> "
+
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>"
+
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>"
+
"<if test='gatewayIds != null and gatewayIds.size() > 0'>AND GATEWAY_ID IN <foreach collection='gatewayIds' item='gatewayId' open='(' separator=',' close=')'>#{gatewayId}</foreach></if>"
+
"order by health_index "
+
"order by health_index "
+
"<if test='current != null and size != null'>limit ${current},${size} </if>"
+
"<if test='current != null and size != null'>limit ${current},${size} </if>"
+
"</script>"
)
"</script>"
)
...
@@ -36,7 +37,7 @@ public interface PvHealthIndexDayMapper extends BaseMapper<PvHealthIndexDay> {
...
@@ -36,7 +37,7 @@ public interface PvHealthIndexDayMapper extends BaseMapper<PvHealthIndexDay> {
@Param
(
"startTimeTop"
)
String
startTimeTop
,
@Param
(
"startTimeTop"
)
String
startTimeTop
,
@Param
(
"endTimeTop"
)
String
endTimeTop
,
@Param
(
"endTimeTop"
)
String
endTimeTop
,
@Param
(
"equipmentName"
)
String
equipmentName
@Param
(
"equipmentName"
)
String
equipmentName
,
@Param
(
"current"
)
Integer
current
,
@Param
(
"size"
)
Integer
size
);
,
@Param
(
"current"
)
Integer
current
,
@Param
(
"size"
)
Integer
size
,
@Param
(
"gatewayIds"
)
List
<
String
>
gatewayIds
);
@Select
(
"<script>"
+
@Select
(
"<script>"
+
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tdMapper2/PvHealthIndexHourMapper.java
View file @
35384dae
...
@@ -21,11 +21,12 @@ public interface PvHealthIndexHourMapper extends BaseMapper<PvHealthIndexHour> {
...
@@ -21,11 +21,12 @@ public interface PvHealthIndexHourMapper extends BaseMapper<PvHealthIndexHour> {
"<if test='healthLevel!= null '>AND health_level = #{healthLevel} </if>"
+
"<if test='healthLevel!= null '>AND health_level = #{healthLevel} </if>"
+
"<if test='subarray!= null'>AND subarray = #{subarray} </if> "
+
"<if test='subarray!= null'>AND subarray = #{subarray} </if> "
+
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>"
+
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>"
+
"<if test='gatewayIds != null and gatewayIds.size() > 0'>AND GATEWAY_ID IN <foreach collection='gatewayIds' item='gatewayId' open='(' separator=',' close=')'>#{gatewayId}</foreach></if>"
+
"order by health_index "
+
"order by health_index "
+
"<if test='current != null and size != null'>limit ${current},${size} </if>"
+
"<if test='current != null and size != null'>limit ${current},${size} </if>"
+
"</script>"
)
"</script>"
)
List
<
PvHealthIndexHour
>
selectData
(
@Param
(
"healthLevel"
)
String
healthLevel
,
@Param
(
"area"
)
String
area
,
@Param
(
"equipmentName"
)
String
equipmentName
,
@Param
(
"subarray"
)
String
subarray
,
@Param
(
"analysisType"
)
String
analysisType
,
@Param
(
"analysisObjType"
)
String
analysisObjType
,
@Param
(
"station"
)
String
station
,
@Param
(
"pointName"
)
String
pointName
,
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"startTimeTop"
)
String
startTimeTop
,
@Param
(
"endTimeTop"
)
String
endTimeTop
List
<
PvHealthIndexHour
>
selectData
(
@Param
(
"healthLevel"
)
String
healthLevel
,
@Param
(
"area"
)
String
area
,
@Param
(
"equipmentName"
)
String
equipmentName
,
@Param
(
"subarray"
)
String
subarray
,
@Param
(
"analysisType"
)
String
analysisType
,
@Param
(
"analysisObjType"
)
String
analysisObjType
,
@Param
(
"station"
)
String
station
,
@Param
(
"pointName"
)
String
pointName
,
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"startTimeTop"
)
String
startTimeTop
,
@Param
(
"endTimeTop"
)
String
endTimeTop
,
@Param
(
"current"
)
Integer
current
,
@Param
(
"size"
)
Integer
size
);
,
@Param
(
"current"
)
Integer
current
,
@Param
(
"size"
)
Integer
size
,
@Param
(
"gatewayIds"
)
List
<
String
>
gatewayIds
);
@Select
(
"<script>"
+
@Select
(
"<script>"
+
"SELECT count(1)"
+
"SELECT count(1)"
+
" FROM analysis_data.pv_health_index_hour WHERE analysis_obj_type = #{analysisObjType}"
+
" FROM analysis_data.pv_health_index_hour WHERE analysis_obj_type = #{analysisObjType}"
+
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tdMapper2/PvHealthIndexMomentMapper.java
View file @
35384dae
...
@@ -21,11 +21,12 @@ public interface PvHealthIndexMomentMapper extends BaseMapper<PvHealthIndexMomen
...
@@ -21,11 +21,12 @@ public interface PvHealthIndexMomentMapper extends BaseMapper<PvHealthIndexMomen
"<if test='healthLevel!= null '>AND health_level = #{healthLevel} </if>"
+
"<if test='healthLevel!= null '>AND health_level = #{healthLevel} </if>"
+
"<if test='subarray!= null'>AND subarray = #{subarray} </if> "
+
"<if test='subarray!= null'>AND subarray = #{subarray} </if> "
+
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>"
+
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>"
+
"<if test='gatewayIds != null and gatewayIds.size() > 0'>AND GATEWAY_ID IN <foreach collection='gatewayIds' item='gatewayId' open='(' separator=',' close=')'>#{gatewayId}</foreach></if>"
+
"order by health_index "
+
"order by health_index "
+
"<if test='current != null and size != null'>limit ${current},${size} </if>"
+
"<if test='current != null and size != null'>limit ${current},${size} </if>"
+
"</script>"
)
"</script>"
)
List
<
PvHealthIndexMoment
>
selectData
(
@Param
(
"healthLevel"
)
String
healthLevel
,
@Param
(
"area"
)
String
area
,
@Param
(
"equipmentName"
)
String
equipmentName
,
@Param
(
"subarray"
)
String
subarray
,
@Param
(
"analysisType"
)
String
analysisType
,
@Param
(
"analysisObjType"
)
String
analysisObjType
,
@Param
(
"station"
)
String
station
,
@Param
(
"pointName"
)
String
pointName
,
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"startTimeTop"
)
String
startTimeTop
,
@Param
(
"endTimeTop"
)
String
endTimeTop
List
<
PvHealthIndexMoment
>
selectData
(
@Param
(
"healthLevel"
)
String
healthLevel
,
@Param
(
"area"
)
String
area
,
@Param
(
"equipmentName"
)
String
equipmentName
,
@Param
(
"subarray"
)
String
subarray
,
@Param
(
"analysisType"
)
String
analysisType
,
@Param
(
"analysisObjType"
)
String
analysisObjType
,
@Param
(
"station"
)
String
station
,
@Param
(
"pointName"
)
String
pointName
,
@Param
(
"indexAddress"
)
String
indexAddress
,
@Param
(
"startTimeTop"
)
String
startTimeTop
,
@Param
(
"endTimeTop"
)
String
endTimeTop
,
@Param
(
"current"
)
Integer
current
,
@Param
(
"size"
)
Integer
size
);
;
,
@Param
(
"current"
)
Integer
current
,
@Param
(
"size"
)
Integer
size
,
@Param
(
"gatewayIds"
)
List
<
String
>
gatewayIds
)
;
@Select
(
"<script>"
+
@Select
(
"<script>"
+
"SELECT count(1)"
+
"SELECT count(1)"
+
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tdmapper/IndicatorDataMapper.java
View file @
35384dae
...
@@ -48,8 +48,8 @@ public interface IndicatorDataMapper extends BaseMapper<IndicatorData> {
...
@@ -48,8 +48,8 @@ public interface IndicatorDataMapper extends BaseMapper<IndicatorData> {
List
<
IndicatorData
>
selectByIndexNameAndDate
(
@Param
(
"equipmentIndexName"
)
String
equipmentIndexName
,
@Param
(
"gatewayId"
)
String
gatewayId
,
@Param
(
"date"
)
String
date
,
@Param
(
"limitNum"
)
Integer
limitNum
);
List
<
IndicatorData
>
selectByIndexNameAndDate
(
@Param
(
"equipmentIndexName"
)
String
equipmentIndexName
,
@Param
(
"gatewayId"
)
String
gatewayId
,
@Param
(
"date"
)
String
date
,
@Param
(
"limitNum"
)
Integer
limitNum
);
@Select
(
"select `value_f` as valueF, created_time from iot_data.indicator_data where id =#{id} and ts >= #{startTime} and ts <= #{endTime} "
)
//
@Select("select `value_f` as valueF, created_time from iot_data.indicator_data where id =#{id} and ts >= #{startTime} and ts <= #{endTime} ")
List
<
IndicatorData
>
selectDataByequipmentIndexNameAndtimeAndEquipmentNumber
(
@Param
(
"id"
)
String
id
,
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"endTime"
)
String
endTime
);
List
<
IndicatorData
>
selectDataByequipmentIndexNameAndtimeAndEquipmentNumber
(
@Param
(
"id"
)
String
id
,
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"endTime"
)
String
endTime
,
@Param
(
"gatewayIds"
)
List
<
String
>
gatewayIds
);
@Select
(
"select `value`,`value_f`, address, gateway_id from iot_data.indicator_data where ts > NOW()-10m and gateway_id = #{gatewayId}"
)
@Select
(
"select `value`,`value_f`, address, gateway_id from iot_data.indicator_data where ts > NOW()-10m and gateway_id = #{gatewayId}"
)
List
<
IndicatorData
>
selectDataByGatewayIdAndAddress
(
@Param
(
"gatewayId"
)
String
gatewayId
);
List
<
IndicatorData
>
selectDataByGatewayIdAndAddress
(
@Param
(
"gatewayId"
)
String
gatewayId
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
View file @
35384dae
...
@@ -166,6 +166,12 @@
...
@@ -166,6 +166,12 @@
<if
test=
"(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')"
>
<if
test=
"(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')"
>
AND ANALYSIS_OBJ_TYPE = '片区'
AND ANALYSIS_OBJ_TYPE = '片区'
</if>
</if>
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
AND GATEWAY_ID IN
<foreach
collection=
"gatewayIds"
item=
"item"
open=
"("
separator=
","
close=
")"
>
${item}
</foreach>
</if>
</where>
</where>
UNION ALL
UNION ALL
(
(
...
@@ -187,6 +193,12 @@
...
@@ -187,6 +193,12 @@
<if
test=
"(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')"
>
<if
test=
"(stationCode == null or stationCode == '') and (areaCode == null or areaCode == '')"
>
AND ANALYSIS_OBJ_TYPE = '片区'
AND ANALYSIS_OBJ_TYPE = '片区'
</if>
</if>
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
AND GATEWAY_ID IN
<foreach
collection=
"gatewayIds"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
</where>
</where>
)
)
) b ON DATE_FORMAT( b.recDate, "%Y-%m-%d" ) = a.date
) b ON DATE_FORMAT( b.recDate, "%Y-%m-%d" ) = a.date
...
@@ -1616,20 +1628,20 @@
...
@@ -1616,20 +1628,20 @@
<select
id=
"getHourInfo"
resultType=
"java.util.Map"
>
<select
id=
"getHourInfo"
resultType=
"java.util.Map"
>
SELECT
SELECT
DATE_FORMAT( DATE_ADD(( DATE(#{startTime})), INTERVAL @s-1 HOUR ), '%Y-%m-%d %H:%i:%s' ) AS date,
DATE_FORMAT( DATE_ADD(( DATE(#{startTime})), INTERVAL @s-1 HOUR ), '%Y-%m-%d %H:%i:%s' ) AS date,
( @s := @s + 1 )- 1 AS `index`
( @s := @s + 1 )- 1 AS `index`
FROM
FROM
mysql.help_topic,
mysql.help_topic,
( SELECT @s := 1 ) temp
( SELECT @s := 1 ) temp
WHERE
WHERE
TIMESTAMPDIFF( HOUR, #{startTime} , #{endTime}) >= @s-1
TIMESTAMPDIFF( HOUR, #{startTime} , #{endTime}) >= @s-1
</select>
</select>
<select
id=
"getMomentInfo"
resultType=
"java.util.Map"
>
<select
id=
"getMomentInfo"
resultType=
"java.util.Map"
>
SELECT
SELECT
DATE_FORMAT( DATE_ADD(( DATE(#{startTime})), INTERVAL (@s-1)*10 MINUTE ), '%Y-%m-%d %H:%i:%s' ) AS date,
DATE_FORMAT( DATE_ADD(( DATE(#{startTime})), INTERVAL (@s-1)*10 MINUTE ), '%Y-%m-%d %H:%i:%s' ) AS date,
( @s := @s + 1 )- 1 AS `index`
( @s := @s + 1 )- 1 AS `index`
FROM
FROM
mysql.help_topic,
mysql.help_topic,
( SELECT @s := 1 ) temp
( SELECT @s := 1 ) temp
WHERE
WHERE
TIMESTAMPDIFF( MINUTE, #{startTime} , #{endTime})/10 >= @s-1
TIMESTAMPDIFF( MINUTE, #{startTime} , #{endTime})/10 >= @s-1
</select>
</select>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/cluster/IdxBizTableMapper.xml
View file @
35384dae
...
@@ -20,11 +20,16 @@
...
@@ -20,11 +20,16 @@
<if
test=
"conditionColumn != null and conditionColumn != '' and conditionValue != null and conditionValue != ''"
>
<if
test=
"conditionColumn != null and conditionColumn != '' and conditionValue != null and conditionValue != ''"
>
AND ${conditionColumn} = #{conditionValue}
AND ${conditionColumn} = #{conditionValue}
</if>
</if>
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
<if
test=
"gatewayIds != null"
>
AND GATEWAY_ID IN
<if
test=
"gatewayIds.size() > 0"
>
<foreach
collection=
"gatewayIds"
item=
"item"
open=
"("
separator=
","
close=
")"
>
AND GATEWAY_ID IN
${item}
<foreach
collection=
"gatewayIds"
item=
"item"
open=
"("
separator=
","
close=
")"
>
</foreach>
${item}
</foreach>
</if>
<if
test=
"gatewayIds.size() == 0"
>
AND 1 = 2
</if>
</if>
</if>
GROUP BY
GROUP BY
${column}
${column}
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine/IndicatorData.xml
View file @
35384dae
...
@@ -2,4 +2,19 @@
...
@@ -2,4 +2,19 @@
<!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.tdmapper.IndicatorDataMapper"
>
<mapper
namespace=
"com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper"
>
<select
id=
"selectDataByequipmentIndexNameAndtimeAndEquipmentNumber"
resultType=
"com.yeejoin.amos.boot.module.jxiop.biz.entity.IndicatorData"
>
SELECT
`value_f` AS valueF,
created_time
FROM
iot_data.indicator_data
WHERE
id =#{id} AND ts >= #{startTime} AND ts
<
= #{endTime}
<if
test=
"gatewayIds != null and gatewayIds.size() > 0"
>
AND GATEWAY_ID IN
<foreach
collection=
"gatewayIds"
item=
"item"
open=
"("
separator=
","
close=
")"
>
${item}
</foreach>
</if>
</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