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

CREATE proc [dbo].[up_employee_info] 
@cu_gender int,
@cu_mobile varchar(255),
@cu_dpid int,
@cu_depart varchar(255),
@cu_bcid int,
@cu_birth varchar(255),
@cu_email varchar(255),
@cu_contact varchar(255),
@cu_address varchar(255),
@cu_major varchar(255),
@cu_qq varchar(255),
@cu_otid int,
@cu_title nvarchar(50),
@cu_function int, 
@cu_id int
as
begin
set nocount on

update mps_employee  
set cu_gender=@cu_gender,
cu_mobile=@cu_mobile,
cu_dpid=@cu_dpid,cu_depart=@cu_depart,
cu_bcid=@cu_bcid,
cu_birth=@cu_birth,
cu_email=@cu_email,
cu_contact=@cu_contact,
cu_address=@cu_address,
cu_major=@cu_major,
cu_qq=@cu_qq,
cu_otid=@cu_otid,
cu_title=@cu_title,
cu_function=@cu_function 
where cu_id=@cu_id

update mps_login  
set cu_function=@cu_function 
where cu_objid=@cu_id
set nocount off
end

update ebs_kernel..pub_sql
set sql_text='up_employee_info  {cu_gender},''{cu_mobile}'',{cu_dpid},''{cu_depart}'',{cu_bcid},''{cu_birth}'',''{cu_email}'',''{cu_contact}'',''{cu_address}'',''{cu_major}'',''{cu_qq}'',{cu_otid},''{cu_title}'',{cu_function},{cuid}',
sql_params='int|varchar(255)|int|varchar(255)|int|varchar(255)|varchar(255)|varchar(255)|varchar(255)|varchar(255)|varchar(255)|int|nvarchar(50)|int|int'
where sql_name='up_employee'