SELECT e.id AS id,e.age AS age,e.bmgw_id AS bmgwId,b.`name` AS gw,bb.`name` AS bm, p.`name` AS proname,d.`name` AS eduname,e.job_status AS jobStatus,datediff(CURDATE(),e.rz_time) AS workage
a.org_code = #{orgCode}
FROM yggl_main_emp e
AND
LEFT JOIN zzgl_bmgw_m b ON b.id = e.bmgw_id
a.job_status != 4
LEFT JOIN zzgl_bmgw_m bb ON bb.id = b.up_id
ORDER BY
LEFT JOIN province_class p ON left (e.`jg`,2) = p.province