第一步:系统库执行
--系统库执行,先判断是否取消了云应用,没有取消直接取消云应用--
update EAP_Account set OpenCloudAppState=0 where cAcc_Num='001' and OpenCloudAppState<>0
go
insert INTO EAP_User(cAcc_Num, UserID, Name, Password,IsControlLogin,GroupName, RealName)
VALUES ( '001', '304','demo4','uGor4c5wDJyHgA6BaI5uBw==','1','账套主管组','主管') --需修改 账套号、id、账号、姓名
go
优化后操作步骤:
--系统库执行,先判断是否取消了云应用,没有取消直接取消云应用--
declare @账套号 INT, @用户账号id varchar(100),
@用户账号 varchar(100),@用户名称 varchar(100)
set @账套号='001';
SET @用户账号id='334';
SET @用户账号='demo6';
SET @用户名称='主管';
update EAP_Account set OpenCloudAppState=0 where cAcc_Num=@账套号 and OpenCloudAppState<>0
insert INTO EAP_User(cAcc_Num, UserID, Name, Password,IsControlLogin,GroupName, RealName)
VALUES ( @账套号, @用户账号id,@用户账号,
'uGor4c5wDJyHgA6BaI5uBw==','1','账套主管组',@用户名称)
第二步:账套库执行
--先检测账套是否为云应用,云应用账套自动关闭云应用;然后增加账套主管组用户--
update EAP_AccInformation set Value='Stopped' where Name='CSPOrgState' and Value <>'Stopped'
GO
SET IDENTITY_INSERT EAP_User on
go
insert INTO EAP_User(Code, name, isAdmin, isStoped, AuthState, PersonName, issystem, ShowNewFuncIntro, OrderNum, id, IdMarketingOrgan, ActorType, IsHeadQuarters, UpgradePwdState, IsWeb, IsMobile, IsDst, IsControlLogin, Password)
VALUES('主管' ,'demo4','1','0','0',
'主管','0','0','1','304','1','0','1','0','1','0','0','1','uGor4c5wDJyHgA6BaI5uBw==') --需修改账号、id、姓名
go
SET IDENTITY_INSERT EAP_User off
go
insert INTO EAP_UserGroupRelation(groupid, UserId) VALUES('5','304') --需修改id
go
优化后语句
--账套库修改用户账号,id 名称
update EAP_AccInformation set Value='Stopped' where Name='CSPOrgState' and Value <>'Stopped'
GO
SET IDENTITY_INSERT EAP_User on
go
declare @账套号 INT, @用户账号id varchar(100),
@用户账号 varchar(100),@用户名称 varchar(100)
set @账套号='001';
SET @用户账号id='334';
SET @用户账号='demo6';
SET @用户名称='主管';
insert INTO EAP_User(Code, name, isAdmin, isStoped, AuthState, PersonName, issystem, ShowNewFuncIntro, OrderNum, id, IdMarketingOrgan, ActorType, IsHeadQuarters, UpgradePwdState, IsWeb, IsMobile, IsDst, IsControlLogin, Password)
VALUES(@用户名称 ,@用户账号,'1','0','0',
@用户名称,'0','0','1',@用户账号id,'1','0','1','0','1','0','0','1','uGor4c5wDJyHgA6BaI5uBw==')
insert INTO EAP_UserGroupRelation(groupid, UserId) VALUES('5',@用户账号id)
go
SET IDENTITY_INSERT EAP_User off
go