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

-- 生成时间:2018-11-29 10:28:51 by ebs-core  
CREATE  procedure order_243_3097_wrknew_after(
     @cmpid int, 
     @useruid int, 
     @bizid int, 
     @ordid bigint, 
     @wrkid int, 
     @jbid bigint 
  ) 
as  
begin  
set nocount on  
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
declare @autoapplycode varchar(50) 
  set @autoapplycode =  ''
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_243 with(nolock) where ord_id=@ordid 
 ---- 以下是开发人员写的 after new job 事件 --------------
 IF EXISTS (SELECT 1 FROM #master where ord_zdzx = 1)
begin
set @autoapplycode=dbo.applycurrentflow(0,0,0)
end
 ---- 以上是开发人员写的 after new job 事件 --------------
 
 
--- 清除临时表 
exec drop_temp_table '#master' 

--以下代码是自动执行工作步骤 
if (@autoapplycode<>'') 
begin 
exec mps_do_execute_job_auto2  
@cmpid  , 
-1 , 
-1 , 
@useruid , 
-1 , 
@autoapplycode , 243,
@ordid  
end 

set nocount off 
end