/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.workinvoicedetail.dao;

import com.jeeplus.common.persistence.CrudDao;
import com.jeeplus.common.persistence.annotation.MyBatisDao;
import com.jeeplus.modules.workinvoicedetail.entity.WorkInvoiceDetail;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 发票明细DAO接口
 * @author lw
 * @version 2018-05-09
 */
@MyBatisDao
public interface WorkInvoiceDetailDao extends CrudDao<WorkInvoiceDetail> {
    //展示带退票标记的列表
    public List<WorkInvoiceDetail> findLists(WorkInvoiceDetail workInvoiceDetail);
    //发票变更展示明细列表
    public List<WorkInvoiceDetail> afindList(WorkInvoiceDetail workInvoiceDetail);
    List<WorkInvoiceDetail> findListWithDept(WorkInvoiceDetail invoice);

    List<WorkInvoiceDetail> findListReturn(WorkInvoiceDetail invoice);

    List<WorkInvoiceDetail> findByCode(WorkInvoiceDetail invoice);
    void updateByCode(WorkInvoiceDetail invoice);
    /**
     * 更新流程实例ID
     * @return
     */
    public int updateProcessInstanceId(WorkInvoiceDetail workInvoiceDetail);

    /**
     * 根据流程实例ID获取
     * @param processInstanceId
     * @return
     */
    public WorkInvoiceDetail getByProcessInstanceId(String processInstanceId);

    List<WorkInvoiceDetail> findPageByCompany(WorkInvoiceDetail invoice);
    List<WorkInvoiceDetail> findListByContractInfo(WorkInvoiceDetail invoice);

    void updateSettleFlag(WorkInvoiceDetail invoice);

    int countByNumber(String number);

    int countByNumAndComp(@Param("invoiceNum") String invoiceNum, @Param("comId") String comId);
}