package com.its.api.its.repository.road;

import com.its.api.its.model.entity.road.TbRoadVrtxArr;
import com.its.api.its.model.entity.road.TbRoadVrtxArrKey;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface TbRoadVrtxArrRepository extends JpaRepository<TbRoadVrtxArr, TbRoadVrtxArrKey>, JpaSpecificationExecutor<TbRoadVrtxArr> {

    @Query("select p from TbRoadVrtxArr p, TbRoad road where p.levl = :levl and road.delYn = 'N' and p.roadId = road.roadId")
    List<TbRoadVrtxArr> findAllByLevl(@Param("levl") Integer levl);

}
