/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MRP_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_RESCCSENTRY') 
 CREATE TABLE T_MRP_RESCCSENTRY (
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,
FTOOLRES BIGINT DEFAULT 0 NOT NULL,
FTOOLTYPE BIGINT DEFAULT 0 NOT NULL,
FSUPPYIDTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FISUPPY BIGINT DEFAULT 0 NOT NULL,
FUNIT BIGINT DEFAULT 0 NOT NULL,
FADJUSTENDTIME DATETIME,
FADJUSTSTARTTIME DATETIME,
FSHORTQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRESNEEDUSER BIGINT DEFAULT 0 NOT NULL,
FNEEDQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FENDTIME DATETIME,
FSTARTTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_RESCONFCOOR') 
 CREATE TABLE T_MRP_RESCONFCOOR (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT '0' 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,
FRESCONFTYPE CHAR(1) DEFAULT '0' NOT NULL,
FTOOLNEEDNUM NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPROJECT BIGINT DEFAULT 0 NOT NULL,
FCOORDINATOR BIGINT DEFAULT 0 NOT NULL,
FCOORSTATUS CHAR(1) DEFAULT '0' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_RESCOORENTRY') 
 CREATE TABLE T_MRP_RESCOORENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPLANENDTIME DATETIME,
FTOOLNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCOORPROJECT BIGINT DEFAULT 0 NOT NULL,
FPLANSTARTTIME DATETIME,
FCOORQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPLANQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCOORENDTIME DATETIME,
FCOORSTARTTIME DATETIME,
FBECOORUSER BIGINT DEFAULT 0 NOT NULL,
FISAGREECOOR CHAR(1) DEFAULT '0' NOT NULL
);



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MRP_table.sql **/
