and (td.source=1) and speed>0 and ((timestampdiff(SECOND,tdl.last_gps_time,now())) <![CDATA[<]]> 360 or (timestampdiff(SECOND,tdl.last_bs_time,now())) <![CDATA[<]]> 360)
and (td.source=1) and speed>0 and ((timestampdiff(SECOND,tdl.last_gps_time,now())) <![CDATA[<]]> 360 or (timestampdiff(SECOND,tdl.last_bs_time,now()))
<![CDATA[<]]> 360)
</when>
</when>
<whentest="deviceState == 1"><!-- 静止-->
<whentest="deviceState == 1"><!-- 静止-->
and (td.source=1) and (speed=0 or speed is null) and ((timestampdiff(SECOND,tdl.last_gps_time,now())) <![CDATA[<]]> 360 or
and (td.source=1) and (speed=0 or speed is null) and ((timestampdiff(SECOND,tdl.last_gps_time,now())) <![CDATA[<]]> 360 or
...
@@ -517,15 +518,14 @@
...
@@ -517,15 +518,14 @@
ddf.`week` AS `week`,
ddf.`week` AS `week`,
ddf.week_timer AS weekTimer,
ddf.week_timer AS weekTimer,
tu.username,
tu.username,
tu2.username operation
tu.account operation
from t_vehicle tv
from t_vehicle tv
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
left join t_workorder tw on tw.id = tv.workorder_id
left join t_workorder tw on tw.id = tv.workorder_id
left join t_device td on td.sn = tvd.sn
left join t_device td on td.sn = tvd.sn
left join t_device_location tdl on tdl.sn = tvd.sn
left join t_device_location tdl on tdl.sn = tvd.sn
left join t_user tu on tu.id = tv.created_by
left join (select * from (SELECT * FROM t_device_freq order by created_date desc) temp GROUP BY temp.sn) ddf on ddf.vehicle_id = tv.id and ddf.sn = td.sn
left join (select * from (SELECT * FROM t_device_freq order by created_date desc) temp GROUP BY temp.sn) ddf on ddf.vehicle_id = tv.id and ddf.sn = td.sn
left join t_user tu2 on tu2.id = ddf.created_by
left join t_user tu on tu.id = ddf.created_by
where tv.del_flag = 0
where tv.del_flag = 0
and tvd.bind_status = 1
and tvd.bind_status = 1
and tvd.del_flag = 0
and tvd.del_flag = 0
...
@@ -559,7 +559,8 @@
...
@@ -559,7 +559,8 @@
<iftest="deviceState != null">
<iftest="deviceState != null">
<choose>
<choose>
<whentest="deviceState == 0"><!-- 行驶中-->
<whentest="deviceState == 0"><!-- 行驶中-->
and (td.source=1) and speed>0 and ((timestampdiff(SECOND,tdl.last_gps_time,now())) <![CDATA[<]]> 360 or (timestampdiff(SECOND,tdl.last_bs_time,now())) <![CDATA[<]]> 360)
and (td.source=1) and speed>0 and ((timestampdiff(SECOND,tdl.last_gps_time,now())) <![CDATA[<]]> 360 or (timestampdiff(SECOND,tdl.last_bs_time,now()))
<![CDATA[<]]> 360)
</when>
</when>
<whentest="deviceState == 1"><!-- 静止-->
<whentest="deviceState == 1"><!-- 静止-->
and (td.source=1) and (speed=0 or speed is null) and ((timestampdiff(SECOND,tdl.last_gps_time,now())) <![CDATA[<]]> 360 or
and (td.source=1) and (speed=0 or speed is null) and ((timestampdiff(SECOND,tdl.last_gps_time,now())) <![CDATA[<]]> 360 or