select a.id vehid,a.PlateNumber platenumber from t_base_vehicle a inner join t_base_vehicle_location b on a.SN=b.sn
where a.status=17 and a.modifyDate <DATE_SUB(NOW(),INTERVAL 20 MINUTE) --当前时间减20分钟
AND a.id not in(select vehicleId from t_base_task where (taskStatus!=4)
AND isdelete=0 AND tasktype=0 AND createDate>DATE_SUB(NOW(),INTERVAL 48 HOUR))--当前时间减去2天