Pageable pageable = PageRequest.of(1, 10);
@Query(value = "SELECT a.* FROM a LEFT JOIN b ON a.id=b.id", countQuery = "SELECT COUNT(1) FROM a LEFT JOIN b ON a.id=b.id", nativeQuery = true) Page<Map<String, String>> getFundInfoList(Pageable pageable);
关联查询就会出现问题,在查询总页码语句有问题,因为我是关联查询,生成语句就是from后面的表select(table),设置一个countQuery,里面写查询总数的语句即可。