package com.its.api.its.repository.ifsc;

import com.its.api.its.model.entity.ifsc.TbIfscTrafHs;
import com.its.api.its.model.entity.ifsc.TbIfscTrafHsKey;
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 TbIfscTrafHsRepository extends JpaRepository<TbIfscTrafHs, TbIfscTrafHsKey>, JpaSpecificationExecutor<TbIfscTrafHs> {

    @Query("select p from TbIfscTrafHs p where p.ifscId = :ifscId and p.prcnDt between :fromDt and :toDt")
    List<TbIfscTrafHs> findAllByDateRange(@Param("ifscId") Long ifscId, @Param("fromDt") String fromDt, @Param("toDt") String toDt);
}
