and (td.source=1) and speed>0 and ((timestampdiff(SECOND,tdl.last_gps_time,now())) <![CDATA[<]]> 600 or (timestampdiff(SECOND,tdl.last_bs_time,now()))
<![CDATA[<]]> 600)
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>
<whentest="deviceState == 1"><!-- 静止-->
and (td.source=1) and (speed=0 or speed is null) and ((timestampdiff(SECOND,tdl.last_gps_time,now())) <![CDATA[<]]>600 or
and (timestampdiff(SECOND,tdl.last_gps_time,now())) > #{offlineTime} and (timestampdiff(SECOND,tdl.last_bs_time,now())) > #{offlineTime}
and ((timestampdiff(SECOND, tdl.last_gps_time, now()) > #{offlineTime} and timestampdiff(SECOND, tdl.last_bs_time, now()) > #{offlineTime})
or (tdl.last_gps_time is null and tdl.last_bs_time is null)
or (tdl.last_gps_time is null and timestampdiff(SECOND, tdl.last_bs_time, now()) > #{offlineTime})
or (timestampdiff(SECOND, tdl.last_gps_time, now()) > #{offlineTime} and tdl.last_bs_time is null)
)
</when>
<whentest="deviceState == 3"><!-- 在线-->
and (timestampdiff(SECOND,tdl.last_gps_time,now()) < #{offlineTime} or timestampdiff(SECOND,tdl.last_bs_time,now()) < #{offlineTime})
...
...
@@ -547,15 +550,18 @@
<iftest="deviceState != null">
<choose>
<whentest="deviceState == 0"><!-- 行驶中-->
and (td.source=1) and speed>0 and ((timestampdiff(SECOND,tdl.last_gps_time,now())) <![CDATA[<]]> 600 or (timestampdiff(SECOND,tdl.last_bs_time,now()))
<![CDATA[<]]> 600)
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>
<whentest="deviceState == 1"><!-- 静止-->
and (td.source=1) and (speed=0 or speed is null) and ((timestampdiff(SECOND,tdl.last_gps_time,now())) <![CDATA[<]]>600 or