Jpa中根据id查询一段时间内的对象

版权声明:版权声明:本文为博主原创文章,转载请注明出处。 https://blog.csdn.net/lililuni/article/details/83069940
	@Query(value="select h from HourdbEntity h where  h.senid=?1 and h.time between ?2 and ?3")
	List<HourdbEntity> findBySenidAndTimeBetween(double id,Date startTime,Date endTime);

注意:

HourdbEntity 为对象数据库表的实体类名称

select 后面不能跟 *

senid time 分别为实体类的属性

?1 ?2 ?3要与方法中的参数对应

猜你喜欢

转载自blog.csdn.net/lililuni/article/details/83069940