with cte as
(
select dept_id,parent_dept,dept_name,dept_man, 0 as lvl from w_h_dept
where dept_id = 'T090102'
union all
select d.dept_id,d.parent_dept,d.dept_name,d.dept_man,lvl + 1 from cte c inner join w_h_dept d
on c.parent_dept= d.dept_id
)
select e.*,u.user_name from cte e LEFT JOIN x_userinfo u on e.dept_man=u.user_id