/**Begin D:\pdm\PDM_UPGRADE\pdm_new\BDM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BDM_LQPT_INVOICENO') 
 CREATE TABLE T_BDM_LQPT_INVOICENO (
FID NVARCHAR(36) DEFAULT ' ' NOT NULL,
FINVOICE_NO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FNSRSBH NVARCHAR(30) DEFAULT ' ' NOT NULL,
FSTATUS NVARCHAR(4) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BDM_LQPT_LOG') 
 CREATE TABLE T_BDM_LQPT_LOG (
FID BIGINT DEFAULT 0 NOT NULL,
FTAX_NO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FSERVICE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FTRACEID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATE_TIME DATETIME,
FERROR_CODE NVARCHAR(20) DEFAULT ' ' NOT NULL,
FERROR_MSG NVARCHAR(200) DEFAULT ' ' NOT NULL,
FREQUEST NVARCHAR(255) DEFAULT ' ' NOT NULL,
FREQUEST_TAG NCLOB,
FRESPONSE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FRESPONSE_TAG NCLOB,
FCREATER BIGINT DEFAULT 0 NOT NULL,
FTAKE_TIME BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BDM_LQPT_SXED') 
 CREATE TABLE T_BDM_LQPT_SXED (
FID BIGINT DEFAULT 0 NOT NULL,
FNSRSBH NVARCHAR(30) DEFAULT ' ' NOT NULL,
FZTSXBZ NVARCHAR(8) DEFAULT ' ' NOT NULL,
FBYSXED DECIMAL(23,10) DEFAULT 0 NOT NULL,
FKYSYED DECIMAL(23,10) DEFAULT 0 NOT NULL,
FYXZED DECIMAL(23,10) DEFAULT 0 NOT NULL,
FYXZWSYED DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSQ NVARCHAR(10) DEFAULT ' ' NOT NULL,
FCREATE_TIME DATETIME,
FUPDATE_TIME DATETIME,
FSYQJQ DATETIME,
FSYQJZ DATETIME,
FVERSION BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BDM_LQPT_SXED_LOG') 
 CREATE TABLE T_BDM_LQPT_SXED_LOG (
FID BIGINT DEFAULT 0 NOT NULL,
FNSRSBH NVARCHAR(30) DEFAULT ' ' NOT NULL,
FINVOICE_NO NVARCHAR(30) DEFAULT ' ' NOT NULL,
FINVOICE_AMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FVERSION BIGINT DEFAULT 0 NOT NULL,
FCREATE_TIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BDM_LQPT_YFM') 
 CREATE TABLE T_BDM_LQPT_YFM (
FID BIGINT DEFAULT 0 NOT NULL,
FFPQSHM NVARCHAR(30) DEFAULT ' ' NOT NULL,
FFPZZHM NVARCHAR(30) DEFAULT ' ' NOT NULL,
FLYSL BIGINT DEFAULT 0 NOT NULL,
FCREATE_TIME DATETIME,
FUPDATE_TIME DATETIME,
FYEAR NVARCHAR(10) DEFAULT ' ' NOT NULL,
FSYSL BIGINT DEFAULT 0 NOT NULL,
FNSRSBH NVARCHAR(30) DEFAULT ' ' NOT NULL
);



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