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

-- 生成时间:2018-06-22 10:46:07 by ebs-core  
create  procedure order_99_alarm_task(
     @cmpid int, 
     @bizid int, 
     @ordid bigint
  ) 
as  
begin  

 if (not exists (select 1 from mps_job_task where wt_cmpid=@cmpid and wt_bizid=@bizid and wt_ordid=@ordid and wt_wrkid=0 and wt_mbid=28 and wt_jbid=0 and wt_type='bizalarm')) 
insert into mps_job_task(wt_begin,wt_wrkid,wt_cmpid,wt_bizid,wt_ordid,wt_useruid,wt_task,wt_jbid,wt_interval,wt_mbid,wt_type) 
values(getdate(),0,1,99,@ordid,0,'exec order_99_alarm_28 1,99,'+convert(varchar(10),@ordid)+',28,@taskid',0,60,28,'bizalarm') 

end