CREATE PROCEDURE dbo.GetMembersList
(
@members_type varchar(50),
@memberKey varchar(50)
)
AS
select * from members where (members_type=@members_type or @members_type='') and ((members_kh like '%'+ @memberKey+'%' or @memberKey='') or (members_name like '%'+@memberKey+'%' or @memberKey='') or (members_tel like '%'+@memberKey+'%' or @memberKey='') or (members_QQ like '%'+@memberKey+'%' or @memberKey='')
or (members_email like '%'+@memberKey+'%' or @memberKey='') or (members_address like '%'+@memberKey+'%' or @memberKey='') or (members_sfz like '%'+@memberKey+'%' or @memberKey='') or (introducer like '%'+@memberKey+'%' or @memberKey='') or (members_birthday like '%'+@memberKey+'%' or @memberKey='')
or (members_beizhu like '%'+@memberKey+'%' or @memberKey=''))
RETURN
GO