IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_check_weixinbind_bak]') AND type = 'P')
DROP PROCEDURE [dbo].[mps_check_weixinbind_bak]
GO
-- =============================================      
-- Author:  郑华建  
-- Create date: 2018年1月8日 15点46分  
-- Description: 检测微信的绑定情况,如果查找到了用户信息则,则返回cu_id,并写登录日志     
-- =============================================      
CREATE PROCEDURE [dbo].[mps_check_weixinbind_bak] 
@identity varchar(500)      
AS      
BEGIN      
 -- SET NOCOUNT ON added to prevent extra result sets from      
 -- interfering with SELECT statements.      
       
 SET NOCOUNT ON;        
 declare @cuid int      
      
      
 select @cuid=cu_id from mps_login       
 where cu_qyh=@identity       
 or cu_gzh1=@identity       
 or cu_gzh2=@identity       
 or cu_gzh3=@identity       
 or cu_gzh4=@identity       
 or cu_gzh5=@identity       
 or cu_ding=@identity; 

 select @cuid as cu_id
END