系统管理-权限-权限修复与重编译相关脚本

by 祁宏伟 2012.6.20 09:42

注:脚本执行有风险,对于客户正式环境请在研发指导下执行。

--1.先还原一个权限正常的备份库到正式环境库同一台SQLSERVRE上。
--2。在还原的备份库上进行修复表建立--执行下面语句
select * into Repair_UBF_Security_Task from UBF_Security_Task  where AuthorityItemType =8 or AuthorityItemType =16 or AuthorityItemType =32 
select * into Repair_UBF_MD_UIForm from UBF_MD_UIForm
select * into Repair_UBF_MD_UIField from UBF_MD_UIField
select * into Repair_UBF_MD_UIAction from UBF_MD_UIAction

--3.使用SQLSERVER的数据导入导出工具--将备份库上建立的四个Repair_ 表(就上面的语句)导到正式库上。

--注:以下操作全在正式库中进行了

--4。要修复的权限表进行备份 
select * into bak_UBF_Security_AuthorityCredential from UBF_Security_AuthorityCredential 
select * into bak_UBF_Security_Task from UBF_Security_Task 


--5. 开始执行修复 task 表
update t set t.AuthorityItemId = f.ID from UBF_Security_Task t  
		inner join Repair_UBF_Security_Task rt on t.ID = rt.ID and rt.AuthorityItemType =8
		inner join Repair_UBF_MD_UIForm rf on rt.AuthorityItemId =  rf.ID 
		inner join UBF_MD_UIForm f on f.UID = rf.UID and t.AuthorityItemId!=f.ID
update t set t.AuthorityItemId = f.ID from UBF_Security_Task t  
		inner join Repair_UBF_Security_Task rt on t.ID = rt.ID and rt.AuthorityItemType =16
		inner join Repair_UBF_MD_UIField rf on rt.AuthorityItemId =  rf.ID 
		inner join UBF_MD_UIField f on f.UID = rf.UID and t.AuthorityItemId!=f.ID
update t set t.AuthorityItemId = f.ID from UBF_Security_Task t  
		inner join Repair_UBF_Security_Task rt on t.ID = rt.ID and rt.AuthorityItemType =32
		inner join Repair_UBF_MD_UIAction rf on rt.AuthorityItemId =  rf.ID 
		inner join UBF_MD_UIAction f on f.UID = rf.UID and t.AuthorityItemId!=f.ID


--6.修复后Task表进行检查。--检查重复的数据
select a.id as oID,b.ID as nID, * from UBF_Security_Task a inner join UBF_Security_Task b 
		on a.AuthorityItemId = b.AuthorityItemId and a.TaskType = b.TaskType and a.AuthorityItemType = b.AuthorityItemType 
			and a.ID  != b.ID and a.ID<b.ID 
		
--6.1 如果检查出现有记录结果,要进行重复的数据删除操作--执行6.2 ,否则不用执行6.2 	
--6.2 删除新重复的数据
delete UBF_Security_RightAssign where [RIGHT] in 
	(
	select a.ID from UBF_Security_Right a inner join UBF_Security_Right b 
		on a .ID != b.ID  and a.ID >b.ID  and a.Task = b.Task and a.Opinion = b.Opinion and a.Context = b.Context 
			and a.DynamicView =b.DynamicView )
			
delete a from UBF_Security_Right a inner join UBF_Security_Right b 
		on a .ID != b.ID  and a.ID >b.ID  and a.Task = b.Task and a.Opinion = b.Opinion and a.Context = b.Context 
			and a.DynamicView =b.DynamicView			

delete a from UBF_Security_Task a inner join UBF_Security_Task b 
		on a.AuthorityItemId = b.AuthorityItemId and a.TaskType = b.TaskType and a.AuthorityItemType = b.AuthorityItemType 
			and a.ID  != b.ID and a.ID > b.ID 

			
	
