日期:2014-05-17 浏览次数:20613 次
SELECT a.OUID, a.OUName, a.OULevel, a.OUFullName, a.ParentOUID ,(SELECT COUNT(1) FROM tbEmployeeInfo tei WHERE (a.OULevel> 2 AND tei.OUIDs LIKE a.OUID+'%') or (a.OULevel< 3 AND tei.DeptOUIDs = a.OUID) ) AS 人员总数 FROM tbOrganization a WHERE a.OULevel< 4 ORDER BY OULevel