package com.steering.pss.sale.order.DAL;

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

public class CraftOrdDesignBlDAL extends DBCommon{
	
	/**
	 * 查询质量设计备料
	 * @param strDesignBlJSON
	 * @return
	 */
	public CoreReturnObject query(String strDesignBlJSON){
		DesignMscBlEntity designMscBlEntity = EntityTool.getEntityByJSONStr(strDesignBlJSON, DesignMscBlEntity.class);
		String sql = CoreXmlSqlParsersFactory.getSql("CraftOrdDesignBlDAL.query");
		sql = EntityTool.fillSqlByEntity(sql, designMscBlEntity);
		
		return this.getData(sql);
	}
	
	/**
	 * 通过DESIGN_KEYS查询质量设计备料
	 * @return
	 */
	public CoreReturnObject queryByDesignKeys(String designKeys){
		String sql = CoreXmlSqlParsersFactory.getSql("CraftOrdDesignBlDAL.queryByDesignKeys");
		sql = sql.replaceAll("#DESGIN_KEY#", designKeys);
		return this.getData(sql);
	}
}
