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

import java.util.List;

import android.database.Cursor;
import cn.net.caoyao.cpzshandset.bean.InvoiceBean;
import cn.net.cpzslibs.prot.handset.bean.res.Prot20017LabelBean;

public interface InvoiceDal {

	/**
	 * 插入订单信息
	 * 
	 * @param invoice
	 */
	public void insertInvoice(InvoiceBean invoice);
	
//	select status*-1 as status from test

	/**
	 * 根据发运方式、发运单id、类型 获取运单列表
	 * 
	 * @param transmode
	 *            1:火车 2:汽车
	 * @param transid
	 * @param elemtype
	 *            1:托盘包含的标签 2:单个产品的标签
	 * @return
	 */
	public List<InvoiceBean> queryInvoices(int transmode, int transid, int elemtype);
	/**
	 * 通过订单号和发货方式查询订单信息
	 * @param transmode
	 * @param transid
	 * @return
	 */
	public List<InvoiceBean> queryInvoiceByTransmode(int transmode, int transid);
	
	/**
	 * 通过订单号和发货方式查询订单信息
	 * @param transmode
	 * @param transid
	 * @return
	 */
	public List<InvoiceBean> queryInvoiceByTransmodeAndLId(int transmode, long transid);
	
	
	//UPDATE test SET status=(-1)*status
	

	/**
	 * 根据发运模式，统计表签数量
	 * @param transmode
	 * @param transid
	 * @param elemtype
	 * @return
	 */
	public int queryLabelCountByMode(int transmode, int transid, int elemtype);
	
	/**
	 * 根据发运模式，统计表签数量
	 * @param transmode
	 * @param transid
	 * @param elemtype
	 * @return
	 */
	public int queryLabelCountByModeLId(int transmode, long transid, int elemtype);
	
	/**
	 * 根据发运方式、发运单id、类型、标签id 删除运单信息
	 * 
	 * @param transmode
	 *            1:火车 2:汽车
	 * @param transid
	 * @param elemtype
	 *            1:托盘包含的标签 2:单个产品的标签
	 * @return
	 */
	public void deleteInvoiceSingle(int transmode, int transid, int elemtype, String labelid);

	/**
	 * 根据运单id，删除运单信息
	 * 
	 * @param id
	 */
	public void deleteInvoiceById(int id);

	/**
	 * 删除所有运单信息
	 * 
	 * @param id
	 */
	public void deleteInvoice();

	/**
	 * 检测运单表中是否已经存在该标签
	 * 
	 * @param labelId
	 * @return
	 */
	public boolean hasExistLabel(String labelId);
	
	/**
	 * 检测运单表中是否已经存在该package_id
	 * 
	 * @param labelId
	 * @return
	 */
	public boolean hasExistPackageId(String package_id);
	
	public void updateLabelStatusByLabelId(String labelId, int labelStatus);
	
	public void updateLabelStatusByLabelIdList(List<Prot20017LabelBean> labelId, int labelStatus);
	
	public List<InvoiceBean> queryInvoiceListByShipmentProductId(long driver_id,long product_id);
	
	public void deleteInvoiceByShipmentIdAndLabel(long driver_id,long product_id,String labelId);
	
	public int queryLabelCountByShipmentProductId(long driver_id,long product_id,int elemtype);
	
	public void deleteInvoiceByShipmentProductId(long driver_id,long product_id);

	InvoiceBean getInvoice(Cursor cursor);

}
