Commit 288b7d9d authored by hanbing's avatar hanbing

[update] 态势监测实时推送增加空间占有率、时间占有率

parent cbaabc92
......@@ -1225,9 +1225,9 @@ public class TrendServiceImpl implements TrendService {
TableQueryVO tableQueryVO = new TableQueryVO();
// 查询秒级数据
List<CrossLaneSnapshotDataDTO> dtoList =
laneSnapshotDataQueryService.queryByCrossIdAndTimeSpan(crossId, realTimeStartTimeStamp, endTimeStamp);
tableQueryVO.setRealTimeData(buildRealTimeList(dtoList));
// List<CrossLaneSnapshotDataDTO> dtoList =
// laneSnapshotDataQueryService.queryByCrossIdAndTimeSpan(crossId, realTimeStartTimeStamp, endTimeStamp);
// tableQueryVO.setRealTimeData(buildRealTimeList(dtoList));
// 查询周期数据
List<CrossLaneDataHistPOExt> poExtList = crossLaneDataHistMapper
......@@ -1289,6 +1289,16 @@ public class TrendServiceImpl implements TrendService {
Double vehheadTime = po.getVehheadTime();
vo.setVehheadTime((int) Math.round(vehheadTime));
Double timeOccupancyDouble = po.getTimeOccupancy();
if (timeOccupancyDouble != null) {
vo.setTimeOccupancy((int) Math.round(timeOccupancyDouble * 100));
}
Double vehicleNumsRatioMeanDoulbe = po.getVehicleNumsRatioMean();
if (vehicleNumsRatioMeanDoulbe != null) {
vo.setVehicleNumsRatioMean((int) Math.round(vehicleNumsRatioMeanDoulbe * 100));
}
res.add(vo);
}
......
......@@ -77,5 +77,12 @@ public class TableQueryVO {
@ApiModelProperty(value = "平均车头时距")
private Integer vehheadTime;
@ApiModelProperty(value = "时间占有率")
private Integer timeOccupancy;
@ApiModelProperty(value = "空间占有率")
// 空间占有率即车辆负荷比
private Integer vehicleNumsRatioMean;
}
}
package net.wanji.databus.po;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
......@@ -15,5 +12,9 @@ public class CrossLaneDataHistPOExt extends CrossLaneDataRealTimePO{
private Integer dir;
// 车道序号,从左车道开始编号11、12、13...
private Integer sort;
// 时间占有率
private Double timeOccupancy;
// 空间占有率即车辆负荷比
private Double vehicleNumsRatioMean;
}
......@@ -95,7 +95,7 @@
<select id="selectByCrossIdAndTimeSpan" resultType="net.wanji.databus.po.CrossLaneDataHistPOExt">
SELECT t2.dir, t2.sort, t1.flow, t1.speed, t1.queue_length, t1.delay_time, t1.stop_times,
t1.vehhead_time, t1.batch_time
t1.vehhead_time, t1.batch_time, t1.time_occupancy, t1.vehicle_nums_ratio_mean
FROM t_lane_data_hist t1 JOIN t_base_lane_info t2 ON t1.id = t2.id
where t1.cross_id = #{crossId}
and batch_time <![CDATA[ >= ]]> #{startTimeStamp}
......
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