Categories: MyBatis-Plus 教程

MyBatis-Plus 条件构造器-QueryWrapper

说明:

继承自 ​AbstractWrapper ​,自身的内部属性 ​entity​也用于生成 ​where ​条件

及 ​LambdaQueryWrapper​, 可以通过 ​new QueryWrapper().lambda()​ 方法获取

select

select(String... sqlSelect)
select(Predicate<TableFieldInfo> predicate)
select(Class<T> entityClass, Predicate<TableFieldInfo> predicate)
  • 设置查询字段

说明:

以上方法分为两类.

第二类方法为:过滤查询字段(主键除外),入参不包含 ​class ​的调用前需要​wrapper​内的​entity​属性有值! 这两类方法重复调用以最后一次为准

  • 例: ​select("id", "name", "age")
  • 例: ​select(i -> i.getProperty().startsWith("test"))

terry

这个人很懒,什么都没有留下~

Share
Published by
terry

Recent Posts

自定义指令:聊聊vue中的自定义指令应用法则

今天我们来聊聊vue中的自定义…

6 天 ago

聊聊Vue中@click.stop和@click.prevent

一起来学下聊聊Vue中@cli…

2 周 ago

Nginx 基本操作:启动、停止、重启命令。

我们来学习Nginx基础操作:…

2 周 ago

Vue3:手动清理keep-alive组件缓存的方法

Vue3中手动清理keep-a…

3 周 ago

聊聊React和Vue组件更新的实现及区别

React 和 Vue 都是当…

4 周 ago