1234567891011121314151617181920212223242526272829303132 |
- 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<HeatMap, Long>, JpaSpecificationExecutor<HeatMap> {
- /**
- * 条件分页查询
- * @param pageable
- * @return
- */
- @Query(value = "select r from HeatMap r where r.iDate >= ?1 and r.iDate <= ?2")
- Page<HeatMap> findByDate(Date startDate, Date endDate, Pageable pageable);
- }
|