SELECT selectCondition
FROM hs_hr_employee e

LEFT JOIN ohrm_subunit s
ON whereCondition1 

LEFT JOIN ohrm_subunit c
ON e.work_station = c.id

LEFT JOIN ohrm_subunit p
ON get_parant_id(p.id) = s.id AND p.lft <= c.lft and p.rgt >= c.rgt

WHERE 

whereCondition2

AND

whereCondition3

AND 

((s.id = 1)
OR
(p.id is not null or s.id = c.id))

GROUP BY sub_unit
;