/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FPM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_ORGREPORTTYPE') 
 CREATE TABLE T_FPM_ORGREPORTTYPE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FENABLERID BIGINT DEFAULT 0 NOT NULL,
FENABLEDATE DATETIME,
FDISABLEDATE DATETIME,
FORGREPORTCYCLE VARCHAR(50) DEFAULT ' ' NOT NULL,
FORGREPORTTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FCOMMENT VARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_ORGREPORTTYPE_L') 
 CREATE TABLE T_FPM_ORGREPORTTYPE_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FCOMMENT VARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_BODYSYSMANAGE_L') 
 CREATE TABLE T_FPM_BODYSYSMANAGE_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FCOMMENT VARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_BODYSYSMANAGE_MANG') 
 CREATE TABLE T_FPM_BODYSYSMANAGE_MANG (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FMANAGERTYPEBDTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FMANAGERTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FMANAGER BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_BODYSYSMANAGE_TYPE') 
 CREATE TABLE T_FPM_BODYSYSMANAGE_TYPE (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FRERPORTTYPE BIGINT DEFAULT 0 NOT NULL,
FREREPORTTYPESTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FISSUMREPORT CHAR(1) DEFAULT '0' NOT NULL,
FISMODIFY CHAR(1) DEFAULT '0' NOT NULL,
FISROLL CHAR(1) DEFAULT '0' NOT NULL,
FROLLNUMBER INT DEFAULT 0 NOT NULL,
FISCONTAINDETAIL CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_DETAILPLANFIELD') 
 CREATE TABLE T_FPM_DETAILPLANFIELD (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FENABLERID BIGINT DEFAULT 0 NOT NULL,
FENABLEDATE DATETIME,
FDISABLEDATE DATETIME,
FBODYSYS BIGINT DEFAULT 0 NOT NULL,
FCOMMENT VARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_DETAILPLANFIELD_L') 
 CREATE TABLE T_FPM_DETAILPLANFIELD_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FCOMMENT VARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_DETAILPLANFIELD_ENT') 
 CREATE TABLE T_FPM_DETAILPLANFIELD_ENT (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FFIELDNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDSHOWNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FSYSSETPRE CHAR(1) DEFAULT '0' NOT NULL,
FDATATYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FOPTION VARCHAR(500) DEFAULT ' ' NOT NULL,
FOPTIONDETAIL VARCHAR(500) DEFAULT ' ' NOT NULL,
FOPTIONDETAIL_TAG NCLOB,
FISSHOW CHAR(1) DEFAULT '0' NOT NULL,
FISMUSTINPUT CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_DIMENSIONMEMBER') 
 CREATE TABLE T_FPM_DIMENSIONMEMBER (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FENABLERID BIGINT DEFAULT 0 NOT NULL,
FENABLEDATE DATETIME,
FDISABLEDATE DATETIME,
FCOMMENT VARCHAR(255) DEFAULT ' ' NOT NULL,
FBODYSYSMANAGE BIGINT DEFAULT 0 NOT NULL,
FBIZBASEDATA VARCHAR(100) DEFAULT ' ' NOT NULL,
FDIMENSION VARCHAR(50) DEFAULT ' ' NOT NULL,
FUSEASSISTBASEDATA CHAR(1) DEFAULT '0' NOT NULL,
FASSISTBIZBASEDATA VARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_DIMENSIONMEMBER_L') 
 CREATE TABLE T_FPM_DIMENSIONMEMBER_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FCOMMENT VARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_DIMENSIONMEMBER_ENT') 
 CREATE TABLE T_FPM_DIMENSIONMEMBER_ENT (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FBIZBASEDATADETAIL VARCHAR(50) DEFAULT ' ' NOT NULL,
FBIZBASEDATADETAILCODE VARCHAR(50) DEFAULT ' ' NOT NULL,
FBIZBASEDATADETAILID BIGINT DEFAULT 0 NOT NULL,
FBIZBDRANGE VARCHAR(50) DEFAULT ' ' NOT NULL,
FASSISTBASEDATADETAIL VARCHAR(50) DEFAULT ' ' NOT NULL,
FASSISTBASEDATADETAILCODE VARCHAR(50) DEFAULT ' ' NOT NULL,
FASSISTBASEDATADETAILID BIGINT DEFAULT 0 NOT NULL,
FDIMMEMBER BIGINT DEFAULT 0 NOT NULL,
FDIMMEMBERCODE VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FPM_BODYSYSMANAGE') 
 CREATE TABLE T_FPM_BODYSYSMANAGE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FENABLERID BIGINT DEFAULT 0 NOT NULL,
FENABLEDATE DATETIME,
FDISABLEDATE DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FRATETYPE BIGINT DEFAULT 0 NOT NULL
);



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