/**Begin D:\k3Cloud\PDM_UPGRADE\PDM1\MDS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDS_ADJPLANDATA') 
 CREATE TABLE T_MDS_ADJPLANDATA (
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FBILLSTATUS VARCHAR(30) DEFAULT ' ' NOT NULL,
FMODIFYTIME DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FFCVRNNUM BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FINVALDATE DATETIME,
FENABLESTATUS VARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(80) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDS_ADJDATEENTRY') 
 CREATE TABLE T_MDS_ADJDATEENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FFIELDKEY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FTARGETDATE DATETIME,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FDELIVERYCOLUMN CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDS_ADJENTRY') 
 CREATE TABLE T_MDS_ADJENTRY (
FQTY3 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY2 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY5 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY4 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY1 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY103 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY104 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY28 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY101 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY29 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY102 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY26 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY27 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY100 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY24 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY25 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY22 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY23 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY20 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FPARENTENTRYID BIGINT DEFAULT 0 NOT NULL,
FQTY21 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY91 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY92 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY90 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FFCVRNNUMENTRY BIGINT DEFAULT 0 NOT NULL,
FQTY19 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY17 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY18 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY15 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY16 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY13 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY14 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY11 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY99 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY12 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY97 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY10 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY98 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FEDITDATE DATETIME,
FQTY95 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY96 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY93 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY94 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY80 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY81 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FENTRYMODIFIER BIGINT DEFAULT 0 NOT NULL,
FQTY88 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FEDITUSER BIGINT DEFAULT 0 NOT NULL,
FQTY89 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY86 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY87 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY84 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPROJECTID BIGINT DEFAULT 0 NOT NULL,
FQTY85 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FQTY82 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY83 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY70 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRECEIVE2 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRECEIVE1 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY149 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY7 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY6 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY9 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY79 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY8 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY77 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY150 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRECEIVE6 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY78 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRECEIVE5 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY75 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRECEIVE4 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY76 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRECEIVE3 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY73 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY74 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRECEIVE9 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY71 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRECEIVE8 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY72 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRECEIVE7 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FAUXPROPERTYID BIGINT DEFAULT 0 NOT NULL,
FQTY138 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY139 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY147 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY148 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY145 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY146 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY143 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY144 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY68 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY141 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY69 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY142 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY66 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY67 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY140 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY64 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY65 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY62 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY63 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY60 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY61 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPRODORG BIGINT DEFAULT 0 NOT NULL,
FBASEUNITID BIGINT DEFAULT 0 NOT NULL,
FQTY129 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY127 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPLANSCOPE BIGINT DEFAULT 0 NOT NULL,
FQTY128 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY136 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY137 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY134 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY135 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY59 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY132 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY133 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCONFIGID BIGINT DEFAULT 0 NOT NULL,
FQTY57 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY130 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY58 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY131 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY55 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY56 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY53 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY54 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY51 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY52 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY50 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FREMARK NVARCHAR(300) DEFAULT ' ' NOT NULL,
FQTY118 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY119 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY116 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY117 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY125 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY126 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY123 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY124 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY48 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY121 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY49 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY122 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY46 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY47 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY120 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY44 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY45 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY42 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY43 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY40 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY41 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FEDITCREATEDATE DATETIME,
FQTY109 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPLANGP BIGINT DEFAULT 0 NOT NULL,
FQTY107 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY108 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY105 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY106 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY114 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY115 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY39 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY112 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY113 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FRECEIVE10 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FMATERIALID BIGINT DEFAULT 0 NOT NULL,
FQTY37 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY110 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY38 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY111 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY35 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY36 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY33 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY34 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY31 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY32 DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY30 DECIMAL(23,10) DEFAULT 0 NOT NULL
);



/**End D:\k3Cloud\PDM_UPGRADE\PDM1\MDS_table.sql **/