--7. 清除权限结果数据 
delete UBF_Security_AuthorityCredential where AuthorityItemType =8 or AuthorityItemType =16 or AuthorityItemType =32  



--8. 重新编译权限数据=---这步结束,就O了。重注销一下用户,试验一下。
declare @StartSn bigint
exec AllocSerials 2000000,@StartSn output  --根据客户数据量情况来定.200000最多了.

			--批量插入AuthorityItemTypeId 不为 8,16,32
			insert into UBF_Security_AuthorityCredential(ID,CreatedOn,CreatedBy,  
			   ModifiedOn,ModifiedBy,SysVersion,Tag,[User],AuthorityItem,TaskType,  
			   Org,DynamicViewID,Context,Opinion,AuthorityItemType)
			select 
				@StartSN + Row_Number() over(order by t.AuthorityItemId)
				,DateAdd(day,-1,GetDate()),Host_Name()
				,DateAdd(day,-1,GetDate()),Host_Name()
				,0,
				t.Description,
				t.[User],
				t.AuthorityItemId,t.TaskTypeId,
				t.OrgId,
				t.DynamicViewID
				,t.Context,min(t.Opinion) --此处是min
				,t.AuthorityItemTypeId
			from(
				select 
					a.Description,
					a.AuthorityItemId,a.TaskTypeId,
					a.DynamicViewID
					,a.Context,a.Opinion
					,a.AuthorityItemTypeId
					,uo.[User]
					,a.OrgId
				from 
					vw_UBF_Security_Right_Task a 
					inner join Base_UserOrgRole as uor	on a.RoleId = uor.[Role]
					inner join Base_UserOrg as uo on uor.UserOrg = uo.ID  and a.OrgId = uo.Org 
				where 
					(a.AuthorityItemTypeId =8 or a.AuthorityItemTypeId =16 or a.AuthorityItemTypeId=32)
					and a.TaskTypeId != 96 and a.Description !='1'
					) t
			group by 
				t.Description,t.AuthorityItemId,t.TaskTypeId
				,t.DynamicViewID,t.Context,t.Opinion,t.[User],t.OrgId 
				,t.AuthorityItemTypeId
				
	      set @StartSN=@StartSN+@@rowcount

		  --批量插入AuthorityItemTypeId 为 8,TaskType特殊的.40,96的
		  insert into UBF_Security_AuthorityCredential(ID,CreatedOn,CreatedBy,  
			   ModifiedOn,ModifiedBy,SysVersion,Tag,[User],AuthorityItem,TaskType,  
			   Org,DynamicViewID,Context,Opinion,AuthorityItemType)    		
			select 
				@StartSN + Row_Number() over(order by t.AuthorityItemId)
				,DateAdd(day,-1,GetDate()),Host_Name()
				,DateAdd(day,-1,GetDate()),Host_Name()
				,0,
				t.Description,
				t.[User],
				t.AuthorityItemId,t.TaskTypeId,
				t.OrgId,
				t.DynamicViewID
				,t.Context,max(t.Opinion)  --此处是max
				,t.AuthorityItemTypeId
			from(
				select 
					a.Description,
					a.AuthorityItemId,a.TaskTypeId,
					a.DynamicViewID
					,a.Context,a.Opinion
					,a.AuthorityItemTypeId
					,uo.[User]
					,a.OrgId
				from 
					vw_UBF_Security_Right_Task a 
					inner join Base_UserOrgRole as uor	on a.RoleId = uor.[Role]
					inner join Base_UserOrg as uo on uor.UserOrg = uo.ID  and a.OrgId = uo.Org 
				where 
					(a.AuthorityItemTypeId = 8 and a.TaskTypeId = 96 ) 
					or (a.AuthorityItemTypeId = 8 and a.TaskTypeId = 40 and a.Description ='1')
					) t
			group by 
				t.Description,t.AuthorityItemId,t.TaskTypeId
				,t.DynamicViewID,t.Context,t.Opinion,t.[User],t.OrgId 
				,t.AuthorityItemTypeId
		
		




