package com.softwarebr.nunu.dao.hall;

import com.softwarebr.nunu.entity.hall.InvestApply;
import com.brframework.commondb.core.CommonRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @date 2020-02-25 15:27:45
 * @author lilin
 */

@Repository
public interface InvestApplyDao extends CommonRepository<Long, InvestApply> {

    /**
     * 查询创新项目的申请数量
     * @param investId
     * @return
     */
    Long countByInvestId(Long investId);

    /**
     * 查询指定项目申请人审核通过信息
     * @param proposer 申请人
     * @param investId 项目Id
     * @param verify 审核状态
     * @return
     */
    InvestApply findTopByProposerAndInvestIdAndVerify(Long proposer, Long investId, Integer verify);

    /**
     * 统计指定项目待审核数量
     * @param verify 审核状态
     * @param investId 项目ID
     * @return
     */
    Long countByInvestIdAndVerify(Long investId, Integer verify);

    /**
     * 查询待审核的数据
     * @param verify 审核状态
     * @return
     */
    List<InvestApply> findByVerify(Integer verify);

}