package com.ywt.outpatient.domain.entity.center;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

/**
 * Created by daiyihua.
 */
public interface LoginLogRepository extends JpaRepository<LoginLog, Integer> {

    /**
     * 判断是否是首次登录
     * @param userId
     * @param type
     * @return
     */
    @Query(value = "select count(1) from login_log where user_id = ? and type= ? ",nativeQuery = true)
    public int  checkIsFirstLogin(int userId, int type);
}
