package com.steering.pss.sale.order.DAL;

import java.sql.Connection;
import java.util.ArrayList;
import com.steering.comm.db.DBCommon;
import com.steering.comm.tools.EntityTool;
import com.steering.pss.sale.order.model.SlmOrderLineEntity;
import CoreFS.SA06.CoreReturnObject;
import CoreFS.SA08.CoreXmlSqlParsersFactory;

/**
 * 合同行数据类
 * @author Administrator
 *
 */
public class CraftOrderLineDAL extends DBCommon{
	
	public ArrayList<SlmOrderLineEntity> query(SlmOrderLineEntity orderLineEntity, Connection con){
		String sql = CoreXmlSqlParsersFactory.getSql("CraftOrderLineDAL.Query");
		sql = EntityTool.fillSqlByEntity(sql, orderLineEntity);
		return EntityTool.getEntitysBySqlNoClsCon(sql, con, SlmOrderLineEntity.class);
	}
	
	/**
	 * 查询合同行
	 * @param orderLineEntity
	 * @return
	 */
	public CoreReturnObject query(String strOrderLineJSON){
		SlmOrderLineEntity orderLineEntity = EntityTool.getEntityByJSONStr(strOrderLineJSON, SlmOrderLineEntity.class);
		String sql = CoreXmlSqlParsersFactory.getSql("CraftOrderLineDAL.Query");
		sql = EntityTool.fillSqlByEntity(sql, orderLineEntity);
		return this.getData(sql);
	}
}
