select m.*
from t_menu m
where m.state = '1'
and ((menu_type = 1 and exists
(select 1
from v_user_menu b
where m.menu_id = b.menu_id
and b.sys_id = '3000')) or
(m.menu_type = 0 and exists
(select 1
from v_user_menu b
where m.menu_id = b.parent_id
and b.sys_id = '3000')))
start with m.parent_id = '0'
connect by prior m.menu_id = m.parent_id
order siblings by menu_order
from t_menu m
where m.state = '1'
and ((menu_type = 1 and exists
(select 1
from v_user_menu b
where m.menu_id = b.menu_id
and b.sys_id = '3000')) or
(m.menu_type = 0 and exists
(select 1
from v_user_menu b
where m.menu_id = b.parent_id
and b.sys_id = '3000')))
start with m.parent_id = '0'
connect by prior m.menu_id = m.parent_id
order siblings by menu_order