Mybatis-Plus select不列出全部字段
https://www.jianshu.com/p/e97b8236db67
只显示某两个字段
@Test public void selectByWrapper10() { QueryWrapper<User> queryWrapper = new QueryWrapper<>(); queryWrapper.select("name", "age").like("name", "雨"); List<User> users = userMapper.selectList(queryWrapper); users.forEach(System.out::println); }
显示除了某两个字段,其他所有字段.
@Test
public void selectByWrapper11() {
QueryWrapper<User> queryWrapper = new QueryWrapper<>();
queryWrapper.select(User.class, info -> !info.getColumn().equals("manager_id")
&& !info.getColumn().equals("create_time"));
List<User> users = userMapper.selectList(queryWrapper);
users.forEach(System.out::println);
}