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

-- 生成时间:2018-11-22 18:21:19 by ebs-core  
create  procedure order_239_startmessage_3079(
     @cmpid int, 
     @ordid bigint,
     @jbid bigint
  ) 
  as  
  begin  
set nocount on  
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED

------ 给执行人发消息  ----------  

------ 给监督人发消息  ----------  

------ 给协作人发消息  ----------  

------ 给知会人发消息  ----------  

------ 给日志参与人发消息  ----------  

------ 给员工1发消息  ----------  

------ 给员工2发消息  ----------  

------ 给员工3发消息  ----------  

insert into ebs_kernel.dbo.pub_message(msg_cmpid,msg_mpid,msg_text,msg_senddate,msg_type,msg_target,msg_cuid)  
select @cmpid,21,'{name}小' +  SUBSTRING(ord_creator,1,1)   + '{number}' + ord_phone  + '{store}' +  ord_location ,getdate(),'DAYU',ord_hm  , 0  
from order_239   with(nolock) 
where  ord_id=@ordid and len(ord_hm)>=11 


set nocount off  
end