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.qcm.model.DesignMscPlEntity;
import CoreFS.SA06.CoreReturnObject;
import CoreFS.SA08.CoreXmlSqlParsersFactory;

public class CraftOrdDesignMscPlDAL extends DBCommon{

	/**
	 * 查询质量设计制程
	 * @param strDesignMscPlJSON
	 * @return
	 */
	public CoreReturnObject query(String strDesignMscPlJSON){
		DesignMscPlEntity designMscPlEntity = EntityTool.getEntityByJSONStr(strDesignMscPlJSON, DesignMscPlEntity.class);
		String sql = CoreXmlSqlParsersFactory.getSql("CraftOrdDesignMscPlDAL.query");
		sql = EntityTool.fillSqlByEntity(sql, designMscPlEntity);
		return this.getData(sql);
	}
	
	/**
	 * 通过DESIGN_KEY查询质量设计制程
	 * @param strDesignMscPlJSON
	 * @return
	 */
	public CoreReturnObject queryMscPlineByDesignKey(String designKey){
		SqlBuilder b = new SqlBuilder("CraftOrdDesignMscPlDAL.queryMscPlineByDesignKey");
		b.Fill(new String[]{designKey});
		return this.getData(b.toString());
	}
	
	/**
	 * 查询制程和工序
	 * @param designKey
	 * @return
	 */
	public CoreReturnObject queryMscPlineProcess(String designKey){
		SqlBuilder b = new SqlBuilder("CraftOrdDesignMscPlDAL.queryMscPlineProcess");
		b.Fill(new String[]{designKey});
		return this.getData(b.toString());
	}
}