--重新建立权限数据表
--insert into UBF_Security_AuthorityCredential 
--	select rac.ID,rac.CreatedOn,rac.CreatedBy,rac.ModifiedOn,rac.ModifiedBy,rac.SysVersion,rac.Tag,rac.[User]
--		,ua.ID,rac.TaskType,rac.Org,rac.DynamicView,rac.Context,rac.Opinion,rac.AuthorityItemType,rac.DynamicViewID
--	  from Repair_UBF_Security_AuthorityCredential rac
--	inner join Repair_UBF_MD_UIForm rua on rac.AuthorityItem = rua.ID  and rac.AuthorityItemType =8 
--	inner join UBF_MD_UIForm ua on ua.UID = rua.UID  
--	insert into UBF_Security_AuthorityCredential 
--select rac.ID,rac.CreatedOn,rac.CreatedBy,rac.ModifiedOn,rac.ModifiedBy,rac.SysVersion,rac.Tag,rac.[User]
--		,ua.ID,rac.TaskType,rac.Org,rac.DynamicView,rac.Context,rac.Opinion,rac.AuthorityItemType,rac.DynamicViewID
--	  from Repair_UBF_Security_AuthorityCredential rac
--	inner join Repair_UBF_MD_UIField rua on rac.AuthorityItem = rua.ID  and rac.AuthorityItemType =16 
--	inner join UBF_MD_UIField ua on ua.UID = rua.UID  
--insert into UBF_Security_AuthorityCredential 
--	select rac.ID,rac.CreatedOn,rac.CreatedBy,rac.ModifiedOn,rac.ModifiedBy,rac.SysVersion,rac.Tag,rac.[User]
--		,ua.ID,rac.TaskType,rac.Org,rac.DynamicView,rac.Context,rac.Opinion,rac.AuthorityItemType,rac.DynamicViewID
--	  from Repair_UBF_Security_AuthorityCredential rac
--	inner join Repair_UBF_MD_UIAction rua on rac.AuthorityItem = rua.ID  and rac.AuthorityItemType =32 
--	inner join UBF_MD_UIAction ua on ua.UID = rua.UID  
--	where ua.ID not in --下面是去除掉重复GUID的Action
--		(select * from UBF_MD_UIAction ax inner join UBF_MD_UIAction ay 
--				on ax.UID=ay.UID and ax.ID != ay.ID and ax.ID>ay.ID) 


--select * into Repair_UBF_Security_AuthorityCredential from UBF_Security_AuthorityCredential where AuthorityItemType =8 or AuthorityItemType =16 or AuthorityItemType =32  

---成功后删除相应无用表:
drop table bak_UBF_Security_AuthorityCredential 
drop table bak_UBF_Security_Task 

drop table Repair_UBF_Security_AuthorityCredential  
drop table Repair_UBF_Security_Task  
drop table Repair_UBF_MD_UIForm  
drop table Repair_UBF_MD_UIField  
drop table Repair_UBF_MD_UIAction 

--update r set task=t.oID from  UBF_Security_Right as r  inner join 
--(select a.id as oID,b.ID as nID  from UBF_Security_Task a inner join UBF_Security_Task b 
--		on a.AuthorityItemId = b.AuthorityItemId and a.TaskType = b.TaskType and a.AuthorityItemType = b.AuthorityItemType 
--			and a.ID  != b.ID and a.ID<b.ID ) as t on r.Task = t.nID 


--delete UBF_Security_Task  where AuthorityItemType =8 or AuthorityItemType =16 or AuthorityItemType =32 

