IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[order_268]') AND type = 'U')
CREATE TABLE [dbo].[order_268]
(
    [ord_bcid] int NULL DEFAULT((0)),
    [ord_bizid] int NULL DEFAULT((0)),
    [ord_branch] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_cbid] bigint NULL DEFAULT((0)),
    [ord_cmpid] int NULL DEFAULT((0)),
    [ord_createbizids] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_createcuid] int NULL DEFAULT((0)),
    [ord_createdepart] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_createdpid] int NULL DEFAULT((0)),
    [ord_creator] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_cuid] int NULL DEFAULT((0)),
    [ord_date] datetime NULL DEFAULT(getdate()),
    [ord_depart] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_dpid] int NULL DEFAULT((0)),
    [ord_empname] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_enddate] datetime NULL DEFAULT('1900-1-1'),
    [ord_fbizid] int NULL DEFAULT((0)),
    [ord_finished] int NULL DEFAULT((0)),
    [ord_fjbid] bigint NULL DEFAULT((0)),
    [ord_ford2id] bigint NULL DEFAULT((0)),
    [ord_ford2tag] int NULL DEFAULT((0)),
    [ord_fordid] bigint NULL DEFAULT((0)),
    [ord_ftype] varchar(10) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_groupkey] char(32) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_id] bigint NOT NULL IDENTITY(1, 1),
    [ord_key] varchar(30) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_no] varchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_noi] int NULL DEFAULT((0)),
    [ord_rbizid] int NULL DEFAULT((0)),
    [ord_rord2id] bigint NULL DEFAULT((0)),
    [ord_rord2tag] int NULL DEFAULT((0)),
    [ord_rordid] bigint NULL DEFAULT((0)),
    [ord_rtype] varchar(10) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_security] int NULL DEFAULT((3)),
    [ord_sobjid] bigint NULL DEFAULT((0)),
    [ord_status] nvarchar(30) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_style] int NULL DEFAULT((0)),
    [ord_template] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_templateid] int NULL DEFAULT((0)),
    [ord_title] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_type] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_updated] datetime NULL DEFAULT(getdate()),
    [ord_authority_factor] int NULL DEFAULT((0)),
    CONSTRAINT [order_268_pk] PRIMARY KEY ([ord_id] ASC)
)

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

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

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

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

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

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

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

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

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

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