/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest(平台_业务)\pdm\TCTB_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_APTITUDE') 
 CREATE TABLE T_TCTB_APTITUDE (
FID BIGINT DEFAULT 0 NOT NULL,
FSTARTDATE DATETIME,
FENDDATE DATETIME,
FORGID VARCHAR(100) DEFAULT ' ' NOT NULL,
FAPTITUDETYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FTOTAL BIGINT DEFAULT 0 NOT NULL,
FQUANTITY BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_BD_BANK') 
 CREATE TABLE T_TCTB_BD_BANK (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(60) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FNO VARCHAR(100) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FBANK VARCHAR(100) DEFAULT ' ' NOT NULL,
FSTARTIME VARCHAR(100) DEFAULT ' ' NOT NULL,
FORGID VARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_BD_BASE') 
 CREATE TABLE T_TCTB_BD_BASE (
FID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FMAINCOMPANY VARCHAR(50) DEFAULT ' ' NOT NULL,
FTAXPAYER VARCHAR(50) DEFAULT ' ' NOT NULL,
FTAXNO VARCHAR(50) DEFAULT ' ' NOT NULL,
FREGISTERTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FREGISTER VARCHAR(50) DEFAULT ' ' NOT NULL,
FREGISTERTIME DATETIME,
FCODE VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FLEGALPEOPLE VARCHAR(50) DEFAULT ' ' NOT NULL,
FLEGALPEOPLETYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FACCOUNTINGSYSTEM BIGINT DEFAULT 0 NOT NULL,
FREGISTERADDRESS VARCHAR(50) DEFAULT ' ' NOT NULL,
FACTUALADDRESS VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_BD_CATEGORY') 
 CREATE TABLE T_TCTB_BD_CATEGORY (
FID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSTARTDATE DATETIME,
FENDDATE DATETIME,
FKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
PAYTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
COLLECTMETHOD VARCHAR(50) DEFAULT ' ' NOT NULL,
PAYMETHOD VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_BD_REGISTERTYPE') 
 CREATE TABLE T_TCTB_BD_REGISTERTYPE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FLONGNUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FLEVEL BIGINT DEFAULT 0 NOT NULL,
FISLEAF CHAR(1) DEFAULT ' ' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_BD_SHAREHOLDER') 
 CREATE TABLE T_TCTB_BD_SHAREHOLDER (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(60) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(60) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FNAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FIDENTIFICATIONTYPE VARCHAR(100) DEFAULT ' ' NOT NULL,
FIDENTIFICATIONNUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FINVESTMENTRATIO VARCHAR(100) DEFAULT ' ' NOT NULL,
FNATIONALITY VARCHAR(100) DEFAULT ' ' NOT NULL,
FTYPE VARCHAR(100) DEFAULT ' ' NOT NULL,
FREGISTERTYPE VARCHAR(100) DEFAULT ' ' NOT NULL,
FTAXNO VARCHAR(100) DEFAULT ' ' NOT NULL,
FSCALE VARCHAR(100) DEFAULT ' ' NOT NULL,
FORGID VARCHAR(100) DEFAULT ' ' NOT NULL,
FSTARTDATE DATETIME,
FADDRESS VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TCTB_BD_REGISTERTYPE_L') 
 CREATE TABLE T_TCTB_BD_REGISTERTYPE_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FFULLNAME VARCHAR(100) DEFAULT ' ' NOT NULL
);



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest(平台_业务)\pdm\TCTB_table.sql **/
