- 博客(2)
- 收藏
- 关注
原创 jpa +QueryDsl 灵活查询多表字段
问题: sql中复杂的关系导致不可维护,每一个接手的人都要研究sql半天 JPA这种框架目的就是少些原生sql语句, 解决方式: 创建对应的表和实现的映射 @Data @Entity @Table(name = "user_info") public class UserInfo implements Serializable{ @Id @Column(name = "id",columnDefinition = "varchar(64) not null") ...
2022-03-26 16:49:34
2715
原创 jap @Query多条件灵活查询
1. MySQL使用if进行条件判空 @Query(nativeQuery=true,value="select * from company where if(:code is not null and :code != '' , code =:code,1=1)") List<Company> getCompanyList(@Param("code") String code); 2. 使用case when 进行条件判空 @Query(value = "select * fro
2022-03-26 15:14:12
1789
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人