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

-- 生成时间:2018-11-28 11:55:07 by ebs-core  
create  procedure order_255_startmessage_3203(
     @cmpid int, 
     @ordid bigint,
     @jbid bigint
  ) 
  as  
  begin  
set nocount on  
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED

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

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

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

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

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

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

insert into ebs_kernel.dbo.pub_message(msg_cmpid,msg_mpid,msg_text,msg_senddate,msg_type,msg_target,msg_cuid)  
select @cmpid,27,'【'+ ord_mddz + '】店长你好！本次门店维护巡检，你负责的门店没问题'
+'{title}维护巡检没问题提醒:'+ord_type+char(9)+
+'{url}/order/biztop.mobile.htm?crmid='+CONVERT(varchar,ord_bizid)+'&ordid='+CONVERT(varchar,ord_id)+'&jbid='+CONVERT(varchar,jb_id),getdate(),'DING',substring(cu_ding , 22,50)    , cu_id 
from order_255 with(nolock) ,mps_job with(nolock) ,mps_login  with(nolock) 
where  ord_id=@ordid and  jb_id=@jbid and ord_xzmddzid=cu_id and  
cu_type=0 and cu_ding>'' 

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

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


set nocount off  
end