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

-- 生成时间:2018-05-04 09:51:48 by ebs-core  
CREATE  procedure order_32_modify_103_after(
     @cmpid int,
     @branchid int,
     @userdpid int,
     @useruid int,
     @userotid int,
     @jbid bigint,
     @ordid bigint,
     @ord2tag int,
     @ord2id bigint
  ) 
as  
begin  
set nocount on  
declare @sys_recid bigint 
set @sys_recid = 0 
 declare @nonedate datetime 
set @nonedate = CONVERT(datetime,'1910-1-1')
declare @ord2group2 nvarchar(50) 
set @ord2group2 = '' 
 --- 以下是预处理事件中的临时表
 --- #old 与 #new 在主体中已经生成
 
 ---- 以下是开发人员写的 after modify details order 事件 --------------
 /*在完成状态为完成的情况下删除当前任务*/
delete mps_task 
from order_32_103 
where   tsk_cuid = ord2_rzcuid  
and isnull(ord2_jjzt,'') ='已完成'
and ord2_ordid = @ordid 
and ord2_rzcuid = @useruid
and tsk_objid = @ordid
and tsk_objtype='biz'

 ---- 以上是开发人员写的 after modify details order 事件 --------------
 
 
--- 清除临时表 

set nocount off 
end