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

-- 生成时间:2018-11-22 18:21:24 by ebs-core  
create  procedure order_246_endmessage_3124_3462(
     @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,22,ord_createdepart + '/' + ord_creator + '于【'+convert(nvarchar(100),ord_date,120)+'】发布了一个新的通知，请及时查看！'+char(13)+char(10)+
+'{title}通知公告:'+ord_bt+char(9)+
+'{url}/doc/doc.mobile.htm?docid='+CONVERT(varchar(100),ord_sobjid)+'&dcid=86',getdate(),'DING',substring(cu_ding , 22,50)    , cu_id 
from order_246 with(nolock)  ,order_246_users with(nolock),mps_login with(nolock) 
where  ord_id=@ordid and  ordp_ordid=ord_id and ordp_type='mydocview' and cu_id=ordp_cuid and  
cu_type=0 and cu_ding>'' 

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

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


set nocount off  
end