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

-- 生成时间:2018-06-22 10:31:05 by ebs-core  
CREATE  procedure order_41_806_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_41 where ord_id=@ordid 
 ---- 以下是开发人员写的 before link job 事件 --------------
 /*更新合同签订次数*/ 
declare  @cs int;
declare @gh nvarchar(20)
select  @gh=ord_gh  from #romaster
select @cs=(select count(*) from order_41 where ord_gh = @gh)

update r
set r.ord_htqdcs=@cs,
    r.ord_updated = GETDATE()
from #romaster n,order_40 r
where r.ord_gh=n.ord_gh 
 ---- 以上是开发人员写的 before libk job 事件 --------------
 
  
 
 
--- 清除临时表 
exec drop_temp_table '#romaster' 

set nocount off 
end