package com.uas.finance.dao;

import com.uas.finance.model.AccountApply;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 出账申请Dao层
 * created by shicr on 2018/1/27
 **/
@Repository
public interface AccountApplyDao extends JpaRepository<AccountApply, Long> {

    /**
     * 找到某买方下面的所有出账申请
     *
     * @param id
     * @return
     */

    List<AccountApply> findByCqIdOrderByIndateDesc(Long id);

    /**
     * 找到某保理方下某状态的所有应收账款转让
     *
     * @param fauu
     * @return
     */
    List<AccountApply> findByFauuAndErpstatus(Long fauu, Integer erpstatus);

    /**
     * 找到某买方下已提交的出账申请
     *
     * @param id
     * @return
     */
    List<AccountApply> findByCqIdAndErpstatusIsNotNull(Long id);
}
