ALTER PROCEDURE [dbo].[notice]
@username varchar(30),@vstr varchar(600) output
AS
BEGIN
SET NOCOUNT ON;
declare @xiaozhang int,@fenguan int,@zhuguan int,@jiaowu int,@zonghe int,@caiwu int
set @xiaozhang=dbo.Get_ArrayStr((select quanxian from login where username=@username),',',4)
set @fenguan=dbo.Get_ArrayStr((select quanxian from login where username=@username),',',5)
set @zhuguan=dbo.Get_ArrayStr((select quanxian from login where username=@username),',',6)
set @vstr =''
--校长权限
if @xiaozhang=1 and (select count(*) from baoxiao where threeapply=0)>0
set @vstr=@vstr+'■校长报销审批模块'
if @xiaozhang=1 and (select count(*) from borrow where threeapply=0)>0
set @vstr=@vstr+'■校长借款审批模块'
if @xiaozhang=1 and (select count(*) from tech where threeapply=0)>0
set @vstr=@vstr+'■校长日志审批模块'
--分管校长权限
if @fenguan=1 and (select count(*) from baoxiao where twoapply=0)>0
set @vstr=@vstr+'■分管校长报销审批'
if @fenguan=1 and (select count(*) from borrow where twoapply=0)>0
set @vstr=@vstr+'■分管校长借款审批'
if @fenguan=1 and (select count(*) from tech where twoapply=0)>0
set @vstr=@vstr+'■分管校长日志审批'
--主管权限
if @zhuguan=1 and (select count(*) from baoxiao where oneapply=0 and suoshu=3)>0
set @vstr=@vstr+'■招办主任报销审批'
if @zhuguan=1 and (select count(*) from borrow where oneapply=0 and suoshu=3)>0
set @vstr=@vstr+'■招办主任借款审批'
return
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余1页未读,立即下载