package cn.net.caoyao.cpzshandset.db.presenter;

import java.util.List;

import android.database.Cursor;
import cn.net.caoyao.cpzshandset.bean.TruckInvoiceBean;

public interface TruckInvoiceDal {
	/**
	 * 插入汽车运单信息
	 * 
	 * @param invoice
	 */
	public int insertTruckInvoice(TruckInvoiceBean invoice);
	/**
	 * 插入线上获取的运单信息
	 * @param invoice
	 * @return
	 */
	public long insertOnlineTruckInvoice(TruckInvoiceBean invoice);

	/**
	 * 插入时检测已经数据库中已经存在该订单
	 * 
	 * @param trainInvoice
	 * @return
	 */
	public boolean insertHasExist(TruckInvoiceBean truckInvoice);
	
	/**
	 * 修改当前订单单个标签的上传类型
	 * 
	 * @param invoice
	 * @return
	 */
	public TruckInvoiceBean updateTruckLabelMode(TruckInvoiceBean invoice);

	/**
	 * 修改时检测数据库中已经存在该订单
	 * 
	 * @param trainInvoice
	 * @return
	 */
	public boolean updateHasExist(TruckInvoiceBean truckInvoice);

	/**
	 * 修改汽车运单信息
	 * 
	 * @param invoice
	 */
	public void updateTruckInvoice(TruckInvoiceBean invoice);

	/**
	 * 根据修单号，修改汽车运单信息
	 * 
	 * @param status
	 *            0:有效 1:无效
	 * @param id
	 */
	public void updateTruckInvoiceStatus(int status, int errorCode, int id);
	public void updateTruckSubmitStatusByLId(int status,int errorCode, long id);

	/**
	 * 通过运单ID，查询运单信息
	 * 
	 * @param id
	 * @return
	 */
	public TruckInvoiceBean queryTruckInvoiceById(int id);
	
	/**
	 * 通过运单ID，查询运单信息
	 * 
	 * @param id
	 * @return
	 */
	public TruckInvoiceBean queryOnlineTruckInvoiceById(long id);

	/**
	 * 通过运单状态，查询运单信息
	 * 
	 * @param status
	 *            0:有效 1:无效
	 * @return
	 */
	public List<TruckInvoiceBean> queryAllTruckInvoices();

	public List<TruckInvoiceBean> queryAllTruckInvoicesASC();
	/**
	 * 通过责任人查询所有的汽车发发运单
	 * @return
	 */
	public List<TruckInvoiceBean> queryAllTruckInvoicesByUsr(String userAccount);
	public List<TruckInvoiceBean> queryAllTruckInvoicesASCByUsr(String userAccount);

	/**
	 * 删除所有的汽车发货无效订单
	 */
	public void deleteTruckInvoiceById(TruckInvoiceBean invoice);


	public TruckInvoiceBean getTruckInvoice(Cursor cursor);

}
