/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SBD_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_MATERIALMFTINFO') 
 CREATE TABLE T_BD_MATERIALMFTINFO (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(60) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(10) DEFAULT ' ' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FCTRLSTRATEGY VARCHAR(10) DEFAULT ' ' NOT NULL,
FDEPARTMENTORGID BIGINT DEFAULT 0 NOT NULL,
FMATERIALATTR VARCHAR(10) DEFAULT ' ' NOT NULL,
FMFTUNITID BIGINT DEFAULT 0 NOT NULL,
FISCONFIGURABLE CHAR(1) DEFAULT '0' NOT NULL,
FGROUPID BIGINT DEFAULT 0 NOT NULL,
FPLANTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FMTFSTRATEGYID BIGINT DEFAULT 0 NOT NULL,
FPLANDEPARTMENTID BIGINT DEFAULT 0 NOT NULL,
FPLANPERSONID BIGINT DEFAULT 0 NOT NULL,
FOFFSETMODE VARCHAR(10) DEFAULT ' ' NOT NULL,
FFORWARDDAYOFFSET INT DEFAULT 0 NOT NULL,
FBACKWARDDAYSOFFSET INT DEFAULT 0 NOT NULL,
FISOLATEDRULE VARCHAR(10) DEFAULT ' ' NOT NULL,
FYIELD INT DEFAULT 0 NOT NULL,
FSCRAPRATE INT DEFAULT 0 NOT NULL,
FSCRAPRATEEXPR VARCHAR(10) DEFAULT ' ' NOT NULL,
FTHROWMODE VARCHAR(10) DEFAULT ' ' NOT NULL,
FISMERGESIGN CHAR(1) DEFAULT '0' NOT NULL,
FLEADTIMETYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FFIXEDLEADTIME INT DEFAULT 0 NOT NULL,
FCHANGELEADTIME INT DEFAULT 0 NOT NULL,
FCHANGEBATCHQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FTESTLEADTIME INT DEFAULT 0 NOT NULL,
FFORWARDTIME INT DEFAULT 0 NOT NULL,
FBACKWARDTIME INT DEFAULT 0 NOT NULL,
FBATCHPOLICY VARCHAR(10) DEFAULT ' ' NOT NULL,
FFIXBATCHQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBATCHCYCLE INT DEFAULT 0 NOT NULL,
FMULTIPLE INT DEFAULT 0 NOT NULL,
FBATCHINCQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPARTTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FPARTDAYS INT DEFAULT 0 NOT NULL,
FMAXBATCHQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FMINBATCHQTY DECIMAL(23,10) DEFAULT 0 NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_MATERIALMTFINFOGROUP_L') 
 CREATE TABLE T_BD_MATERIALMTFINFOGROUP_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,
FFULLNAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PDM_MANUFACTURESTRATEGY') 
 CREATE TABLE T_PDM_MANUFACTURESTRATEGY (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(60) DEFAULT ' ' NOT NULL,
FSTATUS NVARCHAR(10) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE NVARCHAR(10) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FSTRATEGYDES NVARCHAR(255) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_MATERIALMFTINFO_M') 
 CREATE TABLE T_BD_MATERIALMFTINFO_M (
FID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FISKEYPART NVARCHAR(10) DEFAULT ' ' NOT NULL,
FOUTPUTTYPE NVARCHAR(10) DEFAULT ' ' NOT NULL,
FPROVIDETYPE NVARCHAR(10) DEFAULT ' ' NOT NULL,
FSUPPLYORGUNITID BIGINT DEFAULT 0 NOT NULL,
FISSUEMODE NVARCHAR(10) DEFAULT ' ' NOT NULL,
FISBACKFLUSH CHAR(1) DEFAULT '0' NOT NULL,
FISSUELEADTIME INT DEFAULT 0 NOT NULL,
FISQUOTACONTROL CHAR(1) DEFAULT '0' NOT NULL,
FISSINHIGHLIMIT INT DEFAULT 0 NOT NULL,
FISSINLOWLIMIT INT DEFAULT 0 NOT NULL,
FISREPORTLIMIT CHAR(1) DEFAULT '0' NOT NULL,
FRPTHIGHLIMIT INT DEFAULT 0 NOT NULL,
FRPTLOWLIMIT INT DEFAULT 0 NOT NULL,
FISSTORAGELIMIT CHAR(1) DEFAULT '0' NOT NULL,
FRCVINHIGHLIMIT INT DEFAULT 0 NOT NULL,
FRCVINLOWLIMIT INT DEFAULT 0 NOT NULL,
FISSTOCKALLOT CHAR(1) DEFAULT '0' NOT NULL,
FOUTSTORAGEUNITID BIGINT DEFAULT 0 NOT NULL,
FOUTWAREHOUSEID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITTIME DATETIME,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_MATERIALMTFINFOGROUP') 
 CREATE TABLE T_BD_MATERIALMTFINFOGROUP (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(60) DEFAULT ' ' NOT NULL,
FSTATUS NVARCHAR(10) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE NVARCHAR(10) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FLEVEL BIGINT DEFAULT 0 NOT NULL,
FISLEAF CHAR(1) DEFAULT '0' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FLONGNUMBER NVARCHAR(255) DEFAULT ' '
);



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