类 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

      public Wrapper()
  • 方法详细资料

    • getEntity

      public abstract T getEntity()
      实体对象(子类实现)
      返回:
      泛型 T
    • getSqlSelect

      public String getSqlSelect()
    • getSqlSet

      public String getSqlSet()
    • getSqlComment

      public String getSqlComment()
    • getSqlFirst

      public String getSqlFirst()
    • getExpression

      public abstract MergeSegments getExpression()
      获取 MergeSegments
    • getCustomSqlSegment

      public String 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

      public String getTargetSql()
      获取格式化后的执行sql
      返回:
      sql
      从以下版本开始:
      3.3.1
    • clear

      public abstract void clear()
      条件清空
      从以下版本开始:
      3.3.1