Spring Boot 投影查询三种优化方案,少查字段减少 SQL 开销

Spring Boot 里面用 Spring Data JPA 投影查询,核心目的就是改掉直接查全实体的坏习惯,很多业务接口只需要两三个字段,却直接查询