select a.messagerurl as fLeaderImg,a.LASTNAME as fLeaderName,c.id as fLeaderJobId,b.JOBTITLEMARK as fLeaderJob,e.level_name as fLeaderLv,f.grade_name as fLeaderSt
from hrmresource a
left join hrmjobtitles b on a.JOBTITLE=b.ID
left join jcl_org_job c on b.ID = c.ec_jobTitle
left join cus_fielddata d on a.id = d.id and d.scope='HrmCustomFieldByInfoType' and d.scopeid=3