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);
    }
posted @ 2019-09-06 13:45  Daniel_Lu  阅读(19316)  评论(0编辑  收藏  举报