package premium_store.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import premium_store.model.Tank;

import java.util.List;

public interface TankRepository extends JpaRepository<Tank, Long> {
    @Query("SELECT t FROM Tank t WHERE t.nation.nation = :nation AND t.tankLevel.level BETWEEN :llevelid AND :l2levelid")
    List<Tank> checkNationAndLevel(
            @Param("nation") String nation,
            @Param("llevelid") int levelOne,
            @Param("l2levelid") int levelTwo);
}

