/**Begin D:\PDM_UPGRADE\PDM1\HLCM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HBSS_CONTRACTTYPES')
 CREATE TABLE T_HBSS_CONTRACTTYPES (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FGROUPID BIGINT DEFAULT 0 NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCTRLSTRATEGY VARCHAR(2) DEFAULT ' ' NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FSOURCEDATAID BIGINT DEFAULT 0 NOT NULL,
FBITINDEX INT DEFAULT 0 NOT NULL,
FSOURCEBITINDEX INT DEFAULT 0 NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HBSS_SIGNCOMPANY')
 CREATE TABLE T_HBSS_SIGNCOMPANY (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FCORPORATEORGID BIGINT DEFAULT 0 NOT NULL,
FRELATIONTYPEID BIGINT DEFAULT 0 NOT NULL,
FLEGALREPRESENT VARCHAR(100) DEFAULT ' ' NOT NULL,
FUNIFIEDCODE VARCHAR(100) DEFAULT ' ' NOT NULL,
FADDRESS NVARCHAR(100) DEFAULT ' ' NOT NULL,
FCONTACTNUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FPOSTALCODE VARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FCTRLSTRATEGY VARCHAR(2) DEFAULT ' ' NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FSOURCEDATAID BIGINT DEFAULT 0 NOT NULL,
FBITINDEX INT DEFAULT 0 NOT NULL,
FSOURCEBITINDEX INT DEFAULT 0 NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FINDEX BIGINT DEFAULT 0 NOT NULL,
FVID BIGINT DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HBSS_CONTRACTTYPECAT_L')
 CREATE TABLE T_HBSS_CONTRACTTYPECAT_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
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HBSS_SIGNCOMPANYENTITY')
 CREATE TABLE T_HBSS_SIGNCOMPANYENTITY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCHANGEDATE DATETIME,
FCHANGEPERSONID BIGINT DEFAULT 0 NOT NULL,
FCHANGETYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FCHANGEREASON NVARCHAR(50) DEFAULT ' ' NOT NULL,
FHISID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HBSS_SIGNCOMPANYHIS')
 CREATE TABLE T_HBSS_SIGNCOMPANYHIS (
FVID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FCORPORATEORGID BIGINT DEFAULT 0 NOT NULL,
FRELATIONTYPEID BIGINT DEFAULT 0 NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FCTRLSTRATEGY VARCHAR(2) DEFAULT ' ' NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FCHANGEREASON NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCHANGETYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FISCHANGECON CHAR(1) DEFAULT '0' NOT NULL,
FLEGALREPRESENT VARCHAR(100) DEFAULT ' ' NOT NULL,
FUNIFIEDCODE VARCHAR(100) DEFAULT ' ' NOT NULL,
FADDRESS NVARCHAR(100) DEFAULT ' ' NOT NULL,
FCONTACTNUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FPOSTALCODE VARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HBSS_SIGNCOMPANYHIS_L')
 CREATE TABLE T_HBSS_SIGNCOMPANYHIS_L (
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FVID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FCHANGEREASON NVARCHAR(50) DEFAULT ' ' NOT NULL,
FADDRESS NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HBSS_CONTRACTTYPECAT')
 CREATE TABLE T_HBSS_CONTRACTTYPECAT (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL
);



/**End D:\PDM_UPGRADE\PDM1\HLCM_table.sql **/
