热度 1||
--可用于人员多选时
SELECT b.ID,
b.USER_NAME 姓名,
d.dept_name 部门,
d.dept_name || ' {' || c.dept_name || '}' 部门岗位,
d.dept_id,
b.INP_CODE 输入码
FROM sa_staff_info b
LEFT JOIN SA_STAFF_ROLE a
ON a.user_id = b.ID
LEFT JOIN SA_DEPT_DICT c
ON c.dept_id = a.dept_id
LEFT JOIN SA_DEPT_DICT d
ON c.upper_id = d.dept_id
order by d.dept_name, c.dept_name, b.user_name
Powered by Discuz! X3.2
© 2001-2013 Comsenz Inc.