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

-- 生成时间:2018-06-20 17:57:35 by ebs-core  
CREATE  procedure order_94_1019_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_94 where ord_id=@ordid 
 ---- 以下是开发人员写的 before link job 事件 --------------
 /*将入住人员写入到宿舍档案中*/
insert into order_93_3(ord2_ordid,ord2_gh,ord2_xm,ord2_lxfs,ord2_zw,ord2_pqbm,ord2_bz1,ord2_tag)
select n.ord_ssordid,n.ord_gh,n.ord_creator,n.ord_lxdh,n.ord_zw,n.ord_createdepart,n.ord_bz,3
from #romaster n
 

 ---- 以上是开发人员写的 before libk job 事件 --------------
 
  
 
 
--- 清除临时表 
exec drop_temp_table '#romaster' 

set nocount off 
end