ALTER proc [dbo].[XSYW_DXSJL]
@P0 UNIQUEIDENTIFIER
AS
begin
declare @DCNAMECHS varchar(50),
@DCNO varchar(50)
select @DCNO=FZXS from XSKH_1 where VGUID=@P0
select @DCNAMECHS=vguid from CSEMPL_1 where DCDEPT =(
select VGUID from CSORGA_1 where vguid=(
select DCDEPT from CSEMPL_1 where dcno=@DCNO)) and DCPOSI=(
select vguid from CSPOSI_1 where PDESCCHS='经理' and oguid=(
select vguid from CSORGA_1 where vguid=(
select DCDEPT from CSEMPL_1 where dcno=@DCNO)))
update XSKH_1 set FZXSJL =@DCNAMECHS where VGUID=@P0
end