/**Begin D:\PDM_UPGRADE_1.3\PDM_UPGRADE\pdm1\RIM_table.sql **/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_RIM_SELECT_LOG') 
 CREATE TABLE T_RIM_SELECT_LOG (
FID BIGINT DEFAULT 0 NOT NULL,
FBATCH_NO NVARCHAR(36) DEFAULT ' ' NOT NULL,
FORG_ID BIGINT DEFAULT 0 NOT NULL,
FTAX_NO NVARCHAR(20) DEFAULT ' ' NOT NULL,
FSELECT_TYPE NVARCHAR(2) DEFAULT ' ' NOT NULL,
FOPERATE_TYPE NVARCHAR(2) DEFAULT ' ' NOT NULL,
FHANDLE_STATUS NVARCHAR(2) DEFAULT ' ' NOT NULL,
FCREATER BIGINT DEFAULT 0 NOT NULL,
FTOTAL_TAX_AMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINVOICE_AMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FEFFECTIVE_TAX_AMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTAX_PERIOD DATETIME,
FTOTAL_NUM INT DEFAULT 0 NOT NULL,
FSUCCESS_NUM INT DEFAULT 0 NOT NULL,
FFAIL_NUM INT DEFAULT 0 NOT NULL,
FTENANT_NO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATE_TIME DATETIME,
FUPDATE_TIME DATETIME
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_RIM_HIS_SYNC_CONFIG') 
 CREATE TABLE T_RIM_HIS_SYNC_CONFIG (
FID BIGINT DEFAULT 0 NOT NULL,
FCREATER BIGINT DEFAULT 0 NOT NULL,
FTAX_NO VARCHAR(30) DEFAULT ' ' NOT NULL,
FCOMPANY_NAME VARCHAR(150) DEFAULT ' ' NOT NULL,
FCLIENTID VARCHAR(30) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(4) DEFAULT ' ' NOT NULL,
FCREATE_TIME DATETIME
);


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