IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[order_172_1717_wrklink_after]') AND type = 'P')
DROP PROCEDURE [dbo].[order_172_1717_wrklink_after]
GO

-- 生成时间:2018-01-19 11:56:28 by ebs-core  
CREATE  procedure order_172_1717_wrklink_after(
     @cmpid int, 
     @useruid int,
     @bizid int, 
     @ordid bigint, 
     @wrkid int, 
     @jbid bigint, 
     @wsid int, 
     @wsstatus nvarchar(50) 
  ) 
as  
begin  
set nocount on  
declare @nonedate datetime 
set @nonedate = CONVERT(datetime,'1910-1-1')
declare @ord2group2 nvarchar(50) 
set @ord2group2 = '' 
declare @sys_recid bigint 
set @sys_recid = 0 
  
 --- 以下是预处理事件中的临时表
 
exec drop_temp_table '#romaster' 
select * into #romaster from order_172 where ord_id=@ordid 
 ---- 以下是开发人员写的 before link job 事件 --------------
 /*更新宿舍档案的合同编号*/
declare @ftype int
select @ftype=ord_fbizid from #romaster

if @ftype =93 
begin 
update r
set r.ord_htbh = n.ord_htbh
from #romaster n,order_93 r
where r.ord_id = n.ord_fordid
end
 ---- 以上是开发人员写的 before libk job 事件 --------------
 
  
 
 
--- 清除临时表 
exec drop_temp_table '#romaster' 

set nocount off 
end