spring data jpa 查詢

原生sql語句查詢

1) 模糊查詢sql

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);   }
相關文章
相關標籤/搜索