show me the code :
mybais-plus版本:3.1.1

1,排除某些字段,可以同时排除多个字段
排除多个字段写法:

.setEntity(new User())
.select(c -> !Objects.equals(c.getProperty(), "secretKey")
&& !Objects.equals(c.getProperty(), "password"))

如果写多个select 则只有最后一个select生效

mybatis-plus查询指定字段

2,指定字段查询:
指定多个字段写法:
.setEntity(new User())
.select(c -> Objects.equals(c.getProperty(), "nickname")
|| Objects.equals(c.getProperty(), "status"))
如果写多个select 则只有最后一个select生效

 mybatis-plus查询指定字段

3,distinct 
mybatis-plus查询指定字段

 

相关文章:

  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-31
  • 2022-12-23
  • 2022-12-23
  • 2023-03-10
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-11
  • 2021-08-22
  • 2021-10-26
相关资源
相似解决方案