/**Begin D:\scm_code\PDM_UPGRADE_1.3\PDM_UPGRADE_1.3\PDM_UPGRADE\pdm2\RIM_table.sql **/ 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_RIM_DEDUCT_CONF_R3') 
 CREATE TABLE T_RIM_DEDUCT_CONF_R3 (
FID BIGINT DEFAULT 0 NOT NULL,
FREFSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FIDX BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_RIM_DEDUCT_CONFIG') 
 CREATE TABLE T_RIM_DEDUCT_CONFIG (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(30) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FCTRLSTRATEGY VARCHAR(50) DEFAULT ' ' NOT NULL,
FSOURCEDATAID BIGINT DEFAULT 0 NOT NULL,
FBITINDEX BIGINT DEFAULT 0 NOT NULL,
FSOURCEBITINDEX BIGINT DEFAULT 0 NOT NULL,
FAIR_BEGIN_DATE DATETIME,
FAIR_PERSON_IDENTITY VARCHAR(4) DEFAULT ' ' NOT NULL,
FAIR_COMPANY_EMPLOYEE VARCHAR(4) DEFAULT ' ' NOT NULL,
FTRAIN_BEGIN_DATE DATETIME,
FTRAIN_PERSON_IDENTITY VARCHAR(4) DEFAULT ' ' NOT NULL,
FTRAIN_COMPANY_EMPLOYEE VARCHAR(4) DEFAULT ' ' NOT NULL,
FBUS_BEGIN_DATE DATETIME,
FBUS_PERSON_IDENTITY VARCHAR(4) DEFAULT ' ' NOT NULL,
FBUS_COMPANY_EMPLOYEE VARCHAR(4) DEFAULT ' ' NOT NULL,
FBOAT_BEGIN_DATE DATETIME,
FBOAT_PERSON_IDENTITY VARCHAR(4) DEFAULT ' ' NOT NULL,
FBOAT_COMPANY_EMPLOYEE VARCHAR(4) DEFAULT ' ' NOT NULL,
FCUSTOM_CONFIG VARCHAR(255) DEFAULT ' ' NOT NULL,
FCUSTOM_CONFIG_TAG NCLOB
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_RIM_DEDUCT_CONFIG_M') 
 CREATE TABLE T_RIM_DEDUCT_CONFIG_M (
FORGID BIGINT DEFAULT 0 NOT NULL,
FDATA BLOB,
FIDX BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_RIM_DEDUCT_CONFIG_U') 
 CREATE TABLE T_RIM_DEDUCT_CONFIG_U (
FDATAID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_RIM_DEDUCT_CONFIGEXC') 
 CREATE TABLE T_RIM_DEDUCT_CONFIGEXC (
FDATAID BIGINT DEFAULT 0 NOT NULL,
FNEWDATAID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_RIM_DEDUCT_CONFIGUSEREG') 
 CREATE TABLE T_RIM_DEDUCT_CONFIGUSEREG (
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FDATAID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FADMINORGID BIGINT DEFAULT 0 NOT NULL,
FCTRLSTRATEGY VARCHAR(20) DEFAULT ' ' NOT NULL,
FISASSIGN CHAR(1) DEFAULT ' ' NOT NULL,
FASSIGNORGID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL
);



/**End D:\scm_code\PDM_UPGRADE_1.3\PDM_UPGRADE_1.3\PDM_UPGRADE\pdm2\RIM_table.sql **/
