Commit ea29bad8 authored by duwei's avatar duwei

优化交通指标查询

parent b9b4bb6d
...@@ -1415,7 +1415,8 @@ public class TrendServiceImpl implements TrendService { ...@@ -1415,7 +1415,8 @@ public class TrendServiceImpl implements TrendService {
vo.setSpeed((double) Math.round(speed *100)/100.0 );//Math.round(0.01d * 100) / 100.0 vo.setSpeed((double) Math.round(speed *100)/100.0 );//Math.round(0.01d * 100) / 100.0
Double queueLength = po.getQueueLength(); Double queueLength = po.getQueueLength();
if(queueLength != null){ if(queueLength != null){
vo.setQueueLength(Integer.parseInt(String.valueOf(queueLength))); int queueLengthInt = (int) Math.round(queueLength);
vo.setQueueLength(queueLengthInt);
} }
Integer delayTime = po.getDelayTime(); Integer delayTime = po.getDelayTime();
...@@ -1558,7 +1559,8 @@ public class TrendServiceImpl implements TrendService { ...@@ -1558,7 +1559,8 @@ public class TrendServiceImpl implements TrendService {
Double queueLength = po.getQueueLength(); Double queueLength = po.getQueueLength();
if (queueLength != null) { if (queueLength != null) {
vo.setQueueLength(Integer.parseInt(String.valueOf(queueLength))); int queueLengthInt = (int) Math.round(queueLength);
vo.setQueueLength(queueLengthInt);
} }
Integer delayTime = po.getDelayTime(); Integer delayTime = po.getDelayTime();
...@@ -1637,7 +1639,9 @@ public class TrendServiceImpl implements TrendService { ...@@ -1637,7 +1639,9 @@ public class TrendServiceImpl implements TrendService {
// vo.setCrossNoClearRate(0); // vo.setCrossNoClearRate(0);
//平均排队长度 //平均排队长度
if (po.getQueueLength() != null) { if (po.getQueueLength() != null) {
vo.setAvgQueueLength(Integer.parseInt(String.valueOf(po.getQueueLength()))); // vo.setAvgQueueLength(Integer.parseInt(String.valueOf(po.getQueueLength())));
int queueLengthInt = (int) Math.round(queueLength);
vo.setAvgQueueLength(queueLengthInt);
}else{ }else{
// vo.setAvgQueueLength(0.0); // vo.setAvgQueueLength(0.0);
} }
...@@ -1699,7 +1703,8 @@ public class TrendServiceImpl implements TrendService { ...@@ -1699,7 +1703,8 @@ public class TrendServiceImpl implements TrendService {
// vo.setVehheadDist(0d);//车头间距 // vo.setVehheadDist(0d);//车头间距
Double queueLength = po.getQueueLength(); Double queueLength = po.getQueueLength();
if (queueLength != null) { if (queueLength != null) {
vo.setQueueLength(Integer.parseInt(String.valueOf(queueLength))); int queueLengthInt = (int) Math.round(queueLength);
vo.setQueueLength(queueLengthInt);
} }
Double stopTimes = po.getStopTimes(); Double stopTimes = po.getStopTimes();
if (stopTimes != null) { if (stopTimes != null) {
...@@ -1858,7 +1863,8 @@ public class TrendServiceImpl implements TrendService { ...@@ -1858,7 +1863,8 @@ public class TrendServiceImpl implements TrendService {
// vo.setVehheadTime(Math.round(vehheadTime *100)/100.0);//车头时距 // vo.setVehheadTime(Math.round(vehheadTime *100)/100.0);//车头时距
Double queueLength = po.getQueueLength(); Double queueLength = po.getQueueLength();
if (queueLength != null) { if (queueLength != null) {
vo.setQueueLength(Integer.parseInt(queueLength.toString())); int queueLengthInt = (int) Math.round(queueLength);
vo.setQueueLength(queueLengthInt);
} }
Double stopTimes = po.getStopTimes();//停车次数 Double stopTimes = po.getStopTimes();//停车次数
if (stopTimes != null) { if (stopTimes != null) {
...@@ -1957,7 +1963,9 @@ public class TrendServiceImpl implements TrendService { ...@@ -1957,7 +1963,9 @@ public class TrendServiceImpl implements TrendService {
// vo.setCrossNoClearRate(0); // vo.setCrossNoClearRate(0);
//平均排队长度 //平均排队长度
if (po.getQueueLength() != null) { if (po.getQueueLength() != null) {
vo.setAvgQueueLength(Integer.parseInt(String.valueOf(po.getQueueLength()))); // vo.setAvgQueueLength(Integer.parseInt(String.valueOf(po.getQueueLength())));
int queueLengthInt = (int) Math.round(queueLength);
vo.setAvgQueueLength(queueLengthInt);
}else { }else {
// vo.setAvgQueueLength(0.0); // vo.setAvgQueueLength(0.0);
} }
...@@ -2013,7 +2021,9 @@ public class TrendServiceImpl implements TrendService { ...@@ -2013,7 +2021,9 @@ public class TrendServiceImpl implements TrendService {
vo.setVehheadTime(Math.round(vehheadTime*100)/100.0);//车头时距 vo.setVehheadTime(Math.round(vehheadTime*100)/100.0);//车头时距
Double queueLength = po.getQueueLength(); Double queueLength = po.getQueueLength();
if (queueLength != null) { if (queueLength != null) {
vo.setQueueLength(Integer.parseInt(String.valueOf(queueLength))); //queueLength的值是105.0,需要转换为105
int queueLengthInt = (int) Math.round(queueLength);
vo.setQueueLength(queueLengthInt);
} }
Double stopTimes = po.getStopTimes(); Double stopTimes = po.getStopTimes();
if (stopTimes != null) { if (stopTimes != null) {
......
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
AND t2.cross_id = #{crossId} AND t2.cross_id = #{crossId}
</if> </if>
and t2.start_time <![CDATA[ >= ]]> #{startStamp} and t2.start_time <![CDATA[ >= ]]> #{startStamp}
and t2.start_time <![CDATA[ <= ]]> #{endStamp} and t2.start_time <![CDATA[ < ]]> #{endStamp}
GROUP BY GROUP BY
t2.cross_id, t2.cross_id,
startTime startTime
......
...@@ -178,7 +178,7 @@ ...@@ -178,7 +178,7 @@
</foreach> </foreach>
</if> </if>
and t1.start_time <![CDATA[ >= ]]> #{startStamp} and t1.start_time <![CDATA[ >= ]]> #{startStamp}
and t1.start_time <![CDATA[ <= ]]> #{endStamp} and t1.start_time <![CDATA[ < ]]> #{endStamp}
GROUP BY GROUP BY
t2.id, t2.id,
t2.dir, t2.dir,
......
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
) )
</if> </if>
and t2.start_time <![CDATA[ >= ]]> #{startStamp} and t2.start_time <![CDATA[ >= ]]> #{startStamp}
and t2.start_time <![CDATA[ <= ]]> #{endStamp} and t2.start_time <![CDATA[ < ]]> #{endStamp}
GROUP BY GROUP BY
t1.cross_id, t1.cross_id,
t2.in_dir, t2.in_dir,
......
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