/**Begin D:\PDM_UPGRADE\PDM1\MSPLAN_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MSPLAN_CHANGE_RECORD') 
 CREATE TABLE T_MSPLAN_CHANGE_RECORD (
FID BIGINT DEFAULT 0 NOT NULL,
FPARENT_ID BIGINT DEFAULT 0 NOT NULL,
F_S_MATERIEL BIGINT DEFAULT 0 NOT NULL,
F_BILL_OBJ_ID NVARCHAR(50) DEFAULT ' ' NOT NULL,
F_R_SALE_ORG BIGINT DEFAULT 0 NOT NULL,
F_BILL_NO NVARCHAR(100) DEFAULT ' ' NOT NULL,
F_BILL_ID BIGINT DEFAULT 0 NOT NULL,
F_R_BIZ_DATE DATETIME,
F_BILLENTRY_ID BIGINT DEFAULT 0 NOT NULL,
F_BILLENTRY_SEQ BIGINT DEFAULT 0 NOT NULL,
F_BASE_QTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
F_S_BASEUNIT BIGINT DEFAULT 0 NOT NULL,
F_S_ORG BIGINT DEFAULT 0 NOT NULL,
F_BAL_OBJ_ID NVARCHAR(50) DEFAULT ' ' NOT NULL,
F_S_BILLNUM NVARCHAR(100) DEFAULT ' ' NOT NULL,
F_BAL_ID BIGINT DEFAULT 0 NOT NULL,
FBALENTRYID BIGINT DEFAULT 0 NOT NULL,
F_S_ENTRYSEQ BIGINT DEFAULT 0 NOT NULL,
FISWEAK CHAR(1) DEFAULT '0' NOT NULL,
F_ORI_QTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
F_QTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
F_S_UNIT BIGINT DEFAULT 0 NOT NULL,
FRESERVESOURCE NVARCHAR(30) DEFAULT ' ' NOT NULL,
F_CREATE_DATE DATETIME,
FEXPIREDATE DATETIME,
F_CREATER_ID BIGINT DEFAULT 0 NOT NULL,
FTRANSFERTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCHANGE_TYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPRIORITY BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MSPLAN_RESERVECFG') 
 CREATE TABLE T_MSPLAN_RESERVECFG (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(60) DEFAULT ' ' NOT NULL,
FSTATUS NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FGROUPID BIGINT DEFAULT 0 NOT NULL,
FRESOURCEID BIGINT DEFAULT 0 NOT NULL,
FFILTERVALUE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FFILTERVALUE_TAG NCLOB,
FBILLOBJECT NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBILLOPERATION NVARCHAR(512) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MSPLAN_RESERVECFG_L') 
 CREATE TABLE T_MSPLAN_RESERVECFG_L (
FPKID NVARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MSPLAN_RESERVECFGENTRY') 
 CREATE TABLE T_MSPLAN_RESERVECFGENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FOPERATION NVARCHAR(60) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MSPLAN_RSCFGGROUP') 
 CREATE TABLE T_MSPLAN_RSCFGGROUP (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(60) DEFAULT ' ' NOT NULL,
FSTATUS NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FLEVEL BIGINT DEFAULT 0 NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FLONGNUMBER NVARCHAR(255) DEFAULT ' ' NOT NULL,
FISLEAF CHAR(1) DEFAULT '1' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MSPLAN_RSCFGGROUP_L') 
 CREATE TABLE T_MSPLAN_RSCFGGROUP_L (
FPKID NVARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FFULLNAME NVARCHAR(255) DEFAULT ' ' NOT NULL
);



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