/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\GMC_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_CLASSSTANDARD') 
 CREATE TABLE T_BD_CLASSSTANDARD (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FADMINORGID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCTRLSTRATEGY VARCHAR(10) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FSTATUS CHAR(1) DEFAULT 'C' NOT NULL,
FISPRESET CHAR(1) DEFAULT '0' 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,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_CLASSSTANDARDEXC') 
 CREATE TABLE T_BD_CLASSSTANDARDEXC (
FDATAID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_CLASSSTANDARDUSEREG') 
 CREATE TABLE T_BD_CLASSSTANDARDUSEREG (
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FDATAID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FADMINORGID BIGINT DEFAULT 0 NOT NULL,
FCTRLSTRATEGY VARCHAR(10) DEFAULT ' ' NOT NULL,
FISASSIGN CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BD_ITEMTYPE') 
 CREATE TABLE T_BD_ITEMTYPE (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FSTATUS CHAR(1) DEFAULT 'C' NOT NULL,
FISPRESET CHAR(1) DEFAULT '0' 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,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_DPM_ITEMANDCOMBINATION') 
 CREATE TABLE T_DPM_ITEMANDCOMBINATION (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FISCOMBINATION CHAR(1) DEFAULT '0' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDR_ASSIST_ATTR') 
 CREATE TABLE T_MDR_ASSIST_ATTR (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT 'C' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FLONGNUMBER NVARCHAR(150) DEFAULT ' ' NOT NULL,
FLEVEL BIGINT DEFAULT 0 NOT NULL,
FISLEAF CHAR(1) DEFAULT ' ' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FSORT BIGINT DEFAULT 0 NOT NULL,
FEASNUMBER NVARCHAR(100) 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_MDR_ASSIST_ATTR_L') 
 CREATE TABLE T_MDR_ASSIST_ATTR_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT 'zh_CN' 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_MDR_ASSIST_VALUE_L') 
 CREATE TABLE T_MDR_ASSIST_VALUE_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT 'zh_CN' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDR_ITEM_ATTRVALUE') 
 CREATE TABLE T_MDR_ITEM_ATTRVALUE (
FATTRSID BIGINT DEFAULT 0 NOT NULL,
FATTRID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FATTR BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDR_ITEM_MODEL') 
 CREATE TABLE T_MDR_ITEM_MODEL (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FMODELKEY NVARCHAR(100) DEFAULT ' ' NOT NULL,
FMODELVALUE NVARCHAR(100) DEFAULT ' ' NOT NULL,
FITEMMODEL BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDR_ITEMEXC') 
 CREATE TABLE T_MDR_ITEMEXC (
FDATAID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDR_ITEMUSEREG') 
 CREATE TABLE T_MDR_ITEMUSEREG (
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FDATAID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FADMINORGID BIGINT DEFAULT 0 NOT NULL,
FCTRLSTRATEGY VARCHAR(10) DEFAULT ' ' NOT NULL,
FISASSIGN CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDR_ITEMBRAND') 
 CREATE TABLE T_MDR_ITEMBRAND (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT 'C' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FCTRLSTRATEGY VARCHAR(10) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDR_ITEMBRANDEXC') 
 CREATE TABLE T_MDR_ITEMBRANDEXC (
FDATAID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDR_ITEMBRANDUSEREG') 
 CREATE TABLE T_MDR_ITEMBRANDUSEREG (
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FDATAID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FADMINORGID BIGINT DEFAULT 0 NOT NULL,
FCTRLSTRATEGY VARCHAR(10) DEFAULT ' ' NOT NULL,
FISASSIGN CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDR_ASSIST_VALUE') 
 CREATE TABLE T_MDR_ASSIST_VALUE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT 'C' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FGROUPID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FCTRLSTRATEGY VARCHAR(10) DEFAULT ' ' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FEASNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDR_ITEM') 
 CREATE TABLE T_MDR_ITEM (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FMODEL NVARCHAR(160) DEFAULT ' ' NOT NULL,
FOWNER BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FSHORTNUMBER NVARCHAR(30) DEFAULT ' ' NOT NULL,
FEASNUM NVARCHAR(80) DEFAULT ' ' NOT NULL,
FGROSSWEIGHT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FBASEUNITID BIGINT DEFAULT 0 NOT NULL,
FWEIGHTUNITID BIGINT DEFAULT 0 NOT NULL,
FLENGTH DECIMAL(23,10) DEFAULT 0 NOT NULL,
FHEIGHT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FWIDTH DECIMAL(23,10) DEFAULT 0 NOT NULL,
FVOLUMNUNITID BIGINT DEFAULT 0 NOT NULL,
FLENGTHUNITID BIGINT DEFAULT 0 NOT NULL,
FGROUPID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCTRLSTRATEGY VARCHAR(10) DEFAULT ' ' NOT NULL,
FSEARCHKEY NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSERIALNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL,
FTHUMBNAIL NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPICTURE1 NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPICTURE2 NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPICTURE3 NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPICTURE4 NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPICTURE5 NVARCHAR(255) DEFAULT ' ' NOT NULL,
FITEMBRANDID BIGINT DEFAULT 0 NOT NULL,
FASSISTUNITID BIGINT DEFAULT 0 NOT NULL,
FISFROMEAS CHAR(1) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FDESCRIPTION_TAG NCLOB,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FSTATUS CHAR(1) DEFAULT 'C' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FHASATTR CHAR(1) DEFAULT ' ' NOT NULL,
FTITLE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSHORTTITLE NVARCHAR(510) DEFAULT ' ' NOT NULL,
FCONVERSIONFOR NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCOSTPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FMATERIAL BIGINT DEFAULT 0 NOT NULL,
FMATERIALMASTERID BIGINT DEFAULT 0 NOT NULL,
FSALEUNIT BIGINT DEFAULT 0 NOT NULL,
FSORTNUMBER BIGINT DEFAULT 0 NOT NULL,
FTAXCLASSCODEID BIGINT DEFAULT 0 NOT NULL,
FGOODSBELONG CHAR(1) DEFAULT '0' NOT NULL,
FITEMTYPEID BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FMULTIDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMODELNUM NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDR_ITEM_ATTR') 
 CREATE TABLE T_MDR_ITEM_ATTR (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FATTR BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDR_ITEM_ATTRVALUES') 
 CREATE TABLE T_MDR_ITEM_ATTRVALUES (
FATTRSID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL,
FEASNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDR_ITEM_BRANDS') 
 CREATE TABLE T_MDR_ITEM_BRANDS (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDR_ITEM_C') 
 CREATE TABLE T_MDR_ITEM_C (
FID BIGINT DEFAULT 0 NOT NULL,
FMINPACKNUM DECIMAL(23,10) DEFAULT 0 NOT NULL,
FNEWSELL CHAR(1) DEFAULT '0' NOT NULL,
FONLYNOW CHAR(1) DEFAULT '0' NOT NULL,
FSTOPPRODUCE CHAR(1) DEFAULT '0' NOT NULL,
FRECOMMEND CHAR(1) DEFAULT '0' NOT NULL,
FNONSINGLE CHAR(1) DEFAULT '0' NOT NULL,
FITEMCLASSID BIGINT DEFAULT 0 NOT NULL,
FREFERENCEPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FISPROMOTIONAL CHAR(1) DEFAULT '0' NOT NULL,
FCURRENCY BIGINT DEFAULT 0 NOT NULL,
FISASSISTORDER CHAR(1) DEFAULT '0' NOT NULL,
FSTOCKUNITID BIGINT DEFAULT 0 NOT NULL,
FENABLESERIAL CHAR(1) DEFAULT '0' NOT NULL,
FONLYOUTANDINREQUEST CHAR(1) DEFAULT '0' NOT NULL,
FSERIALUNITID BIGINT DEFAULT 0 NOT NULL,
FENABLELOT CHAR(1) DEFAULT '0' NOT NULL,
FORDERUNITID BIGINT DEFAULT 0 NOT NULL,
FMINORDERQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FORDERBATCHQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRETAILUNITID BIGINT DEFAULT 0 NOT NULL,
FBARCODEID BIGINT DEFAULT 0 NOT NULL,
FBARCODENUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FRETAILPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FMEMBERPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSALETYPE CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDR_ITEM_L') 
 CREATE TABLE T_MDR_ITEM_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT 'zh_CN' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FMULTIDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMODELNUM NVARCHAR(100) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSHORTTITLE NVARCHAR(510) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDR_ITEM_S') 
 CREATE TABLE T_MDR_ITEM_S (
FID BIGINT DEFAULT 0 NOT NULL,
FSALEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FEVALUATEQTY BIGINT DEFAULT 0 NOT NULL,
FASSISTSALEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSTOREINFO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FAPPROVERID BIGINT DEFAULT 0 NOT NULL,
FAPPROVEDATE DATETIME,
FNOSELLTIME DATETIME,
FUPDATETIME DATETIME,
FNEWSELLTIME DATETIME,
FSELLTIME DATETIME,
FISONSELL CHAR(1) DEFAULT '1' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FVOLUME DECIMAL(23,10) DEFAULT 0 NOT NULL,
FNETWEIGHT DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDR_ITEMCLASS') 
 CREATE TABLE T_MDR_ITEMCLASS (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT 'C' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FLONGNUMBER NVARCHAR(240) DEFAULT ' ' NOT NULL,
FLEVEL INT 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,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FEASNUMBER NVARCHAR(30) DEFAULT ' ' NOT NULL,
FSTANDARDID BIGINT DEFAULT 0 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_MDR_ITEMCLASS_L') 
 CREATE TABLE T_MDR_ITEMCLASS_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT 'zh_CN' 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_MDR_ITEMCLASSENTRY') 
 CREATE TABLE T_MDR_ITEMCLASSENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCLASSSTANDARDID BIGINT DEFAULT 0 NOT NULL,
FGOODSCLASSID BIGINT DEFAULT 0 NOT NULL
);


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



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