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


create procedure mps_updatecompany 
@cmpid int ,
@cmp_fullname nvarchar(100),
@cmp_type nvarchar(50),
@cmp_tele varchar(30),
@cmp_address nvarchar(100),
@cmp_license varchar(50),
@cmp_taxcode varchar(50),
@cmp_master nvarchar(50),
@cmp_mobile varchar(20),
@cmp_www varchar(100),
@cmp_sshy nvarchar(50),
@cmp_qyxz nvarchar(50)
as
begin
update pub_company set 
cmp_fullname=case when @cmp_fullname='_none_' then cmp_fullname else @cmp_fullname end ,
cmp_type=case when @cmp_type='_none_' then cmp_type else @cmp_type end ,
cmp_tele=case when @cmp_tele='_none_' then cmp_tele else @cmp_tele end ,
cmp_address=case when @cmp_address='_none_' then cmp_address else @cmp_address end ,
cmp_license=case when @cmp_license='_none_' then cmp_license else @cmp_license end ,
cmp_taxcode=case when @cmp_taxcode='_none_' then cmp_taxcode else @cmp_taxcode end ,
cmp_master=case when @cmp_master='_none_' then cmp_master else @cmp_master end ,
cmp_mobile=case when @cmp_mobile='_none_' then cmp_mobile else @cmp_mobile end ,
cmp_www=case when @cmp_www='_none_' then cmp_www else @cmp_www end ,
cmp_sshy=case when @cmp_sshy='_none_' then cmp_sshy else @cmp_sshy end ,
cmp_qyxz=case when @cmp_qyxz='_none_' then cmp_qyxz else @cmp_qyxz end  
where cmp_id=@cmpid 
end