
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_TRANSTYPE' AND KSQL_COL_NAME ='FCURRENCYNAME') 
 ALTER TABLE T_BEI_TRANSTYPE ADD (FCURRENCYNAME VARCHAR(200) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BEI_TRANSTYPE' AND KSQL_COL_NAME ='FFINORGNAME') 
 ALTER TABLE T_BEI_TRANSTYPE ADD (FFINORGNAME VARCHAR(200) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BEI_CROSSTRANFIELD') 
 CREATE TABLE T_BEI_CROSSTRANFIELD (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(80) DEFAULT ' ' NOT NULL,
FSTATUS NVARCHAR(30) DEFAULT ' ' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FENABLEDATE DATETIME,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FENABLERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FFIELDTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FISSEE CHAR(1) DEFAULT ' ' NOT NULL,
FISNOTNULL CHAR(1) DEFAULT ' ' NOT NULL,
FBASEDATATYPE NVARCHAR(80) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BEI_CROSSTRANFIELD_L') 
 CREATE TABLE T_BEI_CROSSTRANFIELD_L (
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FCOMMENT NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCOMBOXVALUE NVARCHAR(500) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BEI_CROSSTRANTYPE') 
 CREATE TABLE T_BEI_CROSSTRANTYPE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(80) DEFAULT ' ' NOT NULL,
FSTATUS NVARCHAR(30) DEFAULT ' ' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FENABLEDATE DATETIME,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FENABLERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FBANKCATEID BIGINT DEFAULT 0 NOT NULL,
FISDEFAULT CHAR(1) DEFAULT ' ' NOT NULL,
FISCROSSCURRENCY CHAR(1) DEFAULT ' ' NOT NULL,
FISLIMITSAMEBANK CHAR(1) DEFAULT ' ' NOT NULL,
FISCOUNTRY CHAR(1) DEFAULT ' ' NOT NULL,
FTIMELINESS NVARCHAR(30) DEFAULT ' ' NOT NULL,
FISPRESETDATA CHAR(1) DEFAULT ' ' NOT NULL,
FREFERENCEFEE BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BEI_CROSSTRANTYPE_COU') 
 CREATE TABLE T_BEI_CROSSTRANTYPE_COU (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BEI_CROSSTRANTYPE_CUR') 
 CREATE TABLE T_BEI_CROSSTRANTYPE_CUR (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BEI_CROSSTRANTYPE_ENTRY') 
 CREATE TABLE T_BEI_CROSSTRANTYPE_ENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FFIELDNAME NVARCHAR(80) DEFAULT ' ' NOT NULL,
FDEFAULTVALUE NVARCHAR(80) DEFAULT ' ' NOT NULL,
FISSEE CHAR(1) DEFAULT ' ' NOT NULL,
FISNOTNULL CHAR(1) DEFAULT ' ' NOT NULL,
FISLIMITLENGTH CHAR(1) DEFAULT ' ' NOT NULL,
FMAXLENGTH BIGINT DEFAULT 0 NOT NULL,
FISLIMITVALUE CHAR(1) DEFAULT ' ' NOT NULL,
FFIELDTYPE NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBASEDATATYPE NVARCHAR(80) DEFAULT ' ' NOT NULL,
FFIELDKEY NVARCHAR(80) DEFAULT ' ' NOT NULL,
FVIRTUALVALUE NVARCHAR(300) DEFAULT ' ' NOT NULL,
FCOMBOXVALUE NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDEFAULTVALUEID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BEI_CROSSTRANTYPE_L') 
 CREATE TABLE T_BEI_CROSSTRANTYPE_L (
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FCOMMENT NVARCHAR(255) DEFAULT ' ' NOT NULL
);

