package com.izouma.nineth.repo;

import com.izouma.nineth.domain.MetaPlayerOfflineInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

public interface MetaPlayerOfflineInfoRepo extends JpaRepository<MetaPlayerOfflineInfo, Long>, JpaSpecificationExecutor<MetaPlayerOfflineInfo> {

    @Query(value = "select * from meta_player_offline_info a where a.user_id = ?1 order by a.created_at desc limit 1",nativeQuery = true)
    MetaPlayerOfflineInfo findLastByUserId(Long userId);
}
