IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_warehouse_operation_detail]') AND type = 'U')
CREATE TABLE [dbo].[mps_warehouse_operation_detail]
(
    [whopd_whopid] bigint NOT NULL DEFAULT((0)),
    [whopd_whgid] bigint NOT NULL DEFAULT((0)),
    [whopd_amount] decimal(18, 4) NULL DEFAULT((0)),
    [whopd_fee] decimal(18, 4) NULL DEFAULT((0)),
    [whopd_operation] int NULL DEFAULT((1)),
    [whopd_baseamount] decimal(18, 4) NULL DEFAULT((0)),
    [whopd_tag] int NULL DEFAULT((0)),
    [whopd_prdid] int NULL DEFAULT((0)),
    [whopd_unit] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [whopd_batch] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL DEFAULT(''),
    [whopd_whid] int NULL DEFAULT((0)),
    [whopd_date] datetime NULL DEFAULT(getdate()),
    CONSTRAINT [PK_mps_warehouse_operation_detail] PRIMARY KEY ([whopd_whopid] ASC,[whopd_whgid] ASC)
)