------正式修复ID AuthorityCredential  --不太管用,有些权限变化了.
--update a set a.authorityitem = f.ID from UBF_Security_AuthorityCredential a  
--		inner join Repair_UBF_Security_AuthorityCredential ra on a.ID = ra.ID and ra.AuthorityItemType =8
--		inner join Repair_UBF_MD_UIForm rf on ra.AuthorityItem =  rf.ID 
--		inner join UBF_MD_UIForm f on f.UID = rf.UID and a.AuthorityItem !=f.ID 
--update a set a.authorityitem = f.ID from UBF_Security_AuthorityCredential a  
--		inner join Repair_UBF_Security_AuthorityCredential ra on a.ID = ra.ID and ra.AuthorityItemType =16
--		inner join Repair_UBF_MD_UIField rf on ra.AuthorityItem =  rf.ID 
--		inner join UBF_MD_UIField f on f.UID = rf.UID and a.AuthorityItem !=f.ID 
--update a set a.authorityitem = f.ID from UBF_Security_AuthorityCredential a  
--		inner join Repair_UBF_Security_AuthorityCredential ra on a.ID = ra.ID and ra.AuthorityItemType =32
--		inner join Repair_UBF_MD_UIAction rf on ra.AuthorityItem =  rf.ID 
--		inner join UBF_MD_UIAction f on f.UID = rf.UID and a.AuthorityItem !=f.ID 	

--重建修复临时表数据

	--select rt.ID as id , uf.ID as ainewId into temp_Repair_Task_Form from Repair_UBF_Security_Task rt
	--inner join Repair_UBF_MD_UIForm ruf on rt.AuthorityItemId = ruf.ID  and rt.AuthorityItemType =8 
	--inner join UBF_MD_UIForm uf on uf.UID = ruf.UID  
	
	--select rt.ID as id , uf.ID as ainewId into temp_Repair_Task_Field from Repair_UBF_Security_Task rt
	--inner join Repair_UBF_MD_UIField ruf on rt.AuthorityItemId = ruf.ID  and rt.AuthorityItemType =16 
	--inner join UBF_MD_UIField uf on uf.UID = ruf.UID  
	
	--select rt.ID as id , uf.ID as ainewId into temp_Repair_Task_Action from Repair_UBF_Security_Task rt
	--inner join Repair_UBF_MD_UIAction ruf on rt.AuthorityItemId = ruf.ID  and rt.AuthorityItemType =32 
	--inner join UBF_MD_UIAction uf on uf.UID = ruf.UID  

	--select rt.ID as id , uf.ID as ainewId into temp_Repair_AuthorityCredential_Form from Repair_UBF_Security_AuthorityCredential rt
	--inner join Repair_UBF_MD_UIForm ruf on rt.AuthorityItem = ruf.ID  and rt.AuthorityItemType =8 
	--inner join UBF_MD_UIForm uf on uf.UID = ruf.UID  
	
	--select rt.ID as id , uf.ID as ainewId into temp_Repair_AuthorityCredential_Field from Repair_UBF_Security_AuthorityCredential rt
	--inner join Repair_UBF_MD_UIField ruf on rt.AuthorityItem = ruf.ID  and rt.AuthorityItemType =16 
	--inner join UBF_MD_UIField uf on uf.UID = ruf.UID  
	
	--select rt.ID as id , uf.ID as ainewId into temp_Repair_AuthorityCredential_Action from Repair_UBF_Security_AuthorityCredential rt
	--inner join Repair_UBF_MD_UIAction ruf on rt.AuthorityItem = ruf.ID  and rt.AuthorityItemType =32 
	--inner join UBF_MD_UIAction uf on uf.UID = ruf.UID  
	
	
----正式修复ID
	
--	update UBF_Security_Task set AuthorityItemId = (select ainewID from temp_Repair_Task_Form where UBF_Security_Task.ID =temp_Repair_Task_Form.id ) where ID in (select ID from temp_Repair_Task_Form) 
--	update UBF_Security_Task set AuthorityItemId = (select ainewID from temp_Repair_Task_Field where UBF_Security_Task.ID =temp_Repair_Task_Field.id ) where ID in (select ID from temp_Repair_Task_Field)
--	update UBF_Security_Task set AuthorityItemId = (select ainewID from temp_Repair_Task_Action where UBF_Security_Task.ID =temp_Repair_Task_Action.id ) where ID in (select ID from temp_Repair_Task_Action)		
	
