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
a26efcfc
Commit
a26efcfc
authored
Nov 09, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 td
parent
4e98bb8f
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
67 additions
and
6 deletions
+67
-6
TDBigScreenAnalyseController.java
...le/jxiop/biz/controller/TDBigScreenAnalyseController.java
+8
-6
IdxBizFanHealthIndexMapper.java
.../module/jxiop/biz/mapper2/IdxBizFanHealthIndexMapper.java
+1
-0
FanHealthIndexMapper.java
...boot/module/jxiop/biz/tdMapper2/FanHealthIndexMapper.java
+1
-0
IdxBizFanHealthIndexMapper.xml
...n/resources/mapper/cluster/IdxBizFanHealthIndexMapper.xml
+11
-0
FanHealthIndex.xml
...iz/src/main/resources/mapper/tdengine2/FanHealthIndex.xml
+46
-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 @
a26efcfc
...
...
@@ -129,18 +129,20 @@ public class TDBigScreenAnalyseController extends BaseController {
}
HashMap
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
healthListInfo
=
idxBizFanHealthIndexMapper
.
getHealthListInfo
(
areaCode
,
stationCode
);
List
<
String
>
time
=
new
ArrayList
<>();
List
<
Map
<
String
,
String
>>
dateInfoBy15
=
idxBizFanHealthIndexMapper
.
getDateInfoBy15
();
List
<
String
>
valueList
=
new
ArrayList
<>();
healthListInfo
.
forEach
(
item
->
{
time
.
add
(
item
.
get
(
"date"
).
toString
());
valueList
.
add
(
item
.
get
(
"avgHealthIndex"
).
toString
().
replace
(
".0"
,
""
));
String
finalStationCode
=
stationCode
;
dateInfoBy15
.
forEach
(
item
->
{
String
healthListInfo
=
fanHealthIndexMapper
.
getInfoByDate
(
areaCode
,
finalStationCode
,
item
.
get
(
"date"
));
valueList
.
add
(
StrUtil
.
isNotEmpty
(
healthListInfo
)
?
healthListInfo
:
"100"
);
});
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
(
"axisData"
,
dateInfoBy15
);
resultMap
.
put
(
"seriesData"
,
arrayList
);
return
ResponseHelper
.
buildResponse
(
resultMap
);
}
...
...
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 @
a26efcfc
...
...
@@ -28,6 +28,7 @@ public interface IdxBizFanHealthIndexMapper extends BaseMapper<IdxBizFanHealthIn
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
);
...
...
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 @
a26efcfc
...
...
@@ -87,4 +87,5 @@ public interface FanHealthIndexMapper extends BaseMapper<FanHealthIndex> {
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 @
a26efcfc
...
...
@@ -142,6 +142,7 @@
</select>
<select
id=
"getHealthListInfo"
resultType=
"java.util.Map"
>
SELECT
CEILING(IFNULL( AVG( HEALTH_INDEX ), 100 )) AS avgHealthIndex,
...
...
@@ -1667,4 +1668,14 @@
) a
</select>
<select
id=
"getDateInfoBy15"
resultType=
"java.util.Map"
>
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
</select>
</mapper>
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/FanHealthIndex.xml
View file @
a26efcfc
...
...
@@ -334,4 +334,50 @@
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>
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