查询报表目录
select id1,id2,id3,id4,concat(lv1, '/', lv2, concat( '/', lv3 ), concat( '/', lv4 )) as dictory ,lv1 ,lv2 ,lv3 ,lv4 ,paths from
(select a.id as id1,b.id as id2,c.id as id3,d.id as id4,a.displayName as lv1 ,b.displayName as lv2 ,c.displayName as lv3 ,d.displayName as lv4 ,ifnull( ifnull( b.path, c.path ), d.path ) as paths from fine_authority_object a
left join fine_authority_object b on a.id = b.parentId
left join fine_authority_object c on b.id = c.parentId
left join fine_authority_object d on c.id = d.parentId
where a.parentid = 'decision-directory-root'
order by a.sortIndex ) a
=========
效果
============
汇总就是
select count(id1) as sl from
(select id1,id2,id3,id4,concat(lv1, '/', lv2, concat( '/', lv3 ), concat( '/', lv4 )) as dictory ,lv1 ,lv2 ,lv3 ,lv4 ,paths from
(select a.id as id1,b.id as id2,c.id as id3,d.id as id4,a.displayName as lv1 ,b.displayName as lv2 ,c.displayName as lv3 ,d.displayName as lv4 ,ifnull( ifnull( b.path, c.path ), d.path ) as paths from fine_authority_object a
left join fine_authority_object b on a.id = b.parentId
left join fine_authority_object c on b.id = c.parentId
left join fine_authority_object d on c.id = d.parentId
where a.parentid = 'decision-directory-root'
order by a.sortIndex ) a)