单个字段查询 testService.list(Wrappers.lambdaQuery().select(Test::getId)); 多个字段查询 testService.list(Wrapper
testService.list(Wrappers.<Test>lambdaQuery().select(Test::getId));
testService.list(Wrappers.<Test>lambdaQuery().select(Test::getId, Test::getAge));
// 对应实体类字段testService.list(Wrappers.<Test>lambdaQuery().select(Test.class, i -> !"rName".equals(i.getProperty())));// 对应数据库字段testService.list(Wrappers.<Test>lambdaQuery().select(Test.class, i -> !"r_name".equals(i.getColumn())));
// 对应实体类字段testService.list(Wrappers.<Test>lambdaQuery().select(Test.class, i -> !"rName".equals(i.getProperty()) && !"age".equals(i.getProperty())));// 对应数据库字段testService.list(Wrappers.<Test>lambdaQuery().select(Test.class, i -> !"r_name".equals(i.getColumn()) && !"age".equals(i.getColumn())));
@TableField(select = false)private String rName;
--结束END--
本文标题: MyBatis-Plus 指定字段的查询和排除
本文链接: https://lsjlt.com/news/389593.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-23
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0