IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_login]') AND type = 'U')
CREATE TABLE [dbo].[mps_login]
(
    [cu_id] int NOT NULL,
    [cu_cmpid] int NOT NULL DEFAULT((0)),
    [cu_type] int NOT NULL DEFAULT((0)),
    [cu_objid] int NOT NULL DEFAULT((0)),
    [cu_account] varchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_callname] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [cu_gender] int NOT NULL DEFAULT((0)),
    [cu_pass] nvarchar(32) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cu_bcid] int NOT NULL DEFAULT((0)),
    [cu_branch] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cu_dpid] int NOT NULL DEFAULT((0)),
    [cu_depart] nvarchar(200) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cu_otid] int NOT NULL DEFAULT((0)),
    [cu_title] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cu_function] int NOT NULL DEFAULT((0)),
    [cu_mobile] varchar(20) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cu_qyh] varchar(60) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cu_ding] varchar(60) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cu_gzh1] varchar(60) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cu_gzh2] varchar(60) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cu_gzh3] varchar(60) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cu_gzh4] varchar(60) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cu_gzh5] varchar(60) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cu_managelevel] int NOT NULL DEFAULT((0)),
    [cu_professionlevel] int NOT NULL DEFAULT((0)),
    [cu_otlevel] int NOT NULL DEFAULT((0)),
    [cu_departtitles] nvarchar(500) COLLATE Chinese_PRC_CI_AS NOT NULL DEFAULT(''),
    [cu_ccid] bigint NULL DEFAULT((0)),
    [cu_loginscope] varchar(150) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
)

IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE object_id = OBJECT_ID('[dbo].[mps_login]') AND name = 'mps_login_account_index')
CREATE NONCLUSTERED INDEX [mps_login_account_index] ON [dbo].[mps_login]([cu_cmpid] ASC)

IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE object_id = OBJECT_ID('[dbo].[mps_login]') AND name = 'mps_login_account_index')
CREATE NONCLUSTERED INDEX [mps_login_account_index] ON [dbo].[mps_login]([cu_type] ASC)

IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE object_id = OBJECT_ID('[dbo].[mps_login]') AND name = 'mps_login_account_index')
CREATE NONCLUSTERED INDEX [mps_login_account_index] ON [dbo].[mps_login]([cu_account] ASC)

IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE object_id = OBJECT_ID('[dbo].[mps_login]') AND name = 'mps_login_mobile_index')
CREATE NONCLUSTERED INDEX [mps_login_mobile_index] ON [dbo].[mps_login]([cu_cmpid] ASC)

IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE object_id = OBJECT_ID('[dbo].[mps_login]') AND name = 'mps_login_mobile_index')
CREATE NONCLUSTERED INDEX [mps_login_mobile_index] ON [dbo].[mps_login]([cu_type] ASC)

IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE object_id = OBJECT_ID('[dbo].[mps_login]') AND name = 'mps_login_mobile_index')
CREATE NONCLUSTERED INDEX [mps_login_mobile_index] ON [dbo].[mps_login]([cu_objid] ASC)

IF NOT EXISTS (SELECT 1 FROM sys.indexes WHERE object_id = OBJECT_ID('[dbo].[mps_login]') AND name = 'mps_login_mobile_index')
CREATE NONCLUSTERED INDEX [mps_login_mobile_index] ON [dbo].[mps_login]([cu_mobile] ASC)