Class Wrapper<T>
java.lang.Object
com.baomidou.mybatisplus.core.conditions.Wrapper<T>
- All Implemented Interfaces:
ISqlSegment,Serializable
- Direct Known Subclasses:
AbstractWrapper
条件构造抽象类
- Since:
- 2018-05-25
- Author:
- hubin
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidclear()条件清空获取自定义SQL 简化自定义XML复杂情况abstract T实体对象(子类实现)abstract MergeSegments获取 MergeSegments获取格式化后的执行sqlboolean深层实体判断属性boolean查询条件为空(不包含entity)boolean查询条件为空(包含entity)boolean深层实体判断属性boolean查询条件为空(不包含entity)boolean查询条件不为空(包含entity)booleanDeprecated.booleanDeprecated.booleanDeprecated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.baomidou.mybatisplus.core.conditions.ISqlSegment
getSqlSegment
-
Constructor Details
-
Wrapper
public Wrapper()
-
-
Method Details
-
getEntity
实体对象(子类实现)- Returns:
- 泛型 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定义的默认别名,可通过
Param注解修改,也可以通过AbstractWrapper.setParamAlias(String)方式设置别名 -
isEmptyOfWhere
public boolean isEmptyOfWhere()查询条件为空(包含entity) -
isNonEmptyOfWhere
public boolean isNonEmptyOfWhere()查询条件不为空(包含entity) -
nonEmptyOfWhere
Deprecated. -
isEmptyOfNormal
public boolean isEmptyOfNormal()查询条件为空(不包含entity) -
isNonEmptyOfNormal
public boolean isNonEmptyOfNormal()查询条件为空(不包含entity) -
nonEmptyOfNormal
Deprecated. -
isNonEmptyOfEntity
public boolean isNonEmptyOfEntity()深层实体判断属性- Returns:
- true 不为空
-
nonEmptyOfEntity
Deprecated. -
isEmptyOfEntity
public boolean isEmptyOfEntity()深层实体判断属性- Returns:
- true 为空
-
getTargetSql
获取格式化后的执行sql- Returns:
- sql
- Since:
- 3.3.1
-
clear
public abstract void clear()条件清空- Since:
- 3.3.1
-