package com.steering.pss.sale.order.qualityDesign.Dao.idao;

import java.sql.Connection;
import java.util.ArrayList;
import com.steering.comm.tools.EntityTool;
import com.steering.comm.tools.StringTool;
import com.steering.pss.qcm.model.GenericEntity;

import CoreFS.SA08.CoreXmlSqlParsersFactory;

public class DetectionLeveDao {
	
	/**
	 * 获取探伤等级是否有效
	 * @param con
	 * @param msc
	 * @return
	 */
	public String ChekDetectionLeve(Connection con, String msc){
		String sql = CoreXmlSqlParsersFactory.getSql("DetectionLeveDao.GetDetectionLeve");
		sql = StringTool.ReplaceAll(sql, "#MSC#", msc);
		ArrayList<GenericEntity> mscDetectionLeves = EntityTool.getEntitysBySqlNoClsCon(sql, con, GenericEntity.class);
		for(GenericEntity mscDetectionLeve : mscDetectionLeves){
			if(mscDetectionLeve.getValue().equals("0")){
				return mscDetectionLeve.getValue2();
			}
		}
		
		return "";
	}
}
