package com.steering.pss.judge.DAL;

import java.sql.Connection;
import java.sql.SQLException;

import com.steering.comm.db.DBCommon;
import com.steering.comm.tools.EntityTool;
import com.steering.comm.tools.SqlBuilder;
import com.steering.pss.qcm.model.GenericEntity;

import CoreFS.SA06.CoreReturnObject;
import CoreFS.SC01.CoreConstantData;

public class QcmJhyPhyDbResultDAL extends DBCommon{
	
//	/**
//	 * 查询检化验低倍数据
//	 * @param judgeStoveNo
//	 * @return
//	 */
//	public CoreReturnObject query(String judgeStoveNo, String designKey, String pic, String mscPline){
//		
//		Connection con = this.getDao(CoreConstantData.sysbeanstr).getConnection();
//		String sql = getQueryString(judgeStoveNo, designKey, pic, mscPline, con );
//		try {
//			con.close();
//		} catch (SQLException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
//		
//		return this.getData(sql);
//	}
	
//	public String getQueryString(String judgeStoveNo, String designKey, 
//			String pic, String mscPline, Connection con){
//		SqlBuilder b = new SqlBuilder("QcmJhyPhyDbResultDAL.queryCraftDbCnt");
//		b.Fill(new String[]{ designKey, mscPline, "B", pic });
//		GenericEntity count = EntityTool.getEntityBySqlNoClsCon(
//				b.toString(), con, GenericEntity.class);
//		String phyCodeMin = "";
//		if(!count.getCount().equals("0")){
//			b = new SqlBuilder("QcmJhyPhyDbResultDAL.queryCraftProcessC");
//			b.Fill(new String[]{ designKey, mscPline, "B" });
//			GenericEntity value = EntityTool.getEntityBySqlNoClsCon(
//					b.toString(), con, GenericEntity.class);
//			
//			
//			if(value.getValue().equals("B002")){//连铸
//				phyCodeMin = "C0010";
//			}else{//模铸
//				phyCodeMin = "C0025";
//			}
//		}
//		
//		b = new SqlBuilder("QcmJhyPhyDbResultDAL.query");
//		b.Fill(new String[]{ judgeStoveNo, phyCodeMin });
//		
//		return b.toString();
//	}
	
	/**
	 * 查询工艺低倍数
	 * @param designKey
	 * @param mscPline
	 * @param pic
	 * @return
	 */
	public CoreReturnObject queryCraftDbCnt(String designKey, String mscPline, String pic){
		SqlBuilder b = new SqlBuilder("QcmJhyPhyDbResultDAL.queryCraftDbCnt");
		b.Fill(new String[]{ designKey, mscPline, "B", pic });
		
		return this.getData(b.toString());
	}
}
