package com.softwarebr.nunu.dao.hall;

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

import java.time.LocalDateTime;

/**
 * @date 2020-02-25 15:59:36
 * @author lilin
 */

@Repository
public interface InvestOrgDao extends CommonRepository<Long, InvestOrg> {


    /**
     * 查询用户审核通过投资机构信息
     * @param memberId 用户Id
     * @param verify 审核状态 {@link InvestOrg}
     * @return
     */
    InvestOrg findTopByMemberIdAndVerifyOrderByCreateDateDesc(Long memberId, Integer verify);

    /**
     * 查询用户投资机构认证信息
     * @param memberId 用户id
     * @return
     */
    InvestOrg findTopByMemberIdOrderByCreateDateDesc(Long memberId);

    /**
     * 根据审核状态与时间区间统计认证机构数量
     * @param verify 审核状态
     * @param startDate 开始时间
     * @param endDate 结束时间
     * @return
     */
    Long countByVerifyAndCreateDateBetween(Integer verify, LocalDateTime startDate, LocalDateTime endDate);

}