/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\HBSS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HBSS_CAPACITYGROUP') 
 CREATE TABLE T_HBSS_CAPACITYGROUP (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(500) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FINDEX BIGINT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HBSS_CAPACITYITEM') 
 CREATE TABLE T_HBSS_CAPACITYITEM (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(500) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FINDEX BIGINT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FCAPGROUPID BIGINT DEFAULT 0 NOT NULL,
FCAPRANKSCHEMEID BIGINT DEFAULT 0 NOT NULL,
FTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FDEFINITION NVARCHAR(500) DEFAULT ' ' NOT NULL,
FISSTANDARD CHAR(1) DEFAULT ' ' NOT NULL,
FFATHERID BIGINT DEFAULT 0 NOT NULL,
FRANKINFO NVARCHAR(500) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HBSS_CAPACITYITEM_L') 
 CREATE TABLE T_HBSS_CAPACITYITEM_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDEFINITION NVARCHAR(500) DEFAULT ' ' NOT NULL,
FRANKINFO NVARCHAR(500) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HBSS_CAPITEMACTENTRY') 
 CREATE TABLE T_HBSS_CAPITEMACTENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCAPACTIONID BIGINT DEFAULT 0 NOT NULL,
FKEYPOINT NVARCHAR(500) DEFAULT ' ' NOT NULL,
FRANKID BIGINT DEFAULT 0 NOT NULL,
FINDEX BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HBSS_CAPITEMACTENTRY_L') 
 CREATE TABLE T_HBSS_CAPITEMACTENTRY_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FKEYPOINT NVARCHAR(500) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HBSS_CAPITEMRANKENTRY') 
 CREATE TABLE T_HBSS_CAPITEMRANKENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FRANKNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSECNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FKEYWORD NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDEFINITION NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(500) DEFAULT ' ' NOT NULL,
FISCAPHASACT CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HBSS_CAPITEMRANKENTRY_L') 
 CREATE TABLE T_HBSS_CAPITEMRANKENTRY_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FRANKNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSECNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FKEYWORD NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDEFINITION NVARCHAR(500) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(500) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HBSS_CAPRANKINFOENTRY') 
 CREATE TABLE T_HBSS_CAPRANKINFOENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FORDER INT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HBSS_CAPRANKINFOENTRY_L') 
 CREATE TABLE T_HBSS_CAPRANKINFOENTRY_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HBSS_CAPRANKSCHEME') 
 CREATE TABLE T_HBSS_CAPRANKSCHEME (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(500) DEFAULT ' ' NOT NULL,
FRANKINFO NVARCHAR(500) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FINDEX BIGINT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HBSS_CAPRANKSCHEME_L') 
 CREATE TABLE T_HBSS_CAPRANKSCHEME_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(500) DEFAULT ' ' NOT NULL,
FRANKINFO NVARCHAR(500) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HBSS_CAPACITYACTION_L') 
 CREATE TABLE T_HBSS_CAPACITYACTION_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(500) DEFAULT ' ' NOT NULL,
FKEYPOINT NVARCHAR(500) DEFAULT ' ' NOT NULL,
FACDESCRIPTION NVARCHAR(500) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HBSS_CAPACITYACTION') 
 CREATE TABLE T_HBSS_CAPACITYACTION (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FKEYPOINT NVARCHAR(500) DEFAULT ' ' NOT NULL,
FACDESCRIPTION NVARCHAR(500) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FINDEX BIGINT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FDESCRIPTION NVARCHAR(500) DEFAULT ' ' NOT NULL
);



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\HBSS_table.sql **/
