Mybatis-Plus 实战完整学习笔记(十)------条件构造器核心用法大全(下)

31、升序orderByAsc

1  31、升序orderByAsc
2 
3         List<Employee> employeeList = employeeMapper.selectList(new QueryWrapper<Employee>().orderByAsc(true,"age"));
4 
5 
6 
7         if (!employeeList.isEmpty()) {
8             logger.info("++条件构造器查询员工信息+++++" + gson.toJson(employeeList));
9         }
View Code

32、降序orderByDesc

1  32、降序orderByDesc
2         List<Employee> employeeList = employeeMapper.selectList(new QueryWrapper<Employee>().orderByDesc(true,"age"));
3 
4         
5         if (!employeeList.isEmpty()) {
6             logger.info("++条件构造器查询员工信息+++++" + gson.toJson(employeeList));
7         }
View Code

33、回显字段设置

 1 33、回显字段设置 
 2 //            SELECT last_Name,email FROM tbl_employee
 3         List<Employee> employeeList = employeeMapper.selectList(new QueryWrapper<Employee>().select("last_Name,email"));
 4 
 5 
 6 
 7 
 8 
 9         if (!employeeList.isEmpty()) {
10             logger.info("++条件构造器查询员工信息+++++" + gson.toJson(employeeList));
11         }
View Code

 

posted @ 2018-10-03 17:42  北极的大企鹅  阅读(3245)  评论(0编辑  收藏  举报
阅读 - 79万