Commit 06a2b24f authored by zhangsen's avatar zhangsen

修改 td

parent 57ae2ad8
...@@ -45,7 +45,7 @@ import java.util.stream.Collectors; ...@@ -45,7 +45,7 @@ import java.util.stream.Collectors;
@RestController @RestController
@Api(tags = "智能分析 - 大屏API") @Api(tags = "智能分析 - 大屏API")
@RequestMapping(value = "/bigScreenAnalyse") @RequestMapping(value = "/feiqiBigScreenAnalyse")
public class BigScreenAnalyseController extends BaseController { public class BigScreenAnalyseController extends BaseController {
@Autowired @Autowired
......
package com.yeejoin.amos.boot.module.jxiop.biz.controller; package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.text.CharSequenceUtil; import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...@@ -52,7 +53,7 @@ import static com.yeejoin.amos.boot.biz.common.utils.DateUtils.DATE_TIME_PATTERN ...@@ -52,7 +53,7 @@ import static com.yeejoin.amos.boot.biz.common.utils.DateUtils.DATE_TIME_PATTERN
@RestController @RestController
@Api(tags = "智能分析 - 大屏API") @Api(tags = "智能分析 - 大屏API")
@RequestMapping(value = "/tdBigScreenAnalyse") @RequestMapping(value = "/bigScreenAnalyse")
public class TDBigScreenAnalyseController extends BaseController { public class TDBigScreenAnalyseController extends BaseController {
@Autowired @Autowired
...@@ -131,9 +132,14 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -131,9 +132,14 @@ public class TDBigScreenAnalyseController extends BaseController {
List<Map<String, String>> dateInfoBy15 = idxBizFanHealthIndexMapper.getDateInfoBy15(); List<Map<String, String>> dateInfoBy15 = idxBizFanHealthIndexMapper.getDateInfoBy15();
List<String> valueList = new ArrayList<>(); List<String> valueList = new ArrayList<>();
String finalStationCode = stationCode; String finalStationCode = stationCode;
List<String> dateList = new ArrayList<>();
dateInfoBy15.forEach(item -> { dateInfoBy15.forEach(item -> {
String healthListInfo = fanHealthIndexMapper.getInfoByDate(areaCode, finalStationCode, item.get("date")); String healthListInfo = fanHealthIndexMapper.getInfoByDate(areaCode, finalStationCode, item.get("date"));
valueList.add(StrUtil.isNotEmpty(healthListInfo) ? healthListInfo : "100"); valueList.add(StrUtil.isNotEmpty(healthListInfo) ? healthListInfo : "100");
String date = item.get("date");
Date date1 = DateUtils.dateAddDays(DateUtil.parse(date, DateUtils.DATE_PATTERN), -1);
String format = DateUtil.format(date1, DateUtils.DATE_PATTERN);
dateList.add(format);
}); });
...@@ -141,7 +147,7 @@ public class TDBigScreenAnalyseController extends BaseController { ...@@ -141,7 +147,7 @@ public class TDBigScreenAnalyseController extends BaseController {
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", dateInfoBy15); resultMap.put("axisData", dateList);
resultMap.put("seriesData", arrayList); resultMap.put("seriesData", arrayList);
return ResponseHelper.buildResponse(resultMap); return ResponseHelper.buildResponse(resultMap);
} }
......
...@@ -343,7 +343,7 @@ ...@@ -343,7 +343,7 @@
<where> <where>
rec_date = concat(#{date}, ' 00:00:00') rec_date = concat(#{date}, ' 00:00:00')
<if test="areaCode != null and areaCode != ''"> <if test="areaCode != null and areaCode != ''">
AND area like concat('%', #{areaCode}, '%') AND area = concat(#{areaCode}, '区域')
AND analysis_obj_type = '片区' AND analysis_obj_type = '片区'
</if> </if>
<if test="stationCode != null and stationCode != ''"> <if test="stationCode != null and stationCode != ''">
...@@ -364,7 +364,7 @@ ...@@ -364,7 +364,7 @@
<where> <where>
rec_date = concat(#{date}, ' 00:00:00') rec_date = concat(#{date}, ' 00:00:00')
<if test="areaCode != null and areaCode != ''"> <if test="areaCode != null and areaCode != ''">
AND area like concat('%', #{areaCode}, '%') AND area = concat(#{areaCode}, '区域')
AND analysis_obj_type = '片区' AND analysis_obj_type = '片区'
</if> </if>
<if test="stationCode != null and stationCode != ''"> <if test="stationCode != null and stationCode != ''">
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<select id="getHealthInfoByArea" resultType="java.util.Map"> <select id="getHealthInfoByArea" resultType="java.util.Map">
select area as area, select area as area,
ceil(avg(a.avghealthindex)) as healthindex ceil(avg(a.avghealthindex)) as healthIndex
from ( from (
select avg(health_index) as avghealthindex, select avg(health_index) as avghealthindex,
area area
......
...@@ -290,27 +290,27 @@ ...@@ -290,27 +290,27 @@
analysis_data.fan_warning_record analysis_data.fan_warning_record
) a ) a
<where> <where>
(a.disposotionstate = '未处置') or (a.disposotionstate = '已处置' and a.disposotiondate >( now()- 3d - 8h )) (a.disposotionstate = '未处置') or (a.disposotionstate = '已处置' and a.ts >( now()- 3d - 8h ))
<if test="arae != '' and arae != null"> <if test="arae != '' and arae != null">
and a.arae like concat('%', #{arae}, '%') and a.arae = concat(#{area}, '区域')
</if> </if>
<if test="station != '' and station != null"> <if test="station != '' and station != null">
and a.station = #{station} and a.station = #{station}
</if> </if>
<if test="stationtype != '' and stationtype != null"> <if test="stationType != '' and stationType != null">
and a.stationtype = #{stationtype} and a.stationtype = #{stationType}
</if> </if>
<if test="warningname != '' and warningname != null"> <if test="warningName != '' and warningName != null">
and a.warningname = #{warningname} and a.warning_name = #{warningName}
</if> </if>
<if test="stationid != '' and stationid != null"> <if test="stationId != '' and stationId != null">
and a.gateway_id = #{stationid} and a.gateway_id = #{stationId}
</if> </if>
<if test="startdate != '' and startdate != null"> <if test="startDate != '' and startDate != null">
and a.recdate >= concat(#{startdate}, ' 00:00:00') and a.recdate >= concat(#{startDate}, ' 00:00:00')
</if> </if>
<if test="enddate != '' and enddate != null"> <if test="endDate != '' and endDate != null">
and concat(#{enddate}, ' 23:59:59') >= a.recdate and concat(#{endDate}, ' 23:59:59') >= a.recdate
</if> </if>
</where> </where>
order by sort desc, recdate desc order by sort desc, recdate desc
...@@ -352,27 +352,27 @@ ...@@ -352,27 +352,27 @@
analysis_data.fan_warning_record analysis_data.fan_warning_record
) a ) a
<where> <where>
a.disposotionstate = '未处置' or (a.disposotionstate = '已处置' and a.disposotiondate > ( now() - 3D - 8h )) a.disposotionstate = '未处置' or (a.disposotionstate = '已处置' and a.ts > ( now() - 3D - 8h ))
<if test="arae != '' and arae != null"> <if test="arae != '' and arae != null">
and a.arae like concat('%', #{arae}, '%') and a.arae = concat(#{area}, '区域')
</if> </if>
<if test="station != '' and station != null"> <if test="station != '' and station != null">
and a.station = #{station} and a.station = #{station}
</if> </if>
<if test="stationtype != '' and stationtype != null"> <if test="stationType != '' and stationType != null">
and a.stationtype = #{stationtype} and a.stationtype = #{stationType}
</if> </if>
<if test="warningname != '' and warningname != null"> <if test="warningName != '' and warningName != null">
and a.warningname = #{warningname} and a.warning_name = #{warningName}
</if> </if>
<if test="stationid != '' and stationid != null"> <if test="stationId != '' and stationId != null">
and a.gateway_id = #{stationid} and a.gateway_id = #{stationId}
</if> </if>
<if test="startdate != '' and startdate != null"> <if test="startDate != '' and startDate != null">
and a.recdate >= concat(#{startdate}, ' 00:00:00') and a.recdate >= concat(#{startDate}, ' 00:00:00')
</if> </if>
<if test="enddate != '' and enddate != null"> <if test="endDate != '' and endDate != null">
and concat(#{enddate}, ' 23:59:59') >= a.recdate and concat(#{endDate}, ' 23:59:59') >= a.recdate
</if> </if>
</where>) b </where>) b
</select> </select>
......
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
count(1) as num count(1) as num
from analysis_data.pv_warning_record a from analysis_data.pv_warning_record a
where (a.disposotion_state = '未处置') where (a.disposotion_state = '未处置')
or (a.disposotion_state = '已处置' and a.disposotion_date >(now()-3d -8h )) or (a.disposotion_state = '已处置' and a.ts >(now()-3d -8h ))
group by arae, group by arae,
warning_name warning_name
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment