package com.steering.pss.qcm.DAL;

import com.steering.comm.db.DBCommon;
import com.steering.comm.tools.EntityTool;
import com.steering.comm.tools.StringTool;
import com.steering.pss.sale.order.model.ComMscEntity;
import CoreFS.SA06.CoreReturnObject;
import CoreFS.SA08.CoreXmlSqlParsersFactory;

public class ComMscDAL extends DBCommon{
	/**
	 * 查询冶金规范
	 * @param mscEntity
	 * @return
	 */
	public CoreReturnObject query(String strMscJSON){
		String sql = CoreXmlSqlParsersFactory.getSql("ComMsc.query");
		ComMscEntity mscEntity = EntityTool.getEntityByJSONStr(strMscJSON, ComMscEntity.class);
		sql = EntityTool.fillSqlByEntity(sql, mscEntity);
		return this.getData(sql);
	}
	
	/**
	 * 通过产品码查询冶金规范
	 * @param psc
	 * @return
	 */
	public CoreReturnObject queryByPsc(String psc){
		String sql = CoreXmlSqlParsersFactory.getSql("ComMsc.queryByPsc");
		sql = StringTool.ReplaceAll(sql, "#PSC#", psc);
		return this.getData(sql);
	}
}

