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
1e423742
Commit
1e423742
authored
Nov 10, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Plain Diff
解决冲突
parents
9c5305f3
04e10a09
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
11 deletions
+58
-11
TDBigScreenAnalyseController.java
...le/jxiop/biz/controller/TDBigScreenAnalyseController.java
+21
-6
FanWaringRecordMapper.java
...oot/module/jxiop/biz/tdMapper2/FanWaringRecordMapper.java
+1
-0
FanHealthIndex.xml
...iz/src/main/resources/mapper/tdengine2/FanHealthIndex.xml
+2
-2
FanWarningRecord.xml
.../src/main/resources/mapper/tdengine2/FanWarningRecord.xml
+34
-3
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 @
1e423742
...
...
@@ -127,14 +127,18 @@ public class TDBigScreenAnalyseController extends BaseController {
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationCode
);
stationCode
=
stationBasic
.
getFanGatewayId
();
}
if
(
StrUtil
.
isNotEmpty
(
areaCode
))
{
areaCode
=
"%"
+
areaCode
+
"%"
;
}
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
Map
<
String
,
String
>>
dateInfoBy15
=
idxBizFanHealthIndexMapper
.
getDateInfoBy15
();
List
<
String
>
valueList
=
new
ArrayList
<>();
String
finalStationCode
=
stationCode
;
List
<
String
>
dateList
=
new
ArrayList
<>();
String
finalAreaCode
=
areaCode
;
dateInfoBy15
.
forEach
(
item
->
{
String
healthListInfo
=
fanHealthIndexMapper
.
getInfoByDate
(
a
reaCode
,
finalStationCode
,
item
.
get
(
"date"
));
String
healthListInfo
=
fanHealthIndexMapper
.
getInfoByDate
(
finalA
reaCode
,
finalStationCode
,
item
.
get
(
"date"
));
valueList
.
add
(
CharSequenceUtil
.
isNotEmpty
(
healthListInfo
)
?
healthListInfo
.
replace
(
".0"
,
""
)
:
"100"
);
String
date
=
item
.
get
(
"date"
);
Date
date1
=
DateUtils
.
dateAddDays
(
DateUtil
.
parse
(
date
,
DateUtils
.
DATE_PATTERN
),
-
1
);
...
...
@@ -277,6 +281,8 @@ public class TDBigScreenAnalyseController extends BaseController {
StationBasic
stationBasic
=
stationBasicMapper
.
selectById
(
stationId
);
stationId
=
stationBasic
.
getFanGatewayId
();
}
if
(
arae
!=
null
)
{
arae
=
"%"
+
arae
+
"%"
;
}
Integer
count
=
fanWaringRecordMapper
.
getEquipWarningInfoByPageCount
(
arae
,
station
,
stationType
,
warningName
,
stationId
,
startDate
,
endDate
);
// List<IdxBizFanWarningRecord> idxBizFanWarningRecordIPage = idxBizFanWarningRecordMapper.getEquipWarningInfoByPage(arae, station, stationType, (current - 1) * size, size, warningName, stationId, startDate, endDate);
List
<
FanWarningRecord
>
idxBizFanWarningRecordIPage
=
fanWaringRecordMapper
.
getEquipWarningInfoByPage
(
arae
,
station
,
stationType
,
(
current
-
1
)
*
size
,
size
,
warningName
,
stationId
,
startDate
,
endDate
);
...
...
@@ -291,19 +297,23 @@ public class TDBigScreenAnalyseController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"各场站设备预警情况(条) "
,
notes
=
"各场站设备预警情况(条) "
)
@GetMapping
(
value
=
"/getAllEquipAlarmInfoByStation"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getAllEquipAlarmInfoByStation
()
{
public
ResponseModel
<
Map
<
String
,
Object
>>
getAllEquipAlarmInfoByStation
(
String
area
)
{
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
allEquipAlarmInfo
=
idxBizFanHealthIndexMapper
.
getAllEquipAlarmInfoByStation
();
// List<Map<String, Object>> allEquipAlarmInfo = idxBizFanHealthIndexMapper.getAllEquipAlarmInfoByStation();
if
(
StrUtil
.
isNotEmpty
(
area
)
){
area
=
"%"
+
area
+
"%"
;
}
List
<
Map
<
String
,
Object
>>
allEquipAlarmInfo
=
fanWaringRecordMapper
.
getAllEquipAlarmInfoByStation
(
area
);
HashMap
<
String
,
Integer
>
wxMap
=
new
HashMap
<>();
HashMap
<
String
,
Integer
>
zyMap
=
new
HashMap
<>();
HashMap
<
String
,
Integer
>
jgMap
=
new
HashMap
<>();
LinkedHashSet
<
String
>
list
=
new
LinkedHashSet
<>();
allEquipAlarmInfo
.
forEach
(
item
->
{
if
(
"危险"
.
equals
(
item
.
get
(
"warning
N
ame"
)))
{
if
(
"危险"
.
equals
(
item
.
get
(
"warning
n
ame"
)))
{
wxMap
.
put
(
item
.
get
(
"station"
).
toString
(),
Integer
.
parseInt
(
item
.
get
(
"num"
).
toString
()));
}
else
if
(
"注意"
.
equals
(
item
.
get
(
"warning
N
ame"
)))
{
}
else
if
(
"注意"
.
equals
(
item
.
get
(
"warning
n
ame"
)))
{
zyMap
.
put
(
item
.
get
(
"station"
).
toString
(),
Integer
.
parseInt
(
item
.
get
(
"num"
).
toString
()));
}
else
if
(
"警告"
.
equals
(
item
.
get
(
"warning
N
ame"
)))
{
}
else
if
(
"警告"
.
equals
(
item
.
get
(
"warning
n
ame"
)))
{
jgMap
.
put
(
item
.
get
(
"station"
).
toString
(),
Integer
.
parseInt
(
item
.
get
(
"num"
).
toString
()));
}
list
.
add
(
item
.
get
(
"station"
).
toString
());
...
...
@@ -415,6 +425,11 @@ public class TDBigScreenAnalyseController extends BaseController {
stationType
=
"光伏"
;
}
}
if
(
areaCode
!=
null
){
areaCode
=
"%"
+
areaCode
+
"%"
;
}
allEquipAlarmInfo
=
fanWaringRecordMapper
.
getAllEquipAlarmInfoAnalysisByArea
(
areaCode
,
stationType
);
List
<
Integer
>
wxList
=
new
ArrayList
<>();
List
<
Integer
>
zyList
=
new
ArrayList
<>();
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/tdMapper2/FanWaringRecordMapper.java
View file @
1e423742
...
...
@@ -46,4 +46,5 @@ public interface FanWaringRecordMapper extends BaseMapper<FanWarningRecord> {
List
<
Map
<
String
,
Object
>>
getAllEquipAlarmInfoAnalysisByArea
(
String
araeCode
,
String
stationType
);
List
<
Map
<
String
,
Object
>>
getAllEquipAlarmInfoByStation
(
String
area
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/FanHealthIndex.xml
View file @
1e423742
...
...
@@ -343,7 +343,7 @@
<where>
rec_date = concat(#{date}, ' 00:00:00')
<if
test=
"areaCode != null and areaCode != ''"
>
AND area
= concat(#{areaCode}, '区域')
AND area
like #{areaCode}
AND analysis_obj_type = '片区'
</if>
<if
test=
"stationCode != null and stationCode != ''"
>
...
...
@@ -364,7 +364,7 @@
<where>
rec_date = concat(#{date}, ' 00:00:00')
<if
test=
"areaCode != null and areaCode != ''"
>
AND area
= concat(#{areaCode}, '区域')
AND area
like #{areaCode}
AND analysis_obj_type = '片区'
</if>
<if
test=
"stationCode != null and stationCode != ''"
>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/FanWarningRecord.xml
View file @
1e423742
...
...
@@ -294,7 +294,7 @@
<where>
( (a.disposotionstate = '未处置') or (a.disposotionstate = '已处置' and a.ts >( now()- 3d - 8h )))
<if
test=
"arae != '' and arae != null"
>
and a.arae
= concat(#{area}, '区域')
and a.arae
like #{arae}
</if>
<if
test=
"station != '' and station != null"
>
and a.station = #{station}
...
...
@@ -359,7 +359,7 @@
( a.disposotionState = '未处置'
or (a.disposotionState = '已处置' and a.ts > ( now() - 3D - 8h )))
<if
test=
"arae != '' and arae != null"
>
and a.arae
= concat(#{area}, '区域')
and a.arae
like #{arae}
</if>
<if
test=
"station != '' and station != null"
>
and a.station = #{station}
...
...
@@ -492,9 +492,40 @@
and b.stationType = #{stationType}
</if>
<if
test=
"araeCode != '' and araeCode != null"
>
and b.arae
=
#{araeCode}
and b.arae
like
#{araeCode}
</if>
</where>
order by b.`sort` ASC
</select>
<select
id=
"getAllEquipAlarmInfoByStation"
resultType=
"map"
>
select * from
( select arae as area,
warning_name as warningname,
count(1) as num,
station
from analysis_data.fan_warning_record a
where (a.disposotion_state = '未处置')
or (a.disposotion_state = '已处置' and a.ts >(now()-3d -8h ))
group by arae,
warning_name,station
union all
select arae as area,
warning_name as warningname,
count(1) as num,
station
from analysis_data.pv_warning_record a
where (a.disposotion_state = '未处置')
or (a.disposotion_state = '已处置' and a.ts >(now()-3d -8h ))
group by arae,
warning_name,station ) b
<where>
<if
test=
"area != null and area != ''"
>
area like #{area}
</if>
</where>
</select>
</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