标签:bat int man creat getc array manage app pre
//不列出全部字段 @Test public void test10() { QueryWrapper<User> wrapper = new QueryWrapper<>(); wrapper.select("id", "name").in("age", Arrays.asList(18, 31, 30, 34, 35)).last("limit 1"); List<User> users = userMapper.selectList(wrapper); for (User user : users) { System.out.println(user.toString()); } } //不列出全部字段 @Test public void test11() { QueryWrapper<User> wrapper = new QueryWrapper<>(); wrapper.select(User.class, info -> !info.getColumn().equals("create_time") && !info.getColumn().equals("manager_id")).in("age", Arrays.asList(18, 31, 30, 34, 35)).last("limit 1"); List<User> users = userMapper.selectList(wrapper); for (User user : users) { System.out.println(user.toString()); } }
使用select(), 第一种可以选出要查看的列的名字,第二种使用函数式进行排除不需要出现的列的名字
标签:bat int man creat getc array manage app pre
原文地址:https://www.cnblogs.com/qingmuchuanqi48/p/11909147.html