--样本历史使用数据:业务类型
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_SAMPLEHISRECORD' AND KSQL_COL_NAME ='FBIZTYPE')
ALTER TABLE T_MDS_SAMPLEHISRECORD ADD (FBIZTYPE BIGINT NOT NULL DEFAULT 0);
--样本历史使用数据:计划号
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_SAMPLEHISRECORD' AND KSQL_COL_NAME ='FPLANNO')
ALTER TABLE T_MDS_SAMPLEHISRECORD ADD (FPLANNO NVARCHAR(50) NOT NULL DEFAULT ' ');
--样本历史使用数据:分析维度
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_SAMPLEHISRECORD' AND KSQL_COL_NAME ='FANALYSISDIM')
ALTER TABLE T_MDS_SAMPLEHISRECORD ADD (FANALYSISDIM NVARCHAR(50) NOT NULL DEFAULT ' ');
--样本历史使用数据:备货项目
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_SAMPLEHISRECORD' AND KSQL_COL_NAME ='FBACKUPPROJECT')
ALTER TABLE T_MDS_SAMPLEHISRECORD ADD (FBACKUPPROJECT BIGINT NOT NULL DEFAULT 0);
--历史用量明细表:计划号
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_HISUSEDETAIL' AND KSQL_COL_NAME ='FPLANNO')
ALTER TABLE T_MDS_HISUSEDETAIL ADD (FPLANNO NVARCHAR(50) NOT NULL DEFAULT ' ');

--用量概率分析结果:分析维度
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_PROBABILITYRESULT' AND KSQL_COL_NAME ='FANALYSISDIM')
ALTER TABLE T_MDS_PROBABILITYRESULT ADD (FANALYSISDIM VARCHAR(5) NOT NULL DEFAULT ' ');
--用量概率分析结果:统计维度
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_PROBABILITYRESULT' AND KSQL_COL_NAME ='FCOUNTDIM')
ALTER TABLE T_MDS_PROBABILITYRESULT ADD (FCOUNTDIM VARCHAR(5) NOT NULL DEFAULT ' ');
--用量概率分析结果:备货项目
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_PROBABILITYRESULT' AND KSQL_COL_NAME ='FBACKUPPROJECT')
ALTER TABLE T_MDS_PROBABILITYRESULT ADD (FBACKUPPROJECT BIGINT NOT NULL DEFAULT 0);
--用量概率分析结果:工卡
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_PROBABILITYRESULT' AND KSQL_COL_NAME ='FCARD')
ALTER TABLE T_MDS_PROBABILITYRESULT ADD (FCARD BIGINT NOT NULL DEFAULT 0);
--用量概率分析结果:统计维度(多选下拉)
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_PROBABILITYRESULT' AND KSQL_COL_NAME ='FSUPPLYRESP')
ALTER TABLE T_MDS_PROBABILITYRESULT ADD (FSUPPLYRESP NVARCHAR(50) NOT NULL DEFAULT ' ');
--用量概率分析结果:合同类型名称
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_PROBABILITYRESULT' AND KSQL_COL_NAME ='FCONMTYPENAME')
ALTER TABLE T_MDS_PROBABILITYRESULT ADD (FCONMTYPENAME NVARCHAR(2000) NOT NULL DEFAULT ' ');
--用量概率分析结果:合同类型编码
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_PROBABILITYRESULT' AND KSQL_COL_NAME ='FCONMTYPENUMBER')
ALTER TABLE T_MDS_PROBABILITYRESULT ADD (FCONMTYPENUMBER NVARCHAR(2000) NOT NULL DEFAULT ' ');
--用量概率分析结果:合同类型ID
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_PROBABILITYRESULT' AND KSQL_COL_NAME ='FCONMTYPEID')
ALTER TABLE T_MDS_PROBABILITYRESULT ADD (FCONMTYPEID NVARCHAR(2000) NOT NULL DEFAULT ' ');

--样本数据:客舱改装状态
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_SAMPLE' AND KSQL_COL_NAME ='FPOLARISSTATUS')
ALTER TABLE T_MDS_SAMPLE ADD (FPOLARISSTATUS BIGINT NOT NULL DEFAULT 0);
--样本数据:客舱构型
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_SAMPLE' AND KSQL_COL_NAME ='FCONFIGURATION')
ALTER TABLE T_MDS_SAMPLE ADD (FCONFIGURATION BIGINT NOT NULL DEFAULT 0);
--样本数据:备货项目
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_SAMPLE' AND KSQL_COL_NAME ='FBACKUPPROJECT')
ALTER TABLE T_MDS_SAMPLE ADD (FBACKUPPROJECT BIGINT NOT NULL DEFAULT 0);
--样本数据:分析维度
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MDS_SAMPLE' AND KSQL_COL_NAME ='FANALYSISDIM')
ALTER TABLE T_MDS_SAMPLE ADD (FANALYSISDIM NVARCHAR(50) NOT NULL DEFAULT ' ');