package com.softwarebr.nunu.dao.user;

import com.softwarebr.nunu.entity.user.Member;
import com.brframework.commondb.core.CommonRepository;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;

/**
 * 用户
 * @Author lilin
 * @Date 2020-02-17 14:07:07
 */

@Repository
public interface MemberDao extends CommonRepository<Long, Member> {


    /**
     * 根据手机号码查询用户信息
     *
     * @param phone
     * @return
     */
    Member findByPhone(String phone);

    /**
     * 微信openId查找用户信息
     * @param wxOpenId
     * @return
     */
    Member findByWxOpenId(String wxOpenId);

    /**
     * 根据身份及时间区间查询总数
     * @param identityType 身份类型{@link Member}
     * @param startDate 开始时间
     * @param entDate 结束时间
     * @return
     */
    Long countByIdentityTypeAndCreateDateBetween(Integer identityType, LocalDateTime startDate, LocalDateTime entDate);


}