Browse Source

优化响应速度

develop
wangsixiang 4 months ago
parent
commit
5337130771
  1. 13
      zc-business/src/main/java/com/zc/business/service/impl/DcPerceivedEventsWarningServiceImpl.java
  2. 3
      zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml

13
zc-business/src/main/java/com/zc/business/service/impl/DcPerceivedEventsWarningServiceImpl.java

@ -1,5 +1,6 @@
package com.zc.business.service.impl;
import cn.hutool.core.date.DateUtil;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StakeMarkUtils;
import com.ruoyi.common.utils.StringUtils;
@ -11,7 +12,11 @@ import com.zc.business.service.IDCPerceivedEventsWarningService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author 王思祥
@ -90,9 +95,9 @@ public class DcPerceivedEventsWarningServiceImpl implements IDCPerceivedEventsWa
public List<HashMap<String,Object>> selectSectionPerceivedEventsList( ) {
DcWarning dcWarning = new DcWarning();
Date nowDate = DateUtils.getNowDate();
dcWarning.setWarningTime(nowDate);
List<HashMap<String,Object>> dcWarnings = perceivedEventsWarningMapper.selectSectionPerceivedEventsList(dcWarning);
return dcWarnings;
dcWarning.setStartTime(DateUtil.beginOfDay(nowDate));
dcWarning.setEndTime(DateUtil.endOfDay(nowDate));
return perceivedEventsWarningMapper.selectSectionPerceivedEventsList(dcWarning);
}
//查询感知数量按照路段进行区分
@Override

3
zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml

@ -132,7 +132,8 @@
FROM dc_road_section AS s
LEFT JOIN ( SELECT mark.section_id, COUNT(1) AS number FROM dc_warning AS w JOIN
dc_stake_mark AS mark ON mark.stake_mark = w.stake_mark AND mark.direction = w.direction
WHERE mark.stake_mark IS NOT NULL AND DATE_FORMAT(w.warning_time, '%Y-%m-%d') = DATE_FORMAT(#{warningTime}, '%Y-%m-%d')
WHERE mark.stake_mark IS NOT NULL AND w.warning_time >= #{startTime}
AND w.warning_time &lt;=#{endTime}
and w.warning_source!=6
GROUP BY mark.section_id ) AS w_count ON s.id = w_count.section_id
ORDER BY number DESC;

Loading…
Cancel
Save