-- 新增业务组织字段
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MSPLAN_INVLEVELENTRY' AND KSQL_COL_NAME ='FENTRYORG')
 ALTER TABLE T_MSPLAN_INVLEVELENTRY ADD (FENTRYORG BIGINT DEFAULT 0 NOT NULL);

-- 新增仓库字段
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MSPLAN_INVLEVELENTRY' AND KSQL_COL_NAME ='FENTRYSTOCK')
 ALTER TABLE T_MSPLAN_INVLEVELENTRY ADD (FENTRYSTOCK BIGINT DEFAULT 0 NOT NULL);
 
-- 新增物料分类标准字段
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MSPLAN_INVLEVELENTRY' AND KSQL_COL_NAME ='FMATERIALGROUPSTANDARD')
 ALTER TABLE T_MSPLAN_INVLEVELENTRY ADD (FMATERIALGROUPSTANDARD BIGINT DEFAULT 0 NOT NULL);
 
-- 新增物料分类字段
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MSPLAN_INVLEVELENTRY' AND KSQL_COL_NAME ='FMATERIALGROUP')
 ALTER TABLE T_MSPLAN_INVLEVELENTRY ADD (FMATERIALGROUP BIGINT DEFAULT 0 NOT NULL);
 
-- 新增物料字段
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MSPLAN_INVLEVELENTRY' AND KSQL_COL_NAME ='FENTRYMATERIEL')
 ALTER TABLE T_MSPLAN_INVLEVELENTRY ADD (FENTRYMATERIEL BIGINT DEFAULT 0 NOT NULL);