package com.fd.repository; import cn.hutool.core.date.DateUnit; import com.fd.entity.HeatMap; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Query; import java.util.Date; /** * Created by Owen on 2019/10/28 0028 11:36 * * JpaSpecificationExecutor 条件分页查询 */ public interface HeatMapRepository extends JpaRepository, JpaSpecificationExecutor { /** * 条件分页查询 * @param pageable * @return */ @Query(value = "select r from HeatMap r where r.iDate >= ?1 and r.iDate <= ?2") Page findByDate(Date startDate, Date endDate, Pageable pageable); }