求助JPA使用mysql距离函数问题
spring data jpa 使用MySQL距离函数
PageRequest pageable = PageRequest.of(
0,
20
Sort.Direction.ASC,
"st_distance (point (longitude, latitude),point('120.38','37.94'))"
)
List list = mUserRepo.findAll(query, pageable).content
如代码所示,query是查询条件,插入st_distance就不能用了,写sql的话是可以用的。