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

-- 生成时间:2018-02-06 16:18:15 by ebs-core  
create  procedure order_41_alarm_addtask(
     @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_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,41,@ordid,0,'exec order_41_alarm_1 1,41,'+convert(varchar(10),@ordid)+',1',0,60,1,'bizalarm') 

end