package com.its.op.dao.repository.its.vds;

import com.its.op.entity.its.vds.TbVdsDtctStat15m;
import com.its.op.entity.its.vds.TbVdsDtctStat15mKey;
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 TbVdsDtctStat15mRepository extends JpaRepository<TbVdsDtctStat15m, TbVdsDtctStat15mKey>, JpaSpecificationExecutor<TbVdsDtctStat15m> {

    @Query("select p from TbVdsDtctStat15m p inner join fetch p.dtct where p.statDt between :fromDt and :toDt and p.vdsDtctNmbr in :ids")
    List<TbVdsDtctStat15m> findAllByDateRange(@Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("ids") List<Long> ids);

}
