终端异常统计接口响应慢修复

This commit is contained in:
zhuxinyu
2023-04-19 15:41:23 +08:00
parent a311e6ecb1
commit 592615691c
3 changed files with 28 additions and 11 deletions

View File

@@ -5,14 +5,12 @@
<select id="getTopMsg" resultType="com.njcn.device.pq.pojo.po.TopMsgPO">
SELECT
ptm.Time_Id AS time,
IFNULL(COUNT(ptm.Dev_Id),3.14159)AS deviceAbnormalNum,
GROUP_CONCAT(sdd.Name) AS lineGrade
IFNULL(COUNT(ptm.Dev_Id),3.14159)AS deviceAbnormalNum
FROM pq_line line
INNER JOIN pq_line vol ON line.pid=vol.id
INNER JOIN pq_line device ON vol.pid=device.id
LEFT JOIN pqs_top_msg ptm ON ptm.Dev_Id = device.Id
LEFT JOIN pq_line_detail pld ON pld.Id=line.Id
LEFT JOIN sys_dict_data sdd ON sdd.Id=pld.Line_Grade
WHERE
ptm.State=1
AND
@@ -21,6 +19,7 @@
AND pld.Line_Grade=#{lineGrade}
</if>
GROUP BY ptm.Time_Id
</select>
<select id="getTopMsgDetail" resultType="com.njcn.device.pq.pojo.po.TopMsgPO">

View File

@@ -392,8 +392,12 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
@Override
public Page<TopMsgPO> dailyDeviceAbnormalStatistics(PqsParam param) {
long start = System.currentTimeMillis();
Page topMsg = topMsgMapper.getTopMsg(new Page(param.getPageNum(), param.getPageSize()), param.getLineGrade(), DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime())),
DateUtil.endOfDay(DateUtil.parse(param.getSearchEndTime())));
long end = System.currentTimeMillis();
System.out.println("====================================");
System.out.println(end-start);
return topMsg;
}