/**Begin D:\PDM_UPGRADE\PDM1\TM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TM_BUSINESSBILL' AND KSQL_COL_NAME IN ('FSETTLECURRENCYID'))
ALTER TABLE T_TM_BUSINESSBILL ADD (FSETTLECURRENCYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TM_BUSINESSBILL' AND KSQL_COL_NAME IN ('FSETTLEAMOUNT'))
ALTER TABLE T_TM_BUSINESSBILL ADD (FSETTLEAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TM_BUSINESSBILL' AND KSQL_COL_NAME IN ('FPREMCURRENCYID'))
ALTER TABLE T_TM_BUSINESSBILL ADD (FPREMCURRENCYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TM_BUSINESSBILL' AND KSQL_COL_NAME IN ('FPREMIUM'))
ALTER TABLE T_TM_BUSINESSBILL ADD (FPREMIUM DECIMAL(23,10) DEFAULT 0 NOT NULL );

/**End D:\PDM_UPGRADE\PDM1\TM_table.sql **/

/**Begin C:\Users\rd_zhixiong_w\Downloads\PDM_UPGRADE\PDM1\TM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TM_LIFECYCLEAPPLY_ENTRY' AND KSQL_COL_NAME IN ('FRATE')) 
 ALTER TABLE T_TM_LIFECYCLEAPPLY_ENTRY ADD (FRATE DECIMAL(23,10) DEFAULT 0 NOT NULL );

/**End C:\Users\rd_zhixiong_w\Downloads\PDM_UPGRADE\PDM1\TM_table.sql **/

/**Begin D:\PDM_UPGRADE\PDM1\TM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TM_REQNOTE_OPTIONS')
 CREATE TABLE T_TM_REQNOTE_OPTIONS (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FDELIVERYSTARTDATE DATETIME,
FDELIVERYENDDATE DATETIME,
FADSTARTDATE DATETIME,
FADENDDATE DATETIME,
FDELIVERYDATE DATETIME,
FOPTIONTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FOPDIRECT NVARCHAR(50) DEFAULT ' ' NOT NULL,
FTRADEDIRECT NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDELMODE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FEXERATE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FOPCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FOPFEEBOTTOM DECIMAL(23,10) DEFAULT 0 NOT NULL,
FOPFEETOP DECIMAL(23,10) DEFAULT 0 NOT NULL,
FINCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FOUTCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FAMTIN DECIMAL(23,10) DEFAULT 0 NOT NULL,
FAMTOUT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCOUNPTYID BIGINT DEFAULT 0 NOT NULL,
FISBIZBILL CHAR(1) DEFAULT '0' NOT NULL,
FQUOTE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FADJDELIDATE DATETIME,
FBIZDATE DATETIME,
FBUSTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL
);



/**End D:\PDM_UPGRADE\PDM1\TM_table.sql **/
