我尝试用Projections实现一个查询方法,但我不确定我做的对不对。我是 Spring Boot 世界的新手,不知道如何使用 Projection 创建统计查询。如果你能帮我解决我的问题,我将不胜感激。
实现一个允许以下查询的 TestRepository:- 统计查询 which
公共课预测{ 公共静态记录 TestKitTypeResultCountRecord(TestKitType testKitType, TestResult testResult, Long count) {} }
@存储库
公共接口 TestsRepository 扩展 JpaRepository
List<Projections.TestKitTypeResultCountRecord> findTestKitTypeResultCountByTestTimeStampBetween(LocalDateTime startDate, LocalDateTime endDate);
}