SELECT p.Id, p.Name, p.CityID, CASE c.Level WHEN '1' THEN c.Name WHEN '2' THEN c.Name WHEN '3' THEN CONCAT(c1.name, c.name) ELSE '' END AS CityName, p.CreateBy, u.Name AS CreateName, p.Status, p.Source FROM HR_PositionInfo p LEFT JOIN P_User u ON u.id = p.CreateBy LEFT JOIN S_City c ON c.id = p.CityId LEFT JOIN S_City c1 ON c.PID = c1.Id WHERE STATUS != 4