IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[order_243]') AND type = 'U')
CREATE TABLE [dbo].[order_243]
(
    [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_clhs] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_clym] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_clzt] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [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_fgcs] bigint 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_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_whry] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_whwcsj] datetime NULL DEFAULT('1900-1-1'),
    [ord_xqlx] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_xqms_bak_20181114162927437] nvarchar(2000) COLLATE Chinese_PRC_CI_AS NULL,
    [ord_zhmyd] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_syrcuid] bigint NULL DEFAULT((0)),
    [ord_clpj] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_clsj] datetime NULL DEFAULT('1900-1-1'),
    [ord_spzxcl] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT('否'),
    [ord_pdspzjgwtr] int NULL DEFAULT((0)),
    [ord_wtr] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_wtry] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_ord_status] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_wtzt] bigint NULL DEFAULT((0)),
    [ord_sfwt] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT('否'),
    [ord_zxclsm] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_dfqk] bigint NULL DEFAULT((0)),
    [ord_wxysj] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_wxysj1] bigint NULL DEFAULT((0)),
    [ord_jbrxysj] datetime NULL DEFAULT('1900-1-1'),
    [ord_jbrwtsj] datetime NULL DEFAULT('1900-1-1'),
    [ord_clhs1] bigint NULL DEFAULT((0)),
    [ord_zjgwtrsj] datetime NULL DEFAULT('1900-1-1'),
    [ord_wxysj2] bigint NULL DEFAULT((0)),
    [ord_mxysj] decimal(18, 2) NULL DEFAULT((0)),
    [ord_zdzx] bigint NULL DEFAULT((0)),
    [ord_sobjid] bigint NULL DEFAULT((0)),
    [ord_authority_factor] int NULL DEFAULT((0)),
    [ord_xqms] nvarchar(2000) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_jbexecutor] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_jbtitle] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [ord_wrkid] int NULL DEFAULT((0)),
    [ord_xwwcsj] datetime NULL DEFAULT('1900-1-1'),
    CONSTRAINT [order_243_pk] PRIMARY KEY ([ord_id] ASC)
)

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

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

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

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

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

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

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

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

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

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

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