SELECT IFNULL(t.`create_time`,"") AS createTime,t.*,s.device_name AS deviceName,s.category,s.unit,e.unit_name AS enterpriseName,s.`device_number` AS deviceNum FROM safety_device_info s
LEFT JOIN (SELECT device_num,MAX(id) AS did ,`status`,concentration, create_time FROM monitor GROUP BY device_num) t ON t.`device_num` = s.`device_number`