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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM