package com.steering.pss.ydm.Stuffmanage;

import java.util.ArrayList;

import CoreFS.SA06.CoreReturnObject;
import CoreFS.SA08.CoreXmlSqlParsersFactory;

import com.steering.comm.db.DBCommon;

public class FrmLGFinishing extends DBCommon{

	public CoreReturnObject doQueryOfflieResult(ArrayList<String> parm,String startTim,String endTim)
	{
		String sql = CoreXmlSqlParsersFactory.getSql("FrmLGFinishing.doQueryOfflieResult");
		if(!startTim.equals(""))
		{
		   sql += " AND T.OFFLINE_TIME >= to_date('"+startTim+"','YYYY-MM-DD HH24:MI:SS') AND T.OFFLINE_TIME <= to_date('"+endTim+"','YYYY-MM-DD HH24:MI:SS')";
		}
		return this.getData(sql, parm.toArray());
	}
	/***
	 * 查询组炉实绩
	 * @param parm
	 * @param startTim
	 * @param endTim
	 * @return
	 */
	public CoreReturnObject doQueryFurnace(ArrayList<String> parm,String startTim,String endTim)
	{
		String sql = CoreXmlSqlParsersFactory.getSql("FrmLGFinishing.doQueryFurnace");
		return this.getData(sql, parm.toArray());
	}
	/***
	 * 查询组炉详细信息
	 * @return
	 */
	public CoreReturnObject  doQueryFurnaceGroup(String stoveNo)
	{
		return this.getDataBySqlID("FrmLGFinishing.doQueryFurnaceGroup", new Object[]{stoveNo});
	}
	/***
	 * 查询操作实绩
	 * @return
	 */
	public CoreReturnObject doQueryBack(ArrayList<String> parm,String startTim,String endTim)
	{
		String sql = CoreXmlSqlParsersFactory.getSql("FrmLGFinishing.doQueryBack");
		if(!startTim.equals(""))
		{
		   sql += " AND T.COL_TIME >= to_date('"+startTim+"','YYYY-MM-DD HH24:MI:SS') AND T.COL_TIME <= to_date('"+endTim+"','YYYY-MM-DD HH24:MI:SS')";
		}
		return this.getData(sql, parm.toArray());
	}
	/***
	 * 查询委外实绩
	 * @param parm
	 * @param startTim
	 * @param endTim
	 * @return
	 */
	public CoreReturnObject doQuerySubcontract(ArrayList<String> parm,String startTim,String endTim)
	{
		String sql = CoreXmlSqlParsersFactory.getSql("FrmLGFinishing.doQuerySubcontract");
		if(!startTim.equals(""))
		{
		   sql += " AND T.ENTRUSTED_TIME >= to_date('"+startTim+"','YYYY-MM-DD HH24:MI:SS') AND T.ENTRUSTED_TIME <= to_date('"+endTim+"','YYYY-MM-DD HH24:MI:SS')";
		}
		return this.getData(sql, parm.toArray());
	}
}
