Commit fe373d0c by 王欣伟

离线规则修改完成

1 parent 08186e96
...@@ -740,9 +740,11 @@ ...@@ -740,9 +740,11 @@
and tvd.bind_status = 1 and tvd.bind_status = 1
and tvd.del_flag = 0 and tvd.del_flag = 0
<if test="offlineStartTime != null and offlineStartTime != ''"> <if test="offlineStartTime != null and offlineStartTime != ''">
and ((tdl.last_gps_time &lt; #{offlineStartTime} and tdl.last_bs_time &lt; #{offlineStartTime} and ((tdl.last_gps_time &lt; #{offlineStartTime} and tdl.last_bs_time &lt; #{offlineStartTime})
and td.source = 1) or (tdl.last_gps_time is null and tdl.last_bs_time is null)
or (tdl.last_bs_time &lt; #{offlineStartTime} and td.source = 0)) or (tdl.last_gps_time is null and tdl.last_bs_time &lt; #{offlineStartTime})
or (tdl.last_gps_time &lt; #{offlineStartTime} and tdl.last_bs_time is null)
)
</if> </if>
<if test="activeStartTime != null and activeStartTime != ''"> <if test="activeStartTime != null and activeStartTime != ''">
and tvd.created_date &gt;= #{activeStartTime} and tvd.created_date &gt;= #{activeStartTime}
...@@ -878,8 +880,11 @@ ...@@ -878,8 +880,11 @@
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 = td.sn left join t_device_location tdl on tdl.sn = td.sn
WHERE tvd.del_flag = 0 and tv.del_flag = 0 and tvd.bind_status = 1 WHERE tvd.del_flag = 0 and tv.del_flag = 0 and tvd.bind_status = 1
and timestampdiff(SECOND, tdl.last_gps_time, now()) &gt; #{offlineTime} and ((timestampdiff(SECOND, tdl.last_gps_time, now()) &gt; #{offlineTime} and timestampdiff(SECOND, tdl.last_bs_time, now()) &gt; #{offlineTime})
and timestampdiff(SECOND, tdl.last_bs_time, now()) &gt; #{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()) &gt; #{offlineTime})
or (timestampdiff(SECOND, tdl.last_gps_time, now()) &gt; #{offlineTime} and tdl.last_bs_time is null)
)
<if test="offlineSnStr != null and offlineSnStr != ''"> <if test="offlineSnStr != null and offlineSnStr != ''">
and tvd.sn not in (${offlineSnStr}) and tvd.sn not in (${offlineSnStr})
</if> </if>
...@@ -924,7 +929,11 @@ ...@@ -924,7 +929,11 @@
and tvd.created_date > '2013-01-01 00:00:00.0' and tvd.created_date > '2013-01-01 00:00:00.0'
<!--离线时间--> <!--离线时间-->
<if test="lostBegin != null"> <if test="lostBegin != null">
and tdl.last_gps_time &lt; #{lostBegin} and tdl.last_bs_time &lt; #{lostBegin} and ((tdl.last_gps_time &lt; #{lostBegin} and tdl.last_bs_time &lt; #{lostBegin})
or (tdl.last_gps_time is null and tdl.last_bs_time is null)
or (tdl.last_gps_time is null and tdl.last_bs_time &lt; #{lostBegin})
or (tdl.last_gps_time &lt; #{lostBegin} and tdl.last_bs_time is null)
)
</if> </if>
</select> </select>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!