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

import com.its.op.entity.its.ifsc.TbIfscTrafHs;
import com.its.op.entity.its.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")
    List<TbIfscTrafHs> findAll();

    @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);
}
