/**Begin D:\page\rim\pdm\20210726\RIM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INVOICE_SUM' AND KSQL_COL_NAME ='FORG') 
 ALTER TABLE T_RIM_INVOICE_SUM ADD (FORG BIGINT DEFAULT 0 NOT NULL );
 EXEC p_AlterColumn 'T_RIM_DOWN_ACCOUNT', 'FFPY_SERIAL_NO', 'VARCHAR(36)', 'NOT NULL', '0100', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_RIM_BLACK_LIST_DATA') 
 CREATE TABLE T_RIM_BLACK_LIST_DATA (
FID BIGINT DEFAULT 0 NOT NULL,
FCASE_DETAIL VARCHAR(500) DEFAULT ' ' NOT NULL,
FCASE_NATURE VARCHAR(50) DEFAULT ' ' NOT NULL,
FLEGAL_CARD_NO VARCHAR(50) DEFAULT ' ' NOT NULL,
FLEGAL_CARD_TYPE VARCHAR(20) DEFAULT ' ' NOT NULL,
FLEGAL_NAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FMEDIUM_INFO VARCHAR(50) DEFAULT ' ' NOT NULL,
FLEGAL_SEX VARCHAR(20) DEFAULT ' ' NOT NULL,
FTAX_PAYER_NO VARCHAR(50) DEFAULT ' ' NOT NULL,
FORG BIGINT DEFAULT 0 NOT NULL,
FPROVINCE VARCHAR(50) DEFAULT ' ' NOT NULL,
FCOMPANY_NAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FREGIST_ADDRESS VARCHAR(150) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_RIM_INV_WARNING_DATA') 
 CREATE TABLE T_RIM_INV_WARNING_DATA (
FID BIGINT DEFAULT 0 NOT NULL,
FORG BIGINT DEFAULT 0 NOT NULL,
FDATA_PERIOD VARCHAR(10) DEFAULT ' ' NOT NULL,
FDATA_TYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FDATA_VALUE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCREATE_TIME DATETIME
);

/**End D:\page\rim\pdm\20210726\RIM_table.sql **/
