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_location tdl on tdl.sn = tvd.sn
left join t_device_power tdp on tdp.sn = tvd.sn
left join t_device_power tdp on tdp.sn = tvd.sn and tvd.id = tdp.vd_id
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