spring data jpa 查询

原生sql语句查询

1) 模糊查询

public interface DeviceRepository extends JpaRepository<Device, Long>, JpaSpecificationExecutor<Device> {
@Query(value = "select * from biz_device where create_time like CONCAT('%',:time,'%') order by ?#{#pageable}", nativeQuery = true) Page<Device> findByCreateTimeLike(@Param("time")String time, Pageable pageable);
   }

 

posted @ 2018-09-12 16:43  Aaron2705  阅读(132)  评论(0编辑  收藏  举报