package core.stlmes.server.sale.dao;

import java.sql.SQLException;
import java.util.List;

import core.stlmes.server.sale.po.SlmOrderDeliveryTransitTgBean;
import core.stlmes.server.sale.po.SlmOrderLineTgBean;

import CoreFS.SA06.CoreReturnObject;

public class SlmOrderDeliveryTransitTgDao extends BaseService
{
	private List<SlmOrderDeliveryTransitTgBean> query(String sqlCondition)
			throws SQLException
	{
		List<SlmOrderDeliveryTransitTgBean> list = null;
		String sqlStr = " select * from slm_order_delivery_transit where 1 = 1"
				+ " and VALIDFLAG = '1' ";
		sqlStr = sqlStr + sqlCondition;
		list = SlmOrderDeliveryTransitTgBean.convertResultSetToBeanList(super
				.executeForResult(sqlStr));
		return list;
	}

	public List<SlmOrderDeliveryTransitTgBean> getSlmOrderDeliveryTransitTgByOrdPkAndOrdlnPk(
			String ordPk, String ordLnPk) throws SQLException
	{
		List<SlmOrderDeliveryTransitTgBean> list = null;
		String sqlCondition = super.GetSqlConditionByStringValue("ORD_PK",
				ordPk);
		sqlCondition += super
				.GetSqlConditionByStringValue("ORD_LN_PK", ordLnPk);
		list = query(sqlCondition);
		return list;

	}

	public List<SlmOrderDeliveryTransitTgBean> getSlmOrderDeliveryTransitTgByOrdPk(
			String ordPk) throws SQLException
	{
		List<SlmOrderDeliveryTransitTgBean> list = null;
		String sqlCondition = super.GetSqlConditionByStringValue("ORD_PK",
				ordPk);

		list = query(sqlCondition);
		return list;

	}

	public List<SlmOrderDeliveryTransitTgBean> getSlmOrderDeliveryTransitTgByOrdPkAndOrdlnPkAndDlyPk(
			String ordPk, String ordLnPk, String ordDlyPk) throws SQLException
	{
		List<SlmOrderDeliveryTransitTgBean> list = null;
		String sqlCondition = super.GetSqlConditionByStringValue("ORD_PK",
				ordPk);
		sqlCondition += super
				.GetSqlConditionByStringValue("ORD_LN_PK", ordLnPk);
		sqlCondition += super.GetSqlConditionByStringValue("ORD_LN_DLY_PK",
				ordDlyPk);
		list = query(sqlCondition);
		return list;

	}

}
