/**Begin D:\DBA2024\差量生成\PDM_UPGRADE\PDM1\SBD_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_SCBOM') 
 CREATE TABLE T_BD_SCBOM (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FTYPEID BIGINT DEFAULT 0 NOT NULL,
FGROUPID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(5) DEFAULT ' ' NOT NULL,
FCTRLSTRATEGY VARCHAR(5) DEFAULT ' ' NOT NULL,
FMATERIALID BIGINT DEFAULT 0 NOT NULL,
FVERSIONID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FDISABLEUSERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(512)
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_SCBOM_L') 
 CREATE TABLE T_BD_SCBOM_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,
FDESCRIPTION NVARCHAR(512)
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_SCBOMENTRY') 
 CREATE TABLE T_BD_SCBOMENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FMATERIALID BIGINT DEFAULT 0 NOT NULL,
FUNITID BIGINT DEFAULT 0 NOT NULL,
FQTYTYPE VARCHAR(5) DEFAULT ' ' NOT NULL,
FQTYNUMERATOR DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTYDENOMINATOR DECIMAL(23,10) DEFAULT 0 NOT NULL,
FVALIDDATE DATETIME,
FINVALIDDATE DATETIME,
FREMARK NVARCHAR(255),
FAUXPTYID BIGINT DEFAULT 0 NOT NULL,
FLOSSFORMULA VARCHAR(5) DEFAULT ' ' NOT NULL,
FVARLOSSRATE DECIMAL(23,10) DEFAULT 0 NOT NULL
);


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



/**End D:\DBA2024\差量生成\PDM_UPGRADE\PDM1\SBD_table.sql **/
