(SELECT temp.status FROM t_device_freq temp where temp.vehicle_id = tv.id and temp.sn = tvd.sn order by
<!--(SELECT temp.status FROM t_device_freq temp where temp.vehicle_id = tv.id and temp.sn = tvd.sn order by created_date desc limit 1) AS freqStatus,-->
created_date desc limit 1) AS freqStatus,
tv.created_by createdBy
tv.created_by createdBy
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