IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_employee]') AND type = 'U')
CREATE TABLE [dbo].[mps_employee]
(
    [cu_id] int NOT NULL IDENTITY(1, 1),
    [cu_cmpid] int NULL DEFAULT((0)),
    [cu_bcid] int NULL DEFAULT((0)),
    [cu_branch] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_dpid] int NULL DEFAULT((0)),
    [cu_depart] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_fastkey] varchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_code] varchar(255) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_account] varchar(255) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_star] int NULL DEFAULT((0)),
    [cu_gender] int NULL DEFAULT((1)),
    [cu_security] int NULL DEFAULT((3)),
    [cu_function] int NULL DEFAULT((0)),
    [cu_managelevel] int NULL DEFAULT((0)),
    [cu_professionlevel] int NULL DEFAULT((0)),
    [cu_otlevel] int NULL DEFAULT((0)),
    [cu_name] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_mobile] varchar(20) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_contact] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_nation] nvarchar(30) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_address] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_post] varchar(6) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_position] nvarchar(30) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_qq] varchar(20) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_identtype] nvarchar(10) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_identno] varchar(18) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_email] varchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_otid] int NULL DEFAULT((0)),
    [cu_title] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_dpid2] int NULL DEFAULT((0)),
    [cu_depart2] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_otid2] int NULL DEFAULT((0)),
    [cu_title2] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_dpid3] int NULL DEFAULT((0)),
    [cu_depart3] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_otid3] int NULL DEFAULT((0)),
    [cu_title3] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_duty] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_party] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_origin] nvarchar(30) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_academic] nvarchar(30) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_height] int NULL DEFAULT((0)),
    [cu_major] nvarchar(30) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_college] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_graduate] datetime NULL DEFAULT('1900-1-1'),
    [cu_degrees] nvarchar(30) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_marriage] nvarchar(10) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_entrytime] datetime NULL DEFAULT('1900-1-1'),
    [cu_dimission] datetime NULL DEFAULT('1900-1-1'),
    [cu_salary] int NULL DEFAULT((0)),
    [cu_status] nvarchar(10) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_login] int NULL DEFAULT((0)),
    [cu_icon] int NULL DEFAULT((1)),
    [cu_sign] int NULL DEFAULT((1)),
    [cu_birth] varchar(10) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_use] int NULL DEFAULT((0)),
    [cu_relationshipobj1] bigint NOT NULL DEFAULT((0)),
    [cu_power] varchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_ccphonenumber] varchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cu_type] int NULL DEFAULT((0)),
    [cu_ccid] bigint NULL DEFAULT((0)),
    [cu_loginscope] varchar(150) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    CONSTRAINT [PK_MPS_EMPLOYEE] PRIMARY KEY ([cu_id] ASC)
)


IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE object_id = OBJECT_ID('[dbo].[mps_employee]') AND name = 'mps_user_code_index')
CREATE UNIQUE NONCLUSTERED INDEX [mps_user_code_index] ON [dbo].[mps_employee]([cu_cmpid] ASC,[cu_bcid] ASC,[cu_code] ASC)