/**Begin D:\k3Cloud\PDM_UPGRADE\PDM1\MDS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_POM_PLANPROENTRYDIS') 
 CREATE TABLE T_POM_PLANPROENTRYDIS (
FDEMANDSRC VARCHAR(50) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FRESOURCEREGISTER BIGINT DEFAULT 0 NOT NULL,
FISMRPOPERAT CHAR(1) DEFAULT '0' NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_POM_PLANPROGRAM_DISTR') 
 CREATE TABLE T_POM_PLANPROGRAM_DISTR (
FALLOWDELAYTIME BIGINT DEFAULT 0,
FISCUSTOMIZE CHAR(1) DEFAULT '0' NOT NULL,
FORGRANGID NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSOURCEDATAID BIGINT DEFAULT 0 NOT NULL,
FCUSSAVE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCOMPUTEMODE VARCHAR(30) DEFAULT ' ' NOT NULL,
FSUPPLYMODEL BIGINT DEFAULT 0 NOT NULL,
FRELATIVETRANSFER BIGINT DEFAULT 0 NOT NULL,
FTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FCONSIDERBATCHSTR CHAR(1) DEFAULT '0' NOT NULL,
FSELORGRANGID_TAG NCLOB,
FQUOTAATTRS VARCHAR(30) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FISCOMMON CHAR(1) DEFAULT '0' NOT NULL,
FISCENTERWAREHOUSE CHAR(1) DEFAULT '0' NOT NULL,
FENABLE VARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSAFESTOCKEFFECTSET VARCHAR(30) DEFAULT ' ' NOT NULL,
FDAY BIGINT DEFAULT 0,
FISSELECTION CHAR(1) DEFAULT '0' NOT NULL,
FCUSSAVE_TAG NCLOB,
FISPURQUOTA CHAR(1) DEFAULT '0' NOT NULL,
FISYIELD CHAR(1) DEFAULT '0' NOT NULL,
FSELORGRANGID NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCTRLSTRATEGY VARCHAR(30) DEFAULT ' ' NOT NULL,
FISSIMULATION CHAR(1) DEFAULT '0' NOT NULL,
FADJUSTEFFECTSET VARCHAR(30) DEFAULT ' ' NOT NULL,
FISREORDERPOINT CHAR(1) DEFAULT '0' NOT NULL,
FDEMANDMODEL BIGINT DEFAULT 0 NOT NULL,
FDISTRTYPE BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FISADJUST CHAR(1) DEFAULT '0' NOT NULL,
FINVSUPPLYSTRATEGY BIGINT DEFAULT 0 NOT NULL,
FISMPS CHAR(1) DEFAULT '0' NOT NULL,
FALLOWLEADTIME BIGINT DEFAULT 0,
FSTATUS VARCHAR(30) DEFAULT ' ' NOT NULL,
FISREPLACE CHAR(1) DEFAULT '0' NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FSCOUTOFDATE VARCHAR(30) DEFAULT ' ' NOT NULL,
FQUOTATYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FISSAFESTOCK CHAR(1) DEFAULT '0' NOT NULL,
FMODIFYTIME DATETIME,
FOUTOFRANGE VARCHAR(30) DEFAULT ' ' NOT NULL,
FMULID BIGINT DEFAULT 0 NOT NULL,
FISNEW CHAR(1) DEFAULT '0' NOT NULL,
FOUTOFDATE VARCHAR(30) DEFAULT ' ' NOT NULL,
FORGRANGID_TAG NCLOB,
FISRESERVE CHAR(1) DEFAULT '0' NOT NULL,
FSCDAY BIGINT DEFAULT 0,
FDISTRMATCHTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FSTOCKRESERVE CHAR(1) DEFAULT '0' NOT NULL,
FISLOSSRATE CHAR(1) DEFAULT '0' NOT NULL,
FISNOTSETUP CHAR(1) DEFAULT '0' NOT NULL,
FPLANTAG NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDISTRRTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FSUPPLYNET BIGINT DEFAULT 0 NOT NULL,
FEARLYTOLER BIGINT DEFAULT 0,
FORGID BIGINT DEFAULT 0 NOT NULL,
FDELAYTOLER BIGINT DEFAULT 0,
FRELEASEMODE VARCHAR(30) DEFAULT ' ' NOT NULL,
FBITINDEX BIGINT DEFAULT 0 NOT NULL,
FPLANOUTLOOK BIGINT DEFAULT 0 NOT NULL,
FOCPWEAKRESERVE VARCHAR(30) DEFAULT ' ' NOT NULL,
FINVLEVEL BIGINT DEFAULT 0 NOT NULL,
FSOURCEBITINDEX BIGINT DEFAULT 0 NOT NULL,
FHILOINV CHAR(1) DEFAULT '0' NOT NULL,
FSTEPNUM NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMRPSETUP BIGINT DEFAULT 0 NOT NULL,
FAPPMODE VARCHAR(30) DEFAULT ' ' NOT NULL,
FISMRP CHAR(1) DEFAULT '0' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_POM_PLANPROORGENTRYDIS') 
 CREATE TABLE T_POM_PLANPROORGENTRYDIS (
FID BIGINT DEFAULT 0 NOT NULL,
FDEMANDORG BIGINT DEFAULT 0 NOT NULL,
FPLANSCOPE BIGINT DEFAULT 0 NOT NULL,
FINVSTRATEGY BIGINT DEFAULT 0 NOT NULL,
FSUPPLYNET BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL
);



/**End D:\k3Cloud\PDM_UPGRADE\PDM1\MDS_table.sql **/
