/**Begin D:\pdm\PDM_UPGRADE\pdm_new\BDM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BDM_BILL_ARCHIVE_LOG') 
 CREATE TABLE T_BDM_BILL_ARCHIVE_LOG (
FID BIGINT DEFAULT 0 NOT NULL,
FSNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FTNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPK NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCONTENT NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCONTENT_TAG NCLOB,
FCREATERFIELD BIGINT DEFAULT 0 NOT NULL,
FCREATEDATEFIELD DATETIME,
FBATCH NVARCHAR(50) DEFAULT ' ' NOT NULL,
FBILLNO NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BDM_BILL_ARCHIVE_MONTH') 
 CREATE TABLE T_BDM_BILL_ARCHIVE_MONTH (
FID BIGINT DEFAULT 0 NOT NULL,
FTENTITY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDATA_MONTH NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BDM_BILL_ARCHIVE_CONFIG') 
 CREATE TABLE T_BDM_BILL_ARCHIVE_CONFIG (
FID BIGINT DEFAULT 0 NOT NULL,
FSENTITY NVARCHAR(36) DEFAULT ' ' NOT NULL,
FTENTITY NVARCHAR(36) DEFAULT ' ' NOT NULL,
FFILTER NVARCHAR(255) DEFAULT ' ' NOT NULL,
FFILTER_TAG NCLOB,
FCREATER BIGINT DEFAULT 0 NOT NULL,
FMODIFIER BIGINT DEFAULT 0 NOT NULL,
FCREATEDATE DATETIME,
FMODIFYDATE DATETIME,
FSTATUS NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDATE_FIELD NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMONTH_FIELD NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPAGE_SIZE BIGINT DEFAULT 0 NOT NULL,
FLAST_DATE DATETIME,
FTAXNO_FIELD NVARCHAR(50) DEFAULT ' ' NOT NULL,
FORG_FIELD NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDEADLINE_DAY BIGINT DEFAULT 0 NOT NULL,
FBILLNO_FIELD NVARCHAR(50) DEFAULT ' ' NOT NULL
);



/**End D:\pdm\PDM_UPGRADE\pdm_new\BDM_table.sql **/
