Commit ccaceaa0 authored by duanruiming's avatar duanruiming

[add] 干线列表查询优化

parent 310e5878
...@@ -8,16 +8,14 @@ import net.wanji.common.framework.rest.JsonViewObject; ...@@ -8,16 +8,14 @@ import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.databus.bo.CrossIdBO; import net.wanji.databus.bo.CrossIdBO;
import net.wanji.databus.po.CrossDataRealtimePO; import net.wanji.databus.po.CrossDataRealtimePO;
import net.wanji.databus.po.CrossDirDataRealtimePO; import net.wanji.databus.po.CrossDirDataRealtimePO;
import net.wanji.databus.po.TBaseCrossInfo;
import net.wanji.opt.dto.strategy.AddOrUpdateSceneDTO; import net.wanji.opt.dto.strategy.AddOrUpdateSceneDTO;
import net.wanji.opt.service.CrossIndexService; import net.wanji.opt.service.CrossIndexService;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import java.util.Date; import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
...@@ -32,6 +30,17 @@ public class CrossIndexController { ...@@ -32,6 +30,17 @@ public class CrossIndexController {
@Resource @Resource
private CrossIndexService crossIndexService; private CrossIndexService crossIndexService;
@ApiOperation(value = "路口信息查询", notes = "路口信息查询", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@GetMapping(value = "/crossInfoList")
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = TBaseCrossInfo.class),
})
public JsonViewObject crossInfoList() {
List<TBaseCrossInfo> baseCrossInfoPOS = crossIndexService.crossInfoList();
return JsonViewObject.newInstance().success(baseCrossInfoPOS);
}
@ApiOperation(value = "路口方向指标", notes = "路口方向指标", response = JsonViewObject.class, @ApiOperation(value = "路口方向指标", notes = "路口方向指标", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/crossDirIndex", @PostMapping(value = "/crossDirIndex",
......
package net.wanji.opt.controller.signalopt; package net.wanji.opt.controller.signalopt;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.opt.dto.strategy.AddOrUpdateSceneDTO;
import net.wanji.opt.service.signalopt.GreenBeltInfoService;
import net.wanji.opt.vo.GreenBeltFlowStopTimeVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.ws.rs.core.MediaType;
import java.util.List;
/** /**
* @author duanruiming * @author duanruiming
* @date 2024/11/28 16:03 * @date 2024/11/28 16:03
*/ */
@Api(value = "CrossIndexController", description = "路口指标控制器") @Api(value = "CrossIndexController", description = "路口指标控制器")
@RequestMapping("/crossIndex") @RequestMapping("/greenBelt")
@RestController @RestController
public class GreenBeltController { public class GreenBeltController {
@Resource
private GreenBeltInfoService greenBeltInfoService;
@ApiOperation(value = "绿波协调方向流量停车次数", notes = "绿波协调方向流量停车次数", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@GetMapping(value = "/greenBeltCrossDetailHist")
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = AddOrUpdateSceneDTO.class),
})
public JsonViewObject greenBeltCrossDetailHist(Integer greenId) {
List<GreenBeltFlowStopTimeVO> greenBeltFlowStopTimeVOS = greenBeltInfoService.greenBeltCrossDetailHist(greenId);
return JsonViewObject.newInstance().success(greenBeltFlowStopTimeVOS);
}
} }
...@@ -3,7 +3,9 @@ package net.wanji.opt.service; ...@@ -3,7 +3,9 @@ package net.wanji.opt.service;
import net.wanji.databus.bo.CrossIdBO; import net.wanji.databus.bo.CrossIdBO;
import net.wanji.databus.po.CrossDataRealtimePO; import net.wanji.databus.po.CrossDataRealtimePO;
import net.wanji.databus.po.CrossDirDataRealtimePO; import net.wanji.databus.po.CrossDirDataRealtimePO;
import net.wanji.databus.po.TBaseCrossInfo;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
...@@ -12,5 +14,8 @@ import java.util.Map; ...@@ -12,5 +14,8 @@ import java.util.Map;
*/ */
public interface CrossIndexService { public interface CrossIndexService {
Map<Integer, CrossDirDataRealtimePO> crossDirIndex(CrossIdBO crossIdBO); Map<Integer, CrossDirDataRealtimePO> crossDirIndex(CrossIdBO crossIdBO);
CrossDataRealtimePO crossIndex(CrossIdBO crossIdBO); CrossDataRealtimePO crossIndex(CrossIdBO crossIdBO);
List<TBaseCrossInfo> crossInfoList();
} }
package net.wanji.opt.service;
import net.wanji.opt.vo.GreenBeltInfoVO;
/**
* @author duanruiming
* @date 2024/11/19 18:07
*/
public interface GreenBeltInfoService {
/**
* 数据转换
* @param message
* @return
* @throws Exception
*/
GreenBeltInfoVO convertData(String message) throws Exception;
/**
* 存储
* @param infoVO
* @throws Exception
*/
void save(GreenBeltInfoVO infoVO) throws Exception;
}
package net.wanji.opt.service.impl; package net.wanji.opt.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.wanji.databus.bo.CrossIdBO; import net.wanji.databus.bo.CrossIdBO;
import net.wanji.databus.dao.mapper.BaseCrossInfoMapper;
import net.wanji.databus.dao.mapper.CrossDataRealtimeMapper; import net.wanji.databus.dao.mapper.CrossDataRealtimeMapper;
import net.wanji.databus.dao.mapper.CrossDirDataRealtimeMapper; import net.wanji.databus.dao.mapper.CrossDirDataRealtimeMapper;
import net.wanji.databus.po.CrossDataRealtimePO; import net.wanji.databus.po.CrossDataRealtimePO;
import net.wanji.databus.po.CrossDirDataRealtimePO; import net.wanji.databus.po.CrossDirDataRealtimePO;
import net.wanji.databus.po.TBaseCrossInfo;
import net.wanji.opt.service.CrossIndexService; import net.wanji.opt.service.CrossIndexService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
...@@ -27,6 +30,8 @@ public class CrossIndexServiceImpl implements CrossIndexService { ...@@ -27,6 +30,8 @@ public class CrossIndexServiceImpl implements CrossIndexService {
private CrossDirDataRealtimeMapper crossDirDataRealtimeMapper; private CrossDirDataRealtimeMapper crossDirDataRealtimeMapper;
@Resource @Resource
private CrossDataRealtimeMapper crossDataRealtimeMapper; private CrossDataRealtimeMapper crossDataRealtimeMapper;
@Resource
private BaseCrossInfoMapper baseCrossInfoMapper;
@Override @Override
public Map<Integer, CrossDirDataRealtimePO> crossDirIndex(CrossIdBO crossIdBO) { public Map<Integer, CrossDirDataRealtimePO> crossDirIndex(CrossIdBO crossIdBO) {
...@@ -46,4 +51,13 @@ public class CrossIndexServiceImpl implements CrossIndexService { ...@@ -46,4 +51,13 @@ public class CrossIndexServiceImpl implements CrossIndexService {
CrossDataRealtimePO crossDataRealtimePO = crossDataRealtimeMapper.selectByCrossId(crossIdBO.getCrossId()); CrossDataRealtimePO crossDataRealtimePO = crossDataRealtimeMapper.selectByCrossId(crossIdBO.getCrossId());
return crossDataRealtimePO; return crossDataRealtimePO;
} }
@Override
public List<TBaseCrossInfo> crossInfoList() {
LambdaQueryWrapper<TBaseCrossInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TBaseCrossInfo::getIsSignal, 1);
List<TBaseCrossInfo> baseCrossInfoPOS = baseCrossInfoMapper.selectList(queryWrapper);
return baseCrossInfoPOS;
}
} }
...@@ -490,7 +490,7 @@ public class RunningEvaluateServiceImpl implements RunningEvaluateService { ...@@ -490,7 +490,7 @@ public class RunningEvaluateServiceImpl implements RunningEvaluateService {
crossMetrics.setDelayTime(delayTimeSum / size); crossMetrics.setDelayTime(delayTimeSum / size);
crossMetrics.setEffusionRate(effusionRateSum / size); crossMetrics.setEffusionRate(effusionRateSum / size);
crossMetrics.setEmptyPhase(emptyPhaseSum); crossMetrics.setEmptyPhase(emptyPhaseSum);
Date currentDate = dtoList.get(0).getStartTime(); Date currentDate = dtoList.get(dtoList.size() - 1).getStartTime();
Calendar instance = Calendar.getInstance(); Calendar instance = Calendar.getInstance();
instance.setTime(currentDate); instance.setTime(currentDate);
instance.set(Calendar.HOUR_OF_DAY, Integer.parseInt(section.substring(0, 2))); instance.set(Calendar.HOUR_OF_DAY, Integer.parseInt(section.substring(0, 2)));
......
...@@ -208,11 +208,13 @@ public class TrendServiceImpl implements TrendService { ...@@ -208,11 +208,13 @@ public class TrendServiceImpl implements TrendService {
Double speed = 0.0; Double speed = 0.0;
Double trafficIndex = 1.0; Double trafficIndex = 1.0;
int travelTime = 0; int travelTime = 0;
Integer stopTimes = 0;
GreenwaveListVO wDirVo = new GreenwaveListVO(); GreenwaveListVO wDirVo = new GreenwaveListVO();
for (GreenwaveListVO greenwaveListVO : value) { for (GreenwaveListVO greenwaveListVO : value) {
speed += greenwaveListVO.getSpeed() == null ? 0.0 : greenwaveListVO.getSpeed(); speed += greenwaveListVO.getSpeed() == null ? 0.0 : greenwaveListVO.getSpeed();
trafficIndex += greenwaveListVO.getTrafficIndex() == null ? 0.0 : greenwaveListVO.getTrafficIndex(); trafficIndex += greenwaveListVO.getTrafficIndex() == null ? 0.0 : greenwaveListVO.getTrafficIndex();
travelTime += greenwaveListVO.getTravelTime(); travelTime += greenwaveListVO.getTravelTime();
stopTimes += greenwaveListVO.getStopTimes() == null ? 0 : greenwaveListVO.getStopTimes();
wDirVo.setId(greenId); wDirVo.setId(greenId);
wDirVo.setName(greenwaveListVO.getName()); wDirVo.setName(greenwaveListVO.getName());
wDirVo.setWkt(greenwaveListVO.getWkt()); wDirVo.setWkt(greenwaveListVO.getWkt());
...@@ -222,6 +224,7 @@ public class TrendServiceImpl implements TrendService { ...@@ -222,6 +224,7 @@ public class TrendServiceImpl implements TrendService {
wDirVo.setInfoStatus(greenwaveListVO.getInfoStatus()); wDirVo.setInfoStatus(greenwaveListVO.getInfoStatus());
} }
wDirVo.setSpeed(speed / 2); wDirVo.setSpeed(speed / 2);
wDirVo.setStopTimes(stopTimes / 2);
wDirVo.setTrafficIndex(trafficIndex / 2 < 1 ? 1 : trafficIndex / 2); wDirVo.setTrafficIndex(trafficIndex / 2 < 1 ? 1 : trafficIndex / 2);
wDirVo.setTravelTime(travelTime / 2); wDirVo.setTravelTime(travelTime / 2);
greenwaveListVOList.add(wDirVo); greenwaveListVOList.add(wDirVo);
...@@ -1756,7 +1759,7 @@ public class TrendServiceImpl implements TrendService { ...@@ -1756,7 +1759,7 @@ public class TrendServiceImpl implements TrendService {
AbnormalCrossListVO abnormalCrossListVO = new AbnormalCrossListVO(); AbnormalCrossListVO abnormalCrossListVO = new AbnormalCrossListVO();
// 如果路口编号为空,态势监测页面默认展示拥堵指数第一的路口排队长度数据 // 如果路口编号为空,态势监测页面默认展示拥堵指数第一的路口排队长度数据
if (StringUtils.isBlank(crossId)) { if (StringUtils.isBlank(crossId)) {
Optional<AbnormalCrossListVO> max = signalCrossRealTimeList.stream().max(Comparator.comparingDouble(AbnormalCrossListVO::getCongestionIndex)); Optional<AbnormalCrossListVO> max = signalCrossRealTimeList.stream().max(Comparator.comparingDouble(AbnormalCrossListVO::getTrafficIndex));
if (max.isPresent()) { if (max.isPresent()) {
abnormalCrossListVO = max.get(); abnormalCrossListVO = max.get();
} }
...@@ -1769,7 +1772,7 @@ public class TrendServiceImpl implements TrendService { ...@@ -1769,7 +1772,7 @@ public class TrendServiceImpl implements TrendService {
// 查询当前拥堵指数最大,历史表中一个小时以内数据 // 查询当前拥堵指数最大,历史表中一个小时以内数据
LambdaQueryWrapper<CrossDirDataHistPO> histQuery = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CrossDirDataHistPO> histQuery = new LambdaQueryWrapper<>();
histQuery.eq(CrossDirDataHistPO::getCrossId, abnormalCrossListVO.getId()) histQuery.eq(CrossDirDataHistPO::getCrossId, abnormalCrossListVO.getId())
.between(CrossDirDataHistPO::getBatchTime, abnormalCrossListVO.getBatchTime() - 86400, abnormalCrossListVO.getBatchTime()); .between(CrossDirDataHistPO::getBatchTime, abnormalCrossListVO.getBatchTime() - 3600 * 2, abnormalCrossListVO.getBatchTime());
List<CrossDirDataHistPO> histPOS = crossDirDataHistMapper.selectList(histQuery); List<CrossDirDataHistPO> histPOS = crossDirDataHistMapper.selectList(histQuery);
if (!CollectionUtils.isEmpty(histPOS)) { if (!CollectionUtils.isEmpty(histPOS)) {
Map<Integer, List<CrossDirDataHistPO>> map = histPOS.stream().collect(Collectors.groupingBy(CrossDirDataHistPO::getBatchTime)); Map<Integer, List<CrossDirDataHistPO>> map = histPOS.stream().collect(Collectors.groupingBy(CrossDirDataHistPO::getBatchTime));
......
package net.wanji.opt.service.signalopt;
import net.wanji.opt.vo.GreenBeltFlowStopTimeVO;
import java.util.List;
/**
* @author duanruiming
* @date 2024/11/19 18:07
*/
public interface GreenBeltInfoService {
List<GreenBeltFlowStopTimeVO> greenBeltCrossDetailHist(Integer greenId);
}
package net.wanji.opt.service.signalopt.impl;
import net.wanji.databus.dao.mapper.CrossDataHistMapper;
import net.wanji.databus.dao.mapper.GreenwaveInfoMapper;
import net.wanji.databus.po.CrossDataHistPO;
import net.wanji.opt.service.signalopt.GreenBeltInfoService;
import net.wanji.opt.vo.GreenBeltFlowStopTimeVO;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneOffset;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author duanruiming
* @date 2024/12/02 13:42
*/
@Service
public class GreenBeltServiceImpl implements GreenBeltInfoService {
@Resource
private GreenwaveInfoMapper greenwaveInfoMapper;
@Resource
private CrossDataHistMapper crossDataHistMapper;
@Override
public List<GreenBeltFlowStopTimeVO> greenBeltCrossDetailHist(Integer greenId) {
List<String> crossIds = greenwaveInfoMapper.selectCrossIdsById(greenId);
LocalDate currentDate = LocalDate.now();
LocalTime startTime = LocalTime.MIDNIGHT; // 00:00
LocalDateTime startOfDay = LocalDateTime.of(currentDate, startTime);
LocalDate nextDate = currentDate.plusDays(1);
LocalTime endTime = LocalTime.MIDNIGHT; // 00:00 of the next day
LocalDateTime endOfDay = LocalDateTime.of(nextDate, endTime);
long startSecond = startOfDay.toEpochSecond(ZoneOffset.of("+8"));
long endSecond = endOfDay.toEpochSecond(ZoneOffset.of("+8"));
List<CrossDataHistPO> crossDataHistPOS = crossDataHistMapper.selectByCrossIdsAndTimestamp(crossIds, (int) startSecond, (int) endSecond);
if (!CollectionUtils.isEmpty(crossDataHistPOS)) {
List<GreenBeltFlowStopTimeVO> results = new ArrayList<>();
Map<Date, List<CrossDataHistPO>> startTimeMap = crossDataHistPOS.stream().collect(Collectors.groupingBy(CrossDataHistPO::getStartTime));
GreenBeltFlowStopTimeVO greenBeltFlowStopTimeVO = new GreenBeltFlowStopTimeVO();
for (Map.Entry<Date, List<CrossDataHistPO>> entry : startTimeMap.entrySet()) {
Date startDate = entry.getKey();
List<GreenBeltFlowStopTimeVO.FlowStopTimeDetail> crossList = new ArrayList<>();
greenBeltFlowStopTimeVO.setStartTime(startDate);
List<CrossDataHistPO> value = entry.getValue();
if (!CollectionUtils.isEmpty(value)) {
for (CrossDataHistPO crossDataHistPO : value) {
GreenBeltFlowStopTimeVO.FlowStopTimeDetail flowStopTimeDetail = new GreenBeltFlowStopTimeVO.FlowStopTimeDetail();
flowStopTimeDetail.setFlow(crossDataHistPO.getFlow());
flowStopTimeDetail.setStopTimes(crossDataHistPO.getStopTimes());
flowStopTimeDetail.setCrossId(crossDataHistPO.getCrossId());
crossList.add(flowStopTimeDetail);
}
}
greenBeltFlowStopTimeVO.setDetailList(crossList);
results.add(greenBeltFlowStopTimeVO);
}
return results;
}
return Collections.EMPTY_LIST;
}
}
...@@ -30,8 +30,6 @@ public class StrategyControlController { ...@@ -30,8 +30,6 @@ public class StrategyControlController {
@Resource @Resource
private StrategyControlService strategyControlService; private StrategyControlService strategyControlService;
@Resource
SynthesisOptimizeLogInfoMapper synthesisOptimizeLogInfoMapper;
@ApiOperation(value = "策略控制信息操作", notes = "策略控制信息操作", @ApiOperation(value = "策略控制信息操作", notes = "策略控制信息操作",
response = JsonViewObject.class, response = JsonViewObject.class,
......
...@@ -174,7 +174,8 @@ public class StrategyControlServiceImpl implements StrategyControlService { ...@@ -174,7 +174,8 @@ public class StrategyControlServiceImpl implements StrategyControlService {
// 查询当前绿波历史记录 // 查询当前绿波历史记录
setGreenOptHist(results, midnight, format); setGreenOptHist(results, midnight, format);
setCrossOptHist(results, midnight); setCrossOptHist(results, midnight);
return JsonViewObject.newInstance().success(results); List<StrategyControlHistVO> sorted = results.stream().sorted(Comparator.comparing(StrategyControlHistVO::getOptTime).reversed()).collect(Collectors.toList());
return JsonViewObject.newInstance().success(sorted);
} }
private void setCrossOptHist(List<StrategyControlHistVO> results, LocalDateTime midnight) { private void setCrossOptHist(List<StrategyControlHistVO> results, LocalDateTime midnight) {
......
package net.wanji.opt.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @author duanruiming
* @date 2024/12/02 13:47
*/
@Data
@ApiModel(value = "绿波带历史流量停车次数")
public class GreenBeltFlowStopTimeVO {
@ApiModelProperty("时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm", timezone = "GMT+8")
private Date startTime;
@ApiModelProperty("流量停车次数列表")
private List<FlowStopTimeDetail> detailList;
@Data
public static class FlowStopTimeDetail {
@ApiModelProperty("路口编号")
private String crossId;
@ApiModelProperty("流量")
private Integer flow;
@ApiModelProperty("停车次数")
private Double stopTimes;
}
}
package net.wanji.databus.dao.entity; package net.wanji.databus.dao.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -9,10 +11,13 @@ import lombok.Data; ...@@ -9,10 +11,13 @@ import lombok.Data;
*/ */
@Data @Data
@TableName("t_greenwave_hist")
public class GreenwaveHistPO extends GreenwaveRealtimePO{ public class GreenwaveHistPO extends GreenwaveRealtimePO{
@ApiModelProperty(value = "绿波名称") @ApiModelProperty(value = "绿波名称")
@TableField(exist = false)
private String greenwaveName; private String greenwaveName;
@ApiModelProperty(value = "协调方向:0正向;1反向;2双向") @ApiModelProperty(value = "协调方向:0正向;1反向;2双向")
@TableField(exist = false)
private Integer dir; private Integer dir;
} }
package net.wanji.databus.dao.mapper; package net.wanji.databus.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.wanji.databus.dao.entity.GreenwaveHistPO; import net.wanji.databus.dao.entity.GreenwaveHistPO;
import net.wanji.databus.dao.entity.GreenwaveHistPOExt; import net.wanji.databus.dao.entity.GreenwaveHistPOExt;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -13,7 +14,7 @@ import java.util.List; ...@@ -13,7 +14,7 @@ import java.util.List;
* @date 2022/10/31 11:03 * @date 2022/10/31 11:03
*/ */
@Repository @Repository
public interface GreenwaveHistMapper { public interface GreenwaveHistMapper extends BaseMapper<GreenwaveHistPO> {
List<GreenwaveHistPOExt> selectRunMonitor(Date nowTime); List<GreenwaveHistPOExt> selectRunMonitor(Date nowTime);
List<GreenwaveHistPO> selectByTimeSection(String startTimeStr, String endTimeStr); List<GreenwaveHistPO> selectByTimeSection(String startTimeStr, String endTimeStr);
......
...@@ -50,6 +50,8 @@ public class AbnormalCrossListVO { ...@@ -50,6 +50,8 @@ public class AbnormalCrossListVO {
private Integer isSpillover; private Integer isSpillover;
@ApiModelProperty(value = "是否拥堵:0否;1是") @ApiModelProperty(value = "是否拥堵:0否;1是")
private Integer isCongestion; private Integer isCongestion;
@ApiModelProperty(value = "交通指数")
private Double trafficIndex;
@ApiModelProperty(value = "拥堵指数") @ApiModelProperty(value = "拥堵指数")
private Double congestionIndex; private Double congestionIndex;
@ApiModelProperty(value = "失衡指数") @ApiModelProperty(value = "失衡指数")
......
...@@ -42,6 +42,8 @@ public class GreenwaveListVO { ...@@ -42,6 +42,8 @@ public class GreenwaveListVO {
@ApiModelProperty(value = "行程速度") @ApiModelProperty(value = "行程速度")
@JsonSerialize(using = DoubleToTwoDecimalPlacesSerializer.class) @JsonSerialize(using = DoubleToTwoDecimalPlacesSerializer.class)
private Double speed; private Double speed;
@ApiModelProperty(value = "停车次数")
private Integer stopTimes;
@ApiModelProperty(value = "路口列表") @ApiModelProperty(value = "路口列表")
private List<CrossListElement> crossList; private List<CrossListElement> crossList;
......
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
select select
t2.id, t2.name, t2.is_signal, t1.unbalance_dirs, t1.congestion_dirs, t1.spillover_dirs, t1.status as realtimeStatus, t2.id, t2.name, t2.is_signal, t1.unbalance_dirs, t1.congestion_dirs, t1.spillover_dirs, t1.status as realtimeStatus,
t1.start_time, t1.duration, t2.location as locationStr, t1.is_unbalance, t1.is_spillover, t1.is_congestion, t1.start_time, t1.duration, t2.location as locationStr, t1.is_unbalance, t1.is_spillover, t1.is_congestion,
t1.congestion_index, t1.unbalance_index, t1.spillover_index, t1.batch_time t1.congestion_index, t1.unbalance_index, t1.spillover_index, t1.batch_time, t1.traffic_index
from t_cross_data_realtime t1 JOIN t_base_cross_info t2 from t_cross_data_realtime t1 JOIN t_base_cross_info t2
on t1.cross_id = t2.id on t1.cross_id = t2.id
<where> <where>
......
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