IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_update_weixin_qyh]') AND type = 'P')
DROP PROCEDURE [dbo].[mps_update_weixin_qyh]
GO
-- =============================================
-- Author:<Author,,Name>
-- Create date: <Create Date,,>
-- Description:<Description,,>
-- =============================================
CREATE procedure [dbo].[mps_update_weixin_qyh] 
@wx_cmpid [int],
@wx_id [int],
@wx_code [varchar](32) ,
@wx_title [nvarchar](100) ,
@wx_appid [int] ,
@wx_token [varchar](64) ,
@wx_aeskey [varchar](64) ,
@wx_appsecret [varchar](64) 


AS
BEGIN
SET NOCOUNT ON;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
update [ebs_kernel].[dbo].pub_weixin set
    [wx_code]= case when @wx_code='_none_' then [wx_code]  else @wx_code end
    
where wx_type='QYH' and wx_cmpid=@wx_cmpid


update [ebs_kernel].[dbo].pub_weixin set
[wx_appsecret]= case when @wx_appsecret='_none_' then [wx_appsecret]  else @wx_appsecret end,
[wx_token]= case when @wx_token='_none_' then [wx_token]  else @wx_token end,
    [wx_aeskey]= case when @wx_aeskey='_none_' then [wx_aeskey]  else @wx_aeskey end,
[wx_appid]= case when @wx_appid=-999999999 then [wx_appid]  else @wx_appid end,
[wx_title]= case when @wx_title='_none_' then [wx_title]  else @wx_title end
where wx_id=@wx_id

END