package com.steering.pss.ydm.pipemanage;

import java.util.ArrayList;

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

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

public class FrmProcessOrder extends DBCommon{

	public CoreReturnObject getProcessOrder(ArrayList<String> list,String[] arr, String timeName)
	{
		String sql = CoreXmlSqlParsersFactory.getSql("FrmProcessOrder.getProcessOrder");
		sql += CoreConverter.toSqlConditionString("T1.SALE_AREA_NO", arr);
		if(timeName!= null && timeName.equals("交货时间"))
		{
			sql += " AND T3.DELVRY_EDATE >= to_date(?, 'YYYY-MM-DD HH24:MI:SS')\r\n" + 
					"   AND T3.DELVRY_EDATE <= to_date(?, 'YYYY-MM-DD HH24:MI:SS')";
		}
		else 
		{
			sql += " AND T.EFFECT_TIME >= to_date(?, 'YYYY-MM-DD HH24:MI:SS')\r\n" + 
					"   AND T.EFFECT_TIME <= to_date(?, 'YYYY-MM-DD HH24:MI:SS')";
		}
		return this.getData(sql, list.toArray());
	}
}
