-- 项目参数新增字段：系统预设 计划方案 计划类型 项目日历管控级别 自上而下时间管控级别 自下而上管控级别
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_PROJECTPARAM' AND KSQL_COL_NAME ='FSYSTEMPRESET') 
ALTER TABLE T_BD_PROJECTPARAM ADD (FSYSTEMPRESET CHAR(1) DEFAULT '0' NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_PROJECTPARAM' AND KSQL_COL_NAME ='FPLAN') 
ALTER TABLE T_BD_PROJECTPARAM ADD (FPLAN VARCHAR(30) DEFAULT 'A' NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_PROJECTPARAM' AND KSQL_COL_NAME ='FPLANTYPE') 
ALTER TABLE T_BD_PROJECTPARAM ADD (FPLANTYPE VARCHAR(30) DEFAULT 'A' NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_PROJECTPARAM' AND KSQL_COL_NAME ='FPJCALENDARCONTROLLEVEL') 
ALTER TABLE T_BD_PROJECTPARAM ADD (FPJCALENDARCONTROLLEVEL VARCHAR(30) DEFAULT 'A' NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_PROJECTPARAM' AND KSQL_COL_NAME ='FTOPDOWNCONTROLLEVEL') 
ALTER TABLE T_BD_PROJECTPARAM ADD (FTOPDOWNCONTROLLEVEL VARCHAR(30) DEFAULT 'A' NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_PROJECTPARAM' AND KSQL_COL_NAME ='FBOTTOMUPCONTROLLEVEL') 
ALTER TABLE T_BD_PROJECTPARAM ADD (FBOTTOMUPCONTROLLEVEL VARCHAR(30) DEFAULT 'A' NOT NULL);
