-- 新增M2未排量/用量
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_DPSTABLEDATA_R' AND KSQL_COL_NAME ='fmtwouse')
 ALTER TABLE T_MDS_DPSTABLEDATA_R ADD (fmtwouse DECIMAL(23,10) DEFAULT 0 NOT NULL);
 
 -- 安全库存
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_DPSTABLEDATA_R' AND KSQL_COL_NAME ='fsafestock')
 ALTER TABLE T_MDS_DPSTABLEDATA_R ADD (fsafestock DECIMAL(23,10) DEFAULT 0 NOT NULL);
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_DPSTABLEDATA_R' AND KSQL_COL_NAME ='fweekplangap')
 ALTER TABLE T_MDS_DPSTABLEDATA_R ADD (fweekplangap DECIMAL(23,10) DEFAULT 0 NOT NULL);
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_DPSTABLEDATA_R' AND KSQL_COL_NAME ='fweekresultgap')
 ALTER TABLE T_MDS_DPSTABLEDATA_R ADD (fweekresultgap DECIMAL(23,10) DEFAULT 0 NOT NULL);
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_DPSTABLEDATA' AND KSQL_COL_NAME ='fmitem')
 ALTER TABLE T_MDS_DPSTABLEDATA ADD (fmitem  BIGINT DEFAULT 0 NOT NULL);
 