类 Wrapper<T>
java.lang.Object
com.baomidou.mybatisplus.core.conditions.Wrapper<T>
- 所有已实现的接口:
ISqlSegment
,Serializable
- 直接已知子类:
AbstractWrapper
public abstract class Wrapper<T> extends Object implements ISqlSegment
条件构造抽象类
- 从以下版本开始:
- 2018-05-25
- 作者:
- hubin
- 另请参阅:
- 序列化表格
-
构造器概要
构造器 构造器 说明 Wrapper()
-
方法概要
修饰符和类型 方法 说明 abstract void
clear()
条件清空String
getCustomSqlSegment()
获取自定义SQL 简化自定义XML复杂情况abstract T
getEntity()
实体对象(子类实现)abstract MergeSegments
getExpression()
获取 MergeSegmentsString
getSqlComment()
String
getSqlFirst()
String
getSqlSelect()
String
getSqlSet()
String
getTargetSql()
获取格式化后的执行sqlboolean
isEmptyOfEntity()
深层实体判断属性boolean
isEmptyOfNormal()
查询条件为空(不包含entity)boolean
isEmptyOfWhere()
查询条件为空(包含entity)boolean
nonEmptyOfEntity()
深层实体判断属性boolean
nonEmptyOfNormal()
查询条件为空(不包含entity)boolean
nonEmptyOfWhere()
查询条件不为空(包含entity)从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 com.baomidou.mybatisplus.core.conditions.ISqlSegment
getSqlSegment
-
构造器详细资料
-
Wrapper
public Wrapper()
-
-
方法详细资料
-
getEntity
实体对象(子类实现)- 返回:
- 泛型 T
-
getSqlSelect
-
getSqlSet
-
getSqlComment
-
getSqlFirst
-
getExpression
获取 MergeSegments -
getCustomSqlSegment
获取自定义SQL 简化自定义XML复杂情况使用方法: `select xxx from table` + ${ew.customSqlSegment}
注意事项: 1. 逻辑删除需要自己拼接条件 (之前自定义也同样) 2. 不支持wrapper中附带实体的情况 (wrapper自带实体会更麻烦) 3. 用法 ${ew.customSqlSegment} (不需要where标签包裹,切记!) 4. ew是wrapper定义别名,不能使用其他的替换
-
isEmptyOfWhere
public boolean isEmptyOfWhere()查询条件为空(包含entity) -
nonEmptyOfWhere
public boolean nonEmptyOfWhere()查询条件不为空(包含entity) -
isEmptyOfNormal
public boolean isEmptyOfNormal()查询条件为空(不包含entity) -
nonEmptyOfNormal
public boolean nonEmptyOfNormal()查询条件为空(不包含entity) -
nonEmptyOfEntity
public boolean nonEmptyOfEntity()深层实体判断属性- 返回:
- true 不为空
-
isEmptyOfEntity
public boolean isEmptyOfEntity()深层实体判断属性- 返回:
- true 为空
-
getTargetSql
获取格式化后的执行sql- 返回:
- sql
- 从以下版本开始:
- 3.3.1
-
clear
public abstract void clear()条件清空- 从以下版本开始:
- 3.3.1
-