--生产月度在制查询日志
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_POM_PRODWIPLOG')
CREATE TABLE T_POM_PRODWIPLOG (
  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,
  FSRCBILLID BIGINT DEFAULT 0 NOT NULL
);

--生产月度在制查询日志_在制信息
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_POM_PRODWIPLOGENTRY')
CREATE TABLE T_POM_PRODWIPLOGENTRY (
  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,
  FMATERIAL BIGINT DEFAULT 0 NOT NULL,
  FMATERIALNO BIGINT DEFAULT 0 NOT NULL,
  FORDERENTRYID BIGINT DEFAULT 0 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,
  FMATERIALMASTERID BIGINT DEFAULT 0 NOT NULL,
  FCHILDMASTERID BIGINT DEFAULT 0 NOT NULL,
  FSRCSEQ NVARCHAR(50) DEFAULT ' ' NOT NULL,
  FUSEQTYSTR NVARCHAR(50) DEFAULT ' ' NOT NULL,
  FWIPQTYSTR NVARCHAR(50) DEFAULT ' ' NOT NULL,
  FCHECKQTY NVARCHAR(255) DEFAULT ' ' NOT NULL
);
