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

-- =============================================  
-- Author:  <Author,,Name>  
-- Create date: <Create Date,,>  
-- Description: <Description,,>  
-- =============================================  
CREATE procedure [dbo].[mps_update_weixin_state]  
@wxs_id int,  
@wxs_code varchar(100),  
@wxs_caption nvarchar(500),  
@wxs_value nvarchar(500),  
@wxs_qyh int,
@wxs_gzh int,
@wxs_ding int
AS  
BEGIN   
 SET NOCOUNT ON;  
 update mps_weixinstate set 
 wxs_code = case when @wxs_code = '_none_' then wxs_code else @wxs_code end,
 wxs_caption = case when @wxs_caption = '_none_' then wxs_caption else @wxs_caption end,
 wxs_value = case when @wxs_value = '_none_' then wxs_value else @wxs_value end,
 wxs_qyh = case when @wxs_qyh = -999999999 then wxs_qyh else @wxs_qyh end,
 wxs_gzh = case when @wxs_gzh = -999999999 then wxs_gzh else @wxs_gzh end,
 wxs_ding = case when @wxs_ding = -999999999 then wxs_ding else @wxs_ding end
 where wxs_id = @wxs_id
END