package com.steering.pss.ydm.Report;

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

import com.steering.comm.converter.CoreConverter;
import com.steering.comm.db.DBCommon;

public class FrmrptStoveBatchStorageZg extends DBCommon{
	/***
	 * 所属权收发存
	 * @param date1
	 * @param date2
	 * @param time
	 * @param departId
	 * @return
	 */
	public CoreReturnObject getTest(String date1,String date2,String time,String departId)
    {
    	String sql = CoreXmlSqlParsersFactory.getSql("FrmrptStoveBatchStorageZg.getTest");
    	if(departId.equals("002001016"))
    	{
    		sql = sql.replace("#CONDTIONS#", "IN('002001016002','002001016003')");
    	}else if(departId.equals("002001017"))
    	{
    		sql = sql.replace("#CONDTIONS#", "= '002001017003'");
    	}
    	else if(departId.equals("002001018"))
    	{
    		sql = sql.replace("#CONDTIONS#", "= '002001018003'");
    	}else if(departId.equals("002001"))
    	{
    		sql = sql.replace("#CONDTIONS#", "IN('002001016002','002001016003','002001017003','002001018003')");
    	}else
    	{
    		sql = sql.replace("#CONDTIONS#", "= ''");
    	}
    	CoreReturnObject cro = this
				.getData(sql,
						new Object[] { date2, date2, date1, date2, date1,
								date2, date2, date2, date1, date2, date1,
								date2, time, date1, date2,date1, date2,date2});
    	return cro;
    }

	/***
	 * 仓库收发存
	 * @param date1
	 * @param date2
	 * @param time
	 * @param departId
	 * @return
	 */
	public CoreReturnObject getTestStore(String date1,String date2,String time,String[] arr)
    {
    	String sql = CoreXmlSqlParsersFactory.getSql("FrmrptStoveBatchStorageZg.getTestStore");
    	String str = CoreConverter.toSqlConditionString("T.STORAGE_NO", arr);
    	sql = sql.replace("#condtions#", str);
    	CoreReturnObject cro = this
				.getData(sql,
						new Object[] { date2, date2, date1, date2, date1,
								date2, date2, date2, date1, date2, date1,
								date2, time, date1, date2,date1, date2 });
    	return cro;
    }
}
