Commit 06a2b24f authored by zhangsen's avatar zhangsen

修改 td

parent 57ae2ad8
......@@ -45,7 +45,7 @@ import java.util.stream.Collectors;
@RestController
@Api(tags = "智能分析 - 大屏API")
@RequestMapping(value = "/bigScreenAnalyse")
@RequestMapping(value = "/feiqiBigScreenAnalyse")
public class BigScreenAnalyseController extends BaseController {
@Autowired
......
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.util.StrUtil;
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
@RestController
@Api(tags = "智能分析 - 大屏API")
@RequestMapping(value = "/tdBigScreenAnalyse")
@RequestMapping(value = "/bigScreenAnalyse")
public class TDBigScreenAnalyseController extends BaseController {
@Autowired
......@@ -131,9 +132,14 @@ public class TDBigScreenAnalyseController extends BaseController {
List<Map<String, String>> dateInfoBy15 = idxBizFanHealthIndexMapper.getDateInfoBy15();
List<String> valueList = new ArrayList<>();
String finalStationCode = stationCode;
List<String> dateList = new ArrayList<>();
dateInfoBy15.forEach(item -> {
String healthListInfo = fanHealthIndexMapper.getInfoByDate(areaCode, finalStationCode, item.get("date"));
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 {
HashMap<String, Object> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("data", valueList);
arrayList.add(stringStringHashMap);
resultMap.put("axisData", dateInfoBy15);
resultMap.put("axisData", dateList);
resultMap.put("seriesData", arrayList);
return ResponseHelper.buildResponse(resultMap);
}
......
......@@ -343,7 +343,7 @@
<where>
rec_date = concat(#{date}, ' 00:00:00')
<if test="areaCode != null and areaCode != ''">
AND area like concat('%', #{areaCode}, '%')
AND area = concat(#{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 like concat('%', #{areaCode}, '%')
AND area = concat(#{areaCode}, '区域')
AND analysis_obj_type = '片区'
</if>
<if test="stationCode != null and stationCode != ''">
......
......@@ -4,7 +4,7 @@
<select id="getHealthInfoByArea" resultType="java.util.Map">
select area as area,
ceil(avg(a.avghealthindex)) as healthindex
ceil(avg(a.avghealthindex)) as healthIndex
from (
select avg(health_index) as avghealthindex,
area
......
......@@ -290,27 +290,27 @@
analysis_data.fan_warning_record
) a
<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">
and a.arae like concat('%', #{arae}, '%')
and a.arae = concat(#{area}, '区域')
</if>
<if test="station != '' and station != null">
and a.station = #{station}
</if>
<if test="stationtype != '' and stationtype != null">
and a.stationtype = #{stationtype}
<if test="stationType != '' and stationType != null">
and a.stationtype = #{stationType}
</if>
<if test="warningname != '' and warningname != null">
and a.warningname = #{warningname}
<if test="warningName != '' and warningName != null">
and a.warning_name = #{warningName}
</if>
<if test="stationid != '' and stationid != null">
and a.gateway_id = #{stationid}
<if test="stationId != '' and stationId != null">
and a.gateway_id = #{stationId}
</if>
<if test="startdate != '' and startdate != null">
and a.recdate >= concat(#{startdate}, ' 00:00:00')
<if test="startDate != '' and startDate != null">
and a.recdate >= concat(#{startDate}, ' 00:00:00')
</if>
<if test="enddate != '' and enddate != null">
and concat(#{enddate}, ' 23:59:59') >= a.recdate
<if test="endDate != '' and endDate != null">
and concat(#{endDate}, ' 23:59:59') >= a.recdate
</if>
</where>
order by sort desc, recdate desc
......@@ -352,27 +352,27 @@
analysis_data.fan_warning_record
) a
<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">
and a.arae like concat('%', #{arae}, '%')
and a.arae = concat(#{area}, '区域')
</if>
<if test="station != '' and station != null">
and a.station = #{station}
</if>
<if test="stationtype != '' and stationtype != null">
and a.stationtype = #{stationtype}
<if test="stationType != '' and stationType != null">
and a.stationtype = #{stationType}
</if>
<if test="warningname != '' and warningname != null">
and a.warningname = #{warningname}
<if test="warningName != '' and warningName != null">
and a.warning_name = #{warningName}
</if>
<if test="stationid != '' and stationid != null">
and a.gateway_id = #{stationid}
<if test="stationId != '' and stationId != null">
and a.gateway_id = #{stationId}
</if>
<if test="startdate != '' and startdate != null">
and a.recdate >= concat(#{startdate}, ' 00:00:00')
<if test="startDate != '' and startDate != null">
and a.recdate >= concat(#{startDate}, ' 00:00:00')
</if>
<if test="enddate != '' and enddate != null">
and concat(#{enddate}, ' 23:59:59') >= a.recdate
<if test="endDate != '' and endDate != null">
and concat(#{endDate}, ' 23:59:59') >= a.recdate
</if>
</where>) b
</select>
......
......@@ -256,7 +256,7 @@
count(1) as num
from analysis_data.pv_warning_record a
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,
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