--	update UBF_Security_AuthorityCredential set AuthorityItem =( select ainewID from temp_Repair_AuthorityCredential_Form where UBF_Security_AuthorityCredential.ID =temp_Repair_AuthorityCredential_Form.id ) where ID in (select ID from temp_Repair_AuthorityCredential_Form)
	
--	update UBF_Security_AuthorityCredential set AuthorityItem =( select ainewID from temp_Repair_AuthorityCredential_Field where UBF_Security_AuthorityCredential.ID =temp_Repair_AuthorityCredential_Field.id ) where ID in (select ID from temp_Repair_AuthorityCredential_Field)
	
--	update UBF_Security_AuthorityCredential set AuthorityItem =( select ainewID from temp_Repair_AuthorityCredential_Action where UBF_Security_AuthorityCredential.ID =temp_Repair_AuthorityCredential_Action.id ) where ID in (select ID from temp_Repair_AuthorityCredential_Action)		

----删除临时表
--	drop table temp_Repair_Task_Form
--	drop table temp_Repair_Task_Field
--	drop table temp_Repair_Task_Action
--	drop table temp_Repair_AuthorityCredential_Form
--	drop table temp_Repair_AuthorityCredential_Field
--	drop table temp_Repair_AuthorityCredential_Action
	

--update UBF_Security_AuthorityCredential set AuthorityItem =( 
--	select rac.ID,rac.CreatedOn,rac.CreatedBy,rac.ModifiedOn,rac.ModifiedBy,rac.SysVersion,rac.Tag,rac.[User]
--		,uf.ID,rac.TaskType,rac.Org,rac.DynamicView,rac.Context,rac.Opinion,rac.AuthorityItemType,rac.DynamicViewID
--	  from Repair_UBF_Security_AuthorityCredential rac
--	inner join Repair_UBF_MD_UIForm ruf on rac.AuthorityItem = ruf.ID  and rac.AuthorityItemType =8 
--	inner join UBF_MD_UIForm uf on uf.UID = ruf.UID  
	
--insert into UBF_Security_AuthorityCredential 
--	select rac.ID,rac.CreatedOn,rac.CreatedBy,rac.ModifiedOn,rac.ModifiedBy,rac.SysVersion,rac.Tag,rac.[User]
--		,ufield.ID,rac.TaskType,rac.Org,rac.DynamicView,rac.Context,rac.Opinion,rac.AuthorityItemType,rac.DynamicViewID
--	  from Repair_UBF_Security_AuthorityCredential rac
--	inner join Repair_UBF_MD_UIField rufield on rac.AuthorityItem = rufield.ID  and rac.AuthorityItemType =16 
--	inner join UBF_MD_UIField ufield on ufield.UID = rufield.UID  
	
--insert into UBF_Security_AuthorityCredential 
--	select rac.ID,rac.CreatedOn,rac.CreatedBy,rac.ModifiedOn,rac.ModifiedBy,rac.SysVersion,rac.Tag,rac.[User]
--		,ua.ID,rac.TaskType,rac.Org,rac.DynamicView,rac.Context,rac.Opinion,rac.AuthorityItemType,rac.DynamicViewID
--	  from Repair_UBF_Security_AuthorityCredential rac
--	inner join Repair_UBF_MD_UIAction rua on rac.AuthorityItem = rua.ID  and rac.AuthorityItemType =32 
--	inner join UBF_MD_UIAction ua on ua.UID = rua.UID  





--select * from UBF_Security_AuthorityCredential ac
--	inner join UBF_MD_UIField uf on ac.AuthorityItem = uf.ID and ac.AuthorityItemType =16 
--	inner join Repair_UBF_MD_UIField ruf on uf.UID = ruf.UID 
	
--select rac.ID,rac.CreatedOn,rac.CreatedBy,rac.ModifiedOn,rac.ModifiedBy,rac.SysVersion,rac.Tag,rac.[User]
--		,uf.ID,rac.TaskType,rac.Org,rac.DynamicView,rac.Context,rac.Opinion,rac.AuthorityItemType,rac.DynamicViewID
--	  from Repair_UBF_Security_AuthorityCredential rac
--	inner join Repair_UBF_MD_UIField ruf on rac.AuthorityItem = ruf.ID  and rac.AuthorityItemType =16 
--	inner join UBF_MD_UIField uf on uf.UID = ruf.UID 

--select 


----清理修复表--确定修复成功后执行..

--select * from UBF_Security_AuthorityCredential 

--select * from UBF_Security_Task 
--update UBF_Security_Task set AuthorityItemId = (select uf.ID from Repair_UBF_Security_Task rt
--	inner join Repair_UBF_MD_UIForm ruf on rt.AuthorityItemId = ruf.ID  and rt.AuthorityItemType =8 
--	inner join UBF_MD_UIForm uf on uf.UID = ruf.UID and UBF_Security_Task.ID = rt.ID ) 
--	where AuthorityItemType =8 and ID in (select rt.ID from Repair_UBF_Security_Task rt
--	inner join Repair_UBF_MD_UIForm ruf on rt.AuthorityItemId = ruf.ID  and rt.AuthorityItemType =8 
--	inner join UBF_MD_UIForm uf on uf.UID = ruf.UID)
	

--select uf.id from Repair_UBF_Security_Task  rt 
--	join UBF_Security_Task on rt.ID =UBF_Security_Task.ID
--	inner join Repair_UBF_MD_UIForm ruf on rt.AuthorityItemId = ruf.ID  and rt.AuthorityItemType =8 
--	inner join UBF_MD_UIForm uf on uf.UID = ruf.UID  
	
--select * from UBF_Security_Task where AuthorityItemType =8 and ID in (select ID from Repair_UBF_Security_Task)
-- select ID from Repair_UBF_Security_Task where AuthorityItemType =8
	
--	drop table temp_Repair_Task
--	select rt.ID as id , uf.ID as ainewId into temp_Repair_Task from Repair_UBF_Security_Task rt
--	inner join Repair_UBF_MD_UIForm ruf on rt.AuthorityItemId = ruf.ID  and rt.AuthorityItemType =8 
--	inner join UBF_MD_UIForm uf on uf.UID = ruf.UID  
	
--	update UBF_Security_Task set AuthorityItemId = (select ainewID from temp_Repair_Task where UBF_Security_Task.ID =temp_Repair_Task.id ) where ID in (select ID from temp_Repair_Task)

--            update a set a.authorityitem = f.ID from UBF_Security_AuthorityCredential a  
--			inner join Repair_UBF_Security_AuthorityCredential ra on a.ID = ra.ID and ra.AuthorityItemType =8
--			inner join Repair_UBF_MD_UIForm rf on ra.AuthorityItem =  rf.ID 
--			inner join UBF_MD_UIForm f on f.UID = rf.UID 
			
--            left join ubf_md_uiform_bak2 b on a.authorityitem = b.ID 
--            left join ubf_md_uiform c on b.UID = c.UID and b.ID != c.ID  
--            where a.authorityitemtype = 8 and not c.id is null 
            
            
-- select * from vw_UBF_Security_Right_Task as st 
--	inner join Base_UserOrgRole as uor	on st.RoleId = uor.[Role]
--	inner join Base_UserOrg as uo on uor.UserOrg = uo.ID  and st.OrgId = uo.Org 
--	where st.AuthorityItemTypeId =8 or st.AuthorityItemTypeId =16 or st.AuthorityItemTypeId =32
	
--select COUNT(*) from UBF_Security_AuthorityCredential  where AuthorityItemType =8 or AuthorityItemType =16 or AuthorityItemType =32

权限修复.sql (17.36 kb)

 

测试库出现:key重复修复脚本:


delete UBF_Security_Task where ID in (
select a.ID from ubf_security_task a
 inner join ubf_security_task b on a.ID != b.ID 
  and a.AuthorityItemId = b.AuthorityItemId and a.TaskType = b.TaskType
  and a.ID > b.ID )
 
delete UBF_Security_Right where ID IN ( 
select r.ID from UBF_Security_Right r left join UBF_Security_Task t
 on r.Task = t.ID  where t.ID is null)
  
delete UBF_Security_RightAssign where ID IN ( 
select ra.ID from UBF_Security_RightAssign ra left join UBF_Security_Right r
 on ra.[Right] = r.ID  where r.ID is null)
GO 


declare @StartSn bigint
declare @allowNum bigint
delete UBF_Security_AuthorityCredential  where [USER] != 1 --EA账号为预置
set  @allowNum = @@rowcount*3+100000
exec AllocSerials @allowNum,@StartSn output
   insert into UBF_Security_AuthorityCredential(ID,CreatedOn,CreatedBy, 
      ModifiedOn,ModifiedBy,SysVersion,Tag,[User],AuthorityItem,TaskType, 
      Org,DynamicViewID,Context,Opinion,AuthorityItemType,MenuGUID,EntityFullName,AuthorityItemGUID)      
   select
    @StartSN + Row_Number() over(order by t.AuthorityItemId)
    ,DateAdd(day,-1,GetDate()),Host_Name()
    ,DateAdd(day,-1,GetDate()),Host_Name()
    ,0,
    t.Description,
    t.[User],
    t.AuthorityItemId,t.TaskTypeId,
    t.OrgId,
    t.DynamicViewID
    ,t.Context,min(t.Opinion)
    ,t.AuthorityItemTypeId
    ,t.MenuGUID
    ,t.EntityFullName
    ,t.AuthorityItemGUID
   from(
    select
     a.Description,
     uo.[USER],
     a.OrgId,
     a.AuthorityItemId,a.TaskTypeId,
     a.DynamicViewID
     ,a.Context,a.Opinion
     ,a.AuthorityItemTypeId
     ,a.MenuGUID
     ,a.EntityFullName
     ,a.AuthorityItemGUID
    from
     vw_UBF_Security_Right_Task a
     inner join Base_UserOrg uo on uo.Org = a.OrgId
     inner join Base_UserOrgRole uor on uor.UserOrg = uo.ID
     and a.RoleId = uor.Role
     ) t
   group by
    t.Description,t.[User],t.AuthorityItemId,t.TaskTypeId,t.OrgId
    ,t.DynamicViewID,t.Context,t.Opinion
    ,t.AuthorityItemTypeId,t.MenuGUID,t.EntityFullName,t.AuthorityItemGUID
    
GO  

 

 

 

Tags:

评论 (1) -

Stahlwandpool 美国 wrote at 2020/4/24 14:15:54 #

Great goods from you, man. I have understand your stuff prior to and you're simply extremely wonderful. I actually like what you have got here, certainly like what you are saying and the way during which you are saying it. You are making it entertaining and you still take care of to keep it sensible. I can not wait to read much more from you. That is actually a great site.

添加评论



biuquote
微笑得意调皮害羞酷大笑惊讶发呆喜欢可怜尴尬闭嘴噘嘴皱眉伤心抓狂呕吐坏笑漫骂发怒
Loading


RecentComments

评论 RSS

Statistics

989 篇文章
0 个单页
775879 条评论
11 次评分
1443270 次访问
访问统计开始于 2019年12月15日
平均日访问 6807 次
当前 130 人在线