26CRUD操作之排序查询

    @Test
    void test1(){
        QueryWrapper<User> wrapper = new QueryWrapper<>();
        wrapper.orderByAsc("age");//升序
//        wrapper.orderByDesc("age");//降序
        wrapper.having("id>8");

        List<User> users = userMapper.selectList(wrapper);
        for (User user : users) {
            System.out.println(user);
        }
    }

26CRUD操作之排序查询

上一篇:Python中map()函数浅析


下一篇:STL