--生产月度在制查询
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_POM_PRODWIPBILL') 
CREATE TABLE T_POM_PRODWIPBILL (
  FID BIGINT DEFAULT 0 NOT NULL,
  FBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL,
  FBILLSTATUS NVARCHAR(1) DEFAULT ' ' NOT NULL,
  FCREATORID BIGINT DEFAULT 0 NOT NULL,
  FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
  FAUDITORID BIGINT DEFAULT 0 NOT NULL,
  FAUDITDATE DATETIME,
  FMODIFYTIME DATETIME,
  FCREATETIME DATETIME,
  FORGID BIGINT DEFAULT 0 NOT NULL
);

--生产月度在制查询_在制信息
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_POM_PRODWIPBILLENTRY') 
CREATE TABLE T_POM_PRODWIPBILLENTRY (
  FID BIGINT DEFAULT 0 NOT NULL,
  FENTRYID BIGINT DEFAULT 0 NOT NULL,
  FSEQ INT DEFAULT 0 NOT NULL,
  FMODIFIERFIELD BIGINT DEFAULT 0 NOT NULL,
  FMODIFYDATEFIELD DATETIME,
  FORDERNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
  FMATERIALMASTERID BIGINT DEFAULT 0 NOT NULL,
  FCHILDMASTERID BIGINT DEFAULT 0 NOT NULL,
  FENTRYCONFIGCODE BIGINT DEFAULT 0 NOT NULL,
  FCHILDAUXPROPERTY BIGINT DEFAULT 0 NOT NULL,
  FMATERIALUNIT BIGINT DEFAULT 0 NOT NULL,
  FSENDINGQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
  FUSEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
  FWIPQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
  FCHECKQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
  FDIFFQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
  FMATERIELFIELD BIGINT DEFAULT 0 NOT NULL,
  FORDERENTRYID BIGINT DEFAULT 0 NOT NULL,
  FSRCSEQ NVARCHAR(50) DEFAULT ' ' NOT NULL,
  FORDERID BIGINT DEFAULT 0 NOT NULL,
  FSTOCKID BIGINT DEFAULT 0 NOT NULL,
  FSTOCKENTRYID BIGINT DEFAULT 0 NOT NULL,
  FSTOCKNO NVARCHAR(50) DEFAULT ' ' NOT NULL
);
