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

-- 生成时间:2018-06-26 15:28:03 by ebs-core  
create  procedure order_227_2833_alarm_task(
     @cmpid int, 
     @bizid int, 
     @wrkid int,
     @ordid bigint,
     @jbid bigint 
  ) 
as  
begin  

if (not exists (select 1 from mps_job_task where wt_cmpid=@cmpid and wt_bizid=@bizid and wt_wrkid=@wrkid and wt_ordid=@ordid and wt_mbid=27 and wt_jbid=@jbid and wt_type='wrkalarm')) 
insert into mps_job_task(wt_begin,wt_jbid,wt_wrkid,wt_cmpid,wt_bizid,wt_ordid,wt_useruid,wt_task,wt_interval,wt_mbid,wt_type) 
values(getdate(),@jbid,2833,1,227,@ordid,0,'exec order_227_alarm_2833_27 1,227,'+convert(varchar(10),@ordid)+',2833,'+convert(varchar(10),@jbid)+',27,@taskid',5,27,'wrkalarm') 

end