/**Begin D:\PDM_UPGRADE\PDM1\POM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_POM_MFTREPORTSUMMARY_L') 
 CREATE TABLE T_POM_MFTREPORTSUMMARY_L (
FPKID NVARCHAR(18) DEFAULT ' ' NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(10) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_POM_MFTREPORTSUMMARY') 
 CREATE TABLE T_POM_MFTREPORTSUMMARY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FMANUFACTUREBILL NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMANUFACTUREBILLROW BIGINT DEFAULT 0 NOT NULL,
FMANUFACTUREENTRYID BIGINT DEFAULT 0 NOT NULL,
FMATERIALID BIGINT DEFAULT 0 NOT NULL,
FQUALIFYQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FWORKWASTEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSCRAPQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FREWORKQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCOMPLETQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FMATERTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FOPRUNITID BIGINT DEFAULT 0 NOT NULL,
FREPORTTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FBATCHNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FRESOURCEID BIGINT DEFAULT 0 NOT NULL,
FAUXPROPERTYID BIGINT DEFAULT 0 NOT NULL,
FBACKFLISHFLAG NVARCHAR(30) DEFAULT ' ' NOT NULL,
FSCRAPPEDQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FISAUTOWAREHOUSE CHAR(1) DEFAULT '0' NOT NULL,
FORGFIELD BIGINT DEFAULT 0 NOT NULL,
FMATERIALCODE BIGINT DEFAULT 0 NOT NULL,
FCHECKQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQUALIFYWAREQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FUNQUALIFYWAREQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSCRAPPEDWAREQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCHECKEDQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBEGINTIME DATETIME,
FENDTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_POM_MFTREPORTER') 
 CREATE TABLE T_POM_MFTREPORTER (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FUSERNO BIGINT DEFAULT 0 NOT NULL,
FQTYFIELD DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPROPORTION DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_POM_MFTORDERREPORT_L') 
 CREATE TABLE T_POM_MFTORDERREPORT_L (
FPKID NVARCHAR(18) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(10) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_POM_MFTORDERREPORT') 
 CREATE TABLE T_POM_MFTORDERREPORT (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS NVARCHAR(30) 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,
FBILLTYPEID NVARCHAR(30) DEFAULT ' ' NOT NULL,
FREPORTDATE DATETIME,
FSTAFFREPORT NVARCHAR(30) DEFAULT ' ' NOT NULL
);



/**End D:\PDM_UPGRADE\PDM1\POM_table.sql **/
