package com.steering.rpt.production;

import java.sql.SQLException;

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

import com.steering.comm.db.DBCommon;
import com.steering.comm.tools.SqlBuilder;
import com.steering.comm.tools.StringTool;

public class TotalProduction extends DBCommon{
	/***
	 * 产量报表
	 * @param today
	 * @return
	 */
	public CoreReturnObject getQuantity_A(String today)
	{
		return this.getDataBySqlID("FrmrptTotalProduct.getA_TotalProductionData",
				new Object[] { today,today,today,today });
	}
	public CoreReturnObject getQuantity_A1(String today)
	{
		String sql= CoreXmlSqlParsersFactory.getSql("FrmrptTotalProduct.get_TotalProductionData0");
		sql = StringTool.ReplaceAll(sql, "#today#", today);
	    return this.getData(sql);
   
	}
	
	public CoreReturnObject getQuantity(String today) throws SQLException {
		CoreReturnObject mydata=new CoreReturnObject();
		try {
			String sqlInsertTemp = CoreXmlSqlParsersFactory
					.getSql("FrmrptTotalProduct.get_TotalProductionData_Insert");
			sqlInsertTemp = sqlInsertTemp.replaceAll("#today#", today);
	        this.getDao(CoreConstantData.sysbeanstr).ExcuteNonQuery(sqlInsertTemp, new Object[] {});

			String sqlSelectTemp = CoreXmlSqlParsersFactory
			.getSql("FrmrptTotalProduct.get_TotalProductionData_Select");
			sqlSelectTemp = sqlSelectTemp.replaceAll("#today#", today);
	        mydata=this.getData(sqlSelectTemp);

			
			
		} 
		catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} 
		return mydata;		
	}
	
	
	

	
	public CoreReturnObject getQuantity0(String today)
	{
		String sql= CoreXmlSqlParsersFactory.getSql("FrmrptTotalProduct.get_TotalProductionData0");
	    sql = StringTool.ReplaceAll(sql, "#today#", today);
	    	
	    return this.getData(sql);

	}
	
	public CoreReturnObject getQuantityA_detail(String today,String plinename)
	{
		SqlBuilder b = new SqlBuilder("FrmrptTotalProduct.getA_ProductionData");
		b.Fill(new String[]{ today,plinename });
	    	
		return this.getData(b.toString());

	}
	public CoreReturnObject getQuantityB_detail(String today,String plinename)
	{
		SqlBuilder b = new SqlBuilder("FrmrptTotalProduct.getB_ProductionData");
		b.Fill(new String[]{ today,plinename });
	    	
		return this.getData(b.toString());

	}
	public CoreReturnObject getQuantityD_detail(String today,String plinename)
	{
		SqlBuilder b = new SqlBuilder("FrmrptTotalProduct.getD_ProductionData");
		b.Fill(new String[]{ today,plinename });
	    	
		return this.getData(b.toString());

	}
	public CoreReturnObject getQuantityE_detail(String today,String plinename)
	{
		SqlBuilder b = new SqlBuilder("FrmrptTotalProduct.getE_ProductionData");

		b.Fill(new String[]{ today,plinename });
	    	
		return this.getData(b.toString());

	}
	public CoreReturnObject getQuantityF_detail(String today,String plinename)
	{
		SqlBuilder b = new SqlBuilder("FrmrptTotalProduct.getF_ProductionData");

		b.Fill(new String[]{ today,plinename });
	    	
		return this.getData(b.toString());

	}
	public CoreReturnObject getQuantityG_detail(String today,String plinename)
	{
		SqlBuilder b =  new SqlBuilder("FrmrptTotalProduct.getG_ProductionData");
		b.Fill(new String[]{ today,plinename });
	    	
		return this.getData(b.toString());

	}


}
