新增功能项后执行,调整功能项层级

2019-07-01 0 条评论 12 次阅读 0 人点赞

with fun
as(
select FuncID,ParentFuncID,functitle, 0 as ilevel,FuncModuleId,FuncModuleName from SYS_Function where isnull(ParentFuncID,'')='' or ParentFuncID='Root'
union all
select B.FuncID,B.ParentFuncID,B.functitle,A.ilevel+1,A.FuncModuleId,A.FuncModuleName from fun A join SYS_Function B on A.FuncID=B.ParentFuncID
where a.ilevel < 5
)
update A set A.Ilevel=B.Ilevel,FuncModuleId=B.FuncModuleId,FuncModuleName=B.FuncModuleName from SYS_Function A join fun B on A.FuncID=B.funcID;

root

这个人太懒什么东西都没留下

文章评论(0)