1、首先设定一级菜单的full_name(全路径)
update S_DEPARTMENT t set t.full_name = ‘XX集团‘ where fid=‘-1‘;
2、设定二级菜单的full_name
update (
select a.dep_name,a.full_name,b.dep_name dd,b.full_name cc from
(select * from S_DEPARTMENT where dep_level = ‘2‘) a , -- 获取二级菜单
(select * from S_DEPARTMENT where dep_level = ‘1‘) b -- 获取一级菜单
where a.fid = b.id
)
set full_name = cc||‘/‘||dep_name ;
原文地址:http://blog.51cto.com/1197822/2157189
时间: 2024-10-16 00:21:55