Class AptAbstractWrapper<T,Children extends AptAbstractWrapper<T,Children>>

java.lang.Object
com.baomidou.mybatisplus.core.conditions.Wrapper<T>
com.github.yulichang.extension.apt.JoinAbstractWrapper<T,Children>
com.github.yulichang.extension.apt.AptAbstractWrapper<T,Children>
All Implemented Interfaces:
com.baomidou.mybatisplus.core.conditions.interfaces.Nested<Children,Children>, com.baomidou.mybatisplus.core.conditions.ISqlSegment, Compare<Children>, CompareIfExists<Children>, Func<Children>, FuncLambda<Children>, OnCompare<Children>, QueryJoin<Children,T>, MPJBaseJoin<T>, StringJoin<Children,T>, CompareStr<Children,String>, CompareStrIfExists<Children,String>, FuncStr<Children,String>, Join<Children>, Serializable
Direct Known Subclasses:
AptQueryWrapper

public abstract class AptAbstractWrapper<T,Children extends AptAbstractWrapper<T,Children>> extends JoinAbstractWrapper<T,Children> implements QueryJoin<Children,T>
参考 AbstractLambdaWrapper
Author:
yulichang
See Also:
  • Field Details

    • alias

      protected String alias
      主表别名
    • subTableAlias

      protected String subTableAlias
      副表别名
    • resultMap

      protected boolean resultMap
      是否构建是否存在一对多
    • resultMapCollection

      protected boolean resultMapCollection
    • pageInfo

      protected PageInfo pageInfo
    • pageByMain

      protected boolean pageByMain
    • tableIndex

      protected int tableIndex
      表序号
    • isMain

      protected boolean isMain
    • dynamicTableName

      protected boolean dynamicTableName
      主表 表名处理方法
    • tableFunc

      protected com.baomidou.mybatisplus.core.toolkit.support.SFunction<String,String> tableFunc
      主表 表名处理方法
    • logicDelType

      protected LogicDelTypeEnum logicDelType
      逻辑删除位置
    • from

      protected final com.baomidou.mybatisplus.core.conditions.SharedString from
      查询表
    • hasAlias

      protected boolean hasAlias
      是否有表别名
    • keyWord

      protected String keyWord
      连表关键字 on 条件 func 使用
    • subLogicSql

      protected boolean subLogicSql
      副表逻辑删除开关
    • logicSql

      protected boolean logicSql
      主表逻辑删除开关
    • baseColumn

      protected BaseColumn<T> baseColumn
    • aptIndex

      protected TableMap aptIndex
      apt别名对应
  • Constructor Details

    • AptAbstractWrapper

      protected AptAbstractWrapper(BaseColumn<T> baseColumn)
      构造方法
    • AptAbstractWrapper

      protected AptAbstractWrapper(BaseColumn<T> baseColumn, T entity)
      构造方法
      Parameters:
      entity - 主表实体类
  • Method Details

    • pageByMain

      public Children pageByMain()
      根据主表分页
    • pageByMain

      public Children pageByMain(MFunction<PageInfo> function)
      根据主表分页
    • getPageInfo

      public PageInfo getPageInfo()
    • setTableName

      public Children setTableName(com.baomidou.mybatisplus.core.toolkit.support.SFunction<String,String> tableFunc)
      设置表别名 设置表别名注意sql注入问题
      Returns:
      自定义表别名
    • getTableName

      public String getTableName(String tableName)
    • getTableNameEnc

      public String getTableNameEnc(String tableName)
    • columnsToString

      protected String columnsToString(Column... columns)
    • columnToString

      protected String columnToString(Column column)
      Description copied from class: JoinAbstractWrapper
      获取 columnName
      Specified by:
      columnToString in class JoinAbstractWrapper<T,Children extends AptAbstractWrapper<T,Children>>
    • getCache

      protected SelectCache getCache(Column fn)
    • disableSubLogicDel

      public Children disableSubLogicDel()
      关闭副表逻辑删除

      副表逻辑删除默认在where语句中 但有时候需要让它出现在on语句中, 这两种写法区别还是很大的 所以可以关闭副表逻辑删除, 通过on语句多条件, 自己实现on语句的逻辑删除

    • enableSubLogicDel

      public Children enableSubLogicDel()
    • disableLogicDel

      public Children disableLogicDel()
      关闭主表逻辑删除
    • enableLogicDel

      public Children enableLogicDel()
    • getSubLogicSql

      public String getSubLogicSql()
      副表部分逻辑删除支持
    • getLogicSql

      public boolean getLogicSql()
      主表部分逻辑删除支持
    • logicDelToOn

      public Children logicDelToOn()
      调整逻辑删除位置为ON语句
    • logicDelToWhere

      public Children logicDelToWhere()
      调整逻辑删除位置为WHERE语句
    • getFrom

      public String getFrom()
      获取连表部分语句
    • checkJoinTable

      public boolean checkJoinTable(Class<?> clazz)
      检验表是否已连接
    • join

      public <R> Children join(String keyWord, BaseColumn<R> baseColumn, MFunction<AptAbstractWrapper<T,?>> function)
      内部调用, 不建议使用
      Specified by:
      join in interface QueryJoin<T,Children extends AptAbstractWrapper<T,Children>>
    • join

      public Children join(String keyWord, boolean condition, String joinSql, Object... objects)
      自定义关键词连接
      Specified by:
      join in interface StringJoin<T,Children extends AptAbstractWrapper<T,Children>>
      Parameters:
      keyWord - 连表关键词
      condition - 条件
      joinSql - sql
    • isUseAnnotationOrderBy

      public boolean isUseAnnotationOrderBy()
      是否使用默认注解 OrderBy 排序
      Returns:
      true 使用 false 不使用
    • initNeed

      protected void initNeed()
      必要的初始化
    • clear

      public void clear()
      Overrides:
      clear in class JoinAbstractWrapper<T,Children extends AptAbstractWrapper<T,Children>>