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

-- 生成时间:2018-05-28 18:55:11 by ebs-core  
CREATE  procedure order_48_2680_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 '#master' 
select * into #master from order_48 where ord_id=@ordid 
exec drop_temp_table '#rodetail105' 
select *  into #rodetail105 from order_48_105 where ord2_ordid=@ordid  

 ---- 以下是开发人员写的 before link job 事件 --------------
 delete mps_task 
from #rodetail105 with(nolock),#master with(nolock) 
where   tsk_cuid = ord2_pxcuid  
and  datediff(day,ord_jsrq,getdate())>=0
and ord2_ordid = @ordid 
and ord2_pxcuid = @useruid
and tsk_objid = @ordid
and tsk_objtype='biz'

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

set nocount off 
end