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

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

public class CraftOrdDesignMscPlPrcDAL extends DBCommon{
	
	/**
	 * 查询质量设计工序
	 * @param strDesignMscPlPrcJSON
	 * @return
	 */
	public CoreReturnObject query(String strDesignMscPlPrcJSON){
		DesignMscPlPrcEntity designMscPlPrcEntity = EntityTool.getEntityByJSONStr(strDesignMscPlPrcJSON, DesignMscPlPrcEntity.class);
		String sql = CoreXmlSqlParsersFactory.getSql("CraftOrdDesignMscPlPrcDAL.query");
		sql = EntityTool.fillSqlByEntity(sql, designMscPlPrcEntity);
		return this.getData(sql);
	}
	
	/**
	 * 通过DESIGN_KEY查询质量设计工序
	 * @param strDesignMscPlPrcJSON
	 * @return
	 */
	public CoreReturnObject queryProcessByDesignKey(String strDesignMscPlPrcJSON){
		DesignMscPlPrcEntity designMscPlPrcEntity = EntityTool.getEntityByJSONStr(strDesignMscPlPrcJSON, DesignMscPlPrcEntity.class);
		String sql = CoreXmlSqlParsersFactory.getSql("CraftOrdDesignMscPlPrcDAL.queryProcessByDesignKey");
		sql = EntityTool.fillSqlByEntity(sql, designMscPlPrcEntity);
		return this.getData(sql);
	}
	
	public CoreReturnObject queryProcess(String designKey, String mscPline){
		SqlBuilder b = new SqlBuilder("CraftOrdDesignMscPlPrcDAL.queryProcess");
		b.Fill(new String[]{designKey, mscPline});
		return this.getData(b.toString());
	}
	
	public CoreReturnObject queryProcessNkIndex(String designKey, String mscPline, String processCode){
		SqlBuilder b = new SqlBuilder("CraftOrdDesignMscPlPrcDAL.queryProcessNkIndex");
		b.Fill(new String[]{designKey, mscPline, processCode});
		return this.getData(b.toString());
	}
}
