package com.steering.pss.judge.DAL;

import com.steering.comm.converter.CoreConverter;
import com.steering.comm.db.DBCommon;
import com.steering.comm.tools.SqlBuilder;
import com.steering.comm.tools.StringTool;

import CoreFS.SA06.CoreReturnObject;
import CoreFS.SA08.CoreXmlSqlParsersFactory;

public class QcmJhyElementsDAL extends DBCommon{
//	/**
//	 * 查询炉成分实绩表
//	 * @param stoveNo
//	 * @return
//	 */
//	public CoreReturnObject queryByStoveNo(String stoveNo, Integer judgeType){
//		SqlBuilder sql;
//		String strJudgeType = judgeType.toString();
//		if(judgeType.toString().endsWith("3")){
//			sql = new SqlBuilder("QcmJhyElementsDAL.queryLgColligate");
//		}else{
//			sql = new SqlBuilder("QcmJhyElementsDAL.queryByStoveNo");
//		}
//		String processCode = "";
//		if(strJudgeType.startsWith("1")){
//			processCode = "A";
//		}else if(strJudgeType.startsWith("2")){
//			processCode = "B";
//		}else if(strJudgeType.startsWith("3")){
//			if(strJudgeType.equals("33")){
//				processCode = "A";
//			}else{
//				processCode = "D";
//			}
//		}else if(strJudgeType.startsWith("4")){
//			processCode = "E";
//		}
//		sql.AppendLn("AND T.STOVE_NO = {1}", strJudgeType.startsWith("1") || strJudgeType.startsWith("2") || strJudgeType.equals("33"));
//		sql.AppendLn("AND T.JUDGE_STOVE_NO = {1}", !strJudgeType.startsWith("1") && !strJudgeType.startsWith("2") && !strJudgeType.equals("33"));
//		sql.Fill(new String[]{processCode, stoveNo});
//		return this.getData(sql.toString());
//	}
//	
//	/**
//	 * 查询炼钢判定成分实绩记录
//	 * @param stoveNo
//	 * @return
//	 */
//	public CoreReturnObject querySteelMakingByStoveNo(String stoveNo){
//		String sql = CoreXmlSqlParsersFactory.getSql("QcmJhyElementsDAL.querySteelMakingByStoveNo");
//		sql = StringTool.ReplaceAll(sql, "#STOVE_NO#", stoveNo);
//		return this.getData(sql);
//	}
//	
////	/**
////	 * 查询轧管判定需要的DesignKey
////	 * @param proOrderId
////	 * @return
////	 */
////	public CoreReturnObject queryRolledTubeDesignKey(String proPlanId, String gxPlanId){
////		return this.getData(queryRolledTubeDesignKeySql(proPlanId, gxPlanId));
////	}
//	
////	public String queryRolledTubeDesignKeySql(String proPlanId, String gxPlanId){
////		SqlBuilder b = new SqlBuilder("QcmJhyElementsDAL.queryRolledTubeDesignKey");
////		b.Fill(new String[]{ proPlanId, gxPlanId });
////		return b.toString();
////	}
//	
////	/**
////	 * 查询轧管判定需要的DesignKey
////	 * @param proOrderId
////	 * @return
////	 */
////	public CoreReturnObject queryExpansionDesignKey(String heatPlanNo){
////		return this.getData(queryExpansionDesignKeySql(heatPlanNo));
////	}
//	
////	public String queryExpansionDesignKeySql(String heatPlanNo){
////		SqlBuilder b = new SqlBuilder("QcmJhyElementsDAL.queryExpansionDesignKey");
////		b.Fill(new String[]{heatPlanNo});
////		return b.toString();
////	}
//	
////	/**
////	 * 
////	 * @param stoveNo
////	 * @return
////	 */
////	public CoreReturnObject querySteelForOrdDesignKey(String stoveNo){
////		return this.getData(querySteelForOrdDesignKeySql(stoveNo));
////	}
////	
////	public String querySteelForOrdDesignKeySql(String stoveNo){
////		SqlBuilder b = new SqlBuilder("QcmJhyElementsDAL.querySteelForOrdDesignKey");
////		b.Fill(new String[]{stoveNo});
////		return b.toString();
////	}
//	
//	/**
//	 * 查询工艺设计结果成分（一套内控标准）
//	 * @param proOrderNo
//	 * @return
//	 */
//	public CoreReturnObject queryCraftResultCic(String designKey, String mscPline, String judgeType, String cic, String[] specFlags){
//		return this.getData(queryCraftResultCicSql(designKey, mscPline, judgeType, cic, specFlags));
//	}
//	
//	public String queryCraftResultCicSql(String designKey, String mscPline, String judgeType,
//			String cic, String[] specFlags){
//		SqlBuilder b = new SqlBuilder("QcmJhyElementsDAL.queryCraftResultCic");
//		b.AppendLn(CoreConverter.toSqlConditionString("SPECL_FL", specFlags), specFlags.length > 0);
//		//内控有可能有多套， 但只能取一套。
//		String process = "";
//    	if(judgeType.startsWith("1")){
//    		process = "A";
//    	}else if(judgeType.startsWith("2")){
//    		process = "B";
//    	}else if(judgeType.startsWith("3")){
//    		process = "D";
//    	}else if(judgeType.startsWith("4")){
//    		process = "E";
//    	}
//    	
//    	b.AppendLn("AND DECODE(SPECL_FL, '2', MSC_PLINE, 1) = DECODE(SPECL_FL, '2', {1}, 1)", !mscPline.equals(""));
//    	b.AppendLn("AND DECODE(SPECL_FL, '2', PROCESS_CODE, 1) = DECODE(SPECL_FL, '2', {2}, 1)", !process.equals(""));
//		b.Append("AND DECODE(SPECL_FL, '2', CIC, 1) = DECODE(SPECL_FL, '2', {3}, 1)", !cic.equals(""));
//		b.Fill(new String[]{designKey, mscPline, process, cic});
//		return b.toString();
//	}
//	
//	/**
//	 * 查询工艺设计结果成分(所有交付标准)
//	 * @param proOrderNo
//	 * @return
//	 */
//	public CoreReturnObject queryCraftResultCicJf(String proOrderId){
//		String sql = CoreXmlSqlParsersFactory.getSql("QcmJhyElementsDAL.queryCraftResultCicJf");
//		sql = StringTool.ReplaceAll(sql, "#PRO_PLAN_ID#", proOrderId);
//		return this.getData(sql);
//	}
//	
//	/**
//	 * 查询工艺成分套数（成品成分和熔炼成分套数）
//	 * @param designKey
//	 * @return
//	 */
//	public CoreReturnObject QueryCraftChemCnt(String designKey){
//		SqlBuilder b = new SqlBuilder("QcmJhyElementsDAL.QueryCraftChemCnt");
//		b.Fill(new String[]{designKey});
//		return this.getData(b.toString());
//	}
//	
//	/**
//	 * 通过主键查询成分实绩信息
//	 * @param assayNo
//	 * @return
//	 */
//	public CoreReturnObject queryByPk(String assayNo){
//		return this.getData(queryByPkSql(assayNo));
//	}
//	
//	public String queryByPkSql(String assayNo){
//		return new SqlBuilder("QcmJhyElementsDAL.queryByPk").Fill(new String[]{assayNo}).toString();
//	}
}
