Commit 8320c19e by 杨林龙

优化离线规则查询

1 parent 35a2ca5c
...@@ -50,9 +50,11 @@ ...@@ -50,9 +50,11 @@
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
and ((timestampdiff(SECOND, tdl.last_gps_time, now()) > 259200 and and ((timestampdiff(SECOND, tdl.last_gps_time, now()) > 259200 and timestampdiff(SECOND, tdl.last_bs_time, now()) > 259200)
timestampdiff(SECOND, tdl.last_bs_time, now()) > 259200 and td.source = 1) or (tdl.last_gps_time is null and tdl.last_bs_time is null)
or (timestampdiff(SECOND, tdl.last_bs_time, now()) > 259200 and td.source = 0)) or (tdl.last_gps_time is null and timestampdiff(SECOND, tdl.last_bs_time, now()) > 259200)
or (timestampdiff(SECOND, tdl.last_gps_time, now()) > 259200 and tdl.last_bs_time is null)
)
group by tv.id group by tv.id
</select> </select>
...@@ -79,8 +81,7 @@ ...@@ -79,8 +81,7 @@
tw.partner_order_no like '%${keywords}%' tw.partner_order_no like '%${keywords}%'
or tv.vin like '%${keywords}%' or tv.vin like '%${keywords}%'
or tv.owner_name like '%${keywords}%' or tv.owner_name like '%${keywords}%'
or tv.id in (select vehicle_id from t_vehicle_device where del_flag = 0 and bind_status = 1 and sn like or tv.id in (select vehicle_id from t_vehicle_device where del_flag = 0 and bind_status = 1 and sn like '%${keywords}%')
'%${keywords}%')
) )
</if> </if>
group by tv.id group by tv.id
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!