Class KtAbstractLambdaWrapper<T,Children extends KtAbstractLambdaWrapper<T,Children>>
java.lang.Object
com.baomidou.mybatisplus.core.conditions.Wrapper<T>
com.github.yulichang.extension.kt.KtAbstractWrapper<T,Children>
com.github.yulichang.extension.kt.KtAbstractLambdaWrapper<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>,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:
KtDeleteJoinWrapper,KtLambdaWrapper,KtUpdateJoinWrapper
public abstract class KtAbstractLambdaWrapper<T,Children extends KtAbstractLambdaWrapper<T,Children>>
extends KtAbstractWrapper<T,Children>
implements QueryJoin<Children,T>
参考
AbstractLambdaWrapper- Author:
- yulichang
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String主表别名protected boolean主表 表名处理方法protected final com.baomidou.mybatisplus.core.conditions.SharedString查询表protected boolean是否有表别名protected String连表关键字 on 条件 func 使用protected LogicDelTypeEnum逻辑删除位置protected boolean主表逻辑删除开关protected booleanprotected PageInfoprotected boolean是否构建是否存在一对多protected booleanprotected boolean副表逻辑删除开关protected String副表别名主表 表名处理方法protected int表序号Fields inherited from class com.github.yulichang.extension.kt.KtAbstractWrapper
checkSqlInjection, expression, ifExists, index, isMain, isNo, joinClass, lastSql, onWrappers, paramAlias, paramNameSeq, paramNameValuePairs, sqlComment, sqlFirst, tableList, tableName, typedThis -
Constructor Summary
ConstructorsConstructorDescription推荐使用 带 class 的构造方法KtAbstractLambdaWrapper(Class<T> clazz) 推荐使用此构造方法KtAbstractLambdaWrapper(Class<T> clazz, String alias) 构造方法KtAbstractLambdaWrapper(String alias) 自定义主表别名KtAbstractLambdaWrapper(T entity) 构造方法KtAbstractLambdaWrapper(T entity, String alias) 构造方法 -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()protected final StringcolumnsToString(Integer index, PrefixEnum prefixEnum, String alias, kotlin.reflect.KProperty<?>... columns) 多字段转换为逗号 "," 分割字符串protected StringcolumnToString(Integer index, String alias, kotlin.reflect.KProperty<?> column, boolean isJoin, PrefixEnum prefixEnum) 关闭主表逻辑删除关闭副表逻辑删除protected SelectCachegetCache(kotlin.reflect.KProperty<?> fn) protected StringgetDefault(Integer index, Class<?> clazz, boolean isJoin, PrefixEnum prefixEnum) 返回前缀getFrom()获取连表部分语句boolean主表部分逻辑删除支持副表部分逻辑删除支持getTableName(String tableName) getTableNameEnc(String tableName) protected voidinitNeed()必要的初始化boolean是否使用默认注解OrderBy排序自定义关键词连接join(String keyWord, Class<?> clazz, String tableAlias, BiConsumer<KtAbstractLambdaWrapper<?, ?>, Children> consumer) 内部调用, 不建议使用调整逻辑删除位置为ON语句调整逻辑删除位置为WHERE语句根据主表分页pageByMain(MFunction<PageInfo> function) 根据主表分页setTableName(Function<String, String> tableFunc) 设置表别名 设置表别名注意sql注入问题Methods inherited from class com.github.yulichang.extension.kt.KtAbstractWrapper
addCondition, addCondition, addCondition, addNestedCondition, allEq, allEqStr, allEqStr, and, and, appendSqlSegments, apply, applyFunc, applyFunc, around, between, between, checkSqlInjection, clone, columnSqlInjectFilter, columnsToString, columnsToString, columnsToString, columnToSqlSegment, columnToSqlSegment, columnToSqlSegmentS, columnToString, comment, eq, eq, eq, eqSql, exists, first, formatParam, formatSqlMaybeWithParam, func, ge, ge, ge, geSql, geSql, getEntity, getEntityClass, getExpression, getParamAlias, getSqlComment, getSqlFirst, getSqlSegment, groupBy, groupBy, groupBy, groupBy, groupByStr, gt, gt, gt, gtSql, gtSql, having, in, in, in, in, inExpression, inExpression, inSql, inSql, instance, instance, instanceEmpty, isNotNull, isNotNull, isNull, isNull, last, le, le, le, leSql, leSql, like, like, likeLeft, likeLeft, likeRight, likeRight, likeValue, likeValue, lt, lt, lt, ltSql, ltSql, maybeDo, ne, ne, ne, nested, not, not, notBetween, notBetween, notExists, notIn, notIn, notIn, notIn, notInSql, notInSql, notLike, notLike, notLikeLeft, notLikeLeft, notLikeRight, notLikeRight, or, or, orderBy, orderBy, orderBy, orderByAsc, orderByDesc, orderByStr, setEntity, setEntityClass, setIfExists, setIfExists, setParamAlias, toChildren, toChildrenMethods inherited from class com.baomidou.mybatisplus.core.conditions.Wrapper
getCustomSqlSegment, getSqlSelect, getSqlSet, getTargetSql, isEmptyOfEntity, isEmptyOfNormal, isEmptyOfWhere, isNonEmptyOfEntity, isNonEmptyOfNormal, isNonEmptyOfWhere, nonEmptyOfEntity, nonEmptyOfNormal, nonEmptyOfWhereMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.github.yulichang.extension.kt.interfaces.Compare
allEq, allEq, between, between, between, eq, eq, eq, ge, ge, ge, gt, gt, gt, le, le, le, like, like, like, likeLeft, likeLeft, likeLeft, likeRight, likeRight, likeRight, lt, lt, lt, ne, ne, ne, notBetween, notBetween, notBetween, notLike, notLike, notLike, notLikeLeft, notLikeLeft, notLikeLeft, notLikeRight, notLikeRight, notLikeRightMethods inherited from interface com.github.yulichang.extension.kt.interfaces.CompareIfExists
eqIfExists, eqIfExists, geIfExists, geIfExists, getIfExists, gtIfExists, gtIfExists, leIfExists, leIfExists, likeIfExists, likeIfExists, likeLeftIfExists, likeLeftIfExists, likeRightIfExists, likeRightIfExists, ltIfExists, ltIfExists, neIfExists, neIfExists, notLikeIfExists, notLikeIfExists, notLikeLeftIfExists, notLikeLeftIfExists, notLikeRightIfExists, notLikeRightIfExistsMethods inherited from interface com.github.yulichang.wrapper.interfaces.CompareStr
allEqStr, allEqStr, allEqStr, allEqStr, between, eq, ge, gt, le, like, likeLeft, likeRight, lt, ne, notBetween, notLike, notLikeLeft, notLikeRightMethods inherited from interface com.github.yulichang.wrapper.interfaces.CompareStrIfExists
eqIfExists, geIfExists, getIfExists, gtIfExists, leIfExists, likeIfExists, likeLeftIfExists, likeRightIfExists, ltIfExists, neIfExists, notLikeIfExists, notLikeLeftIfExists, notLikeRightIfExistsMethods inherited from interface com.github.yulichang.extension.kt.interfaces.Func
func, func, geSql, geSql, geSql, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, gtSql, gtSql, gtSql, having, in, in, in, in, in, in, inSql, inSql, inSql, isNotNull, isNotNull, isNotNull, isNull, isNull, isNull, leSql, leSql, leSql, ltSql, ltSql, ltSql, notIn, notIn, notIn, notIn, notIn, notIn, notInSql, notInSql, notInSql, orderBy, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByDesc, orderByDesc, orderByDesc, orderByDesc, orderByDesc, orderByDesc, orderByDescMethods inherited from interface com.github.yulichang.wrapper.interfaces.FuncStr
eqSql, geSql, groupBy, groupBy, groupByStr, gtSql, in, in, inSql, isNotNull, isNull, leSql, ltSql, notIn, notIn, notInSql, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByAscStr, orderByAscStr, orderByDesc, orderByDesc, orderByDesc, orderByDesc, orderByDescStr, orderByDescStrMethods inherited from interface com.github.yulichang.wrapper.interfaces.Join
apply, around, comment, exists, first, last, notExists, orMethods inherited from interface com.github.yulichang.interfaces.MPJBaseJoin
getDeleteLogicSql, getDeleteSql, getUnionSqlMethods inherited from interface com.baomidou.mybatisplus.core.conditions.interfaces.Nested
and, nested, not, orMethods inherited from interface com.github.yulichang.extension.kt.interfaces.OnCompare
eq, eq, eq, eq, eq, eq, eq, ge, ge, ge, ge, ge, ge, ge, gt, gt, gt, gt, gt, gt, gt, le, le, le, le, le, le, le, lt, lt, lt, lt, lt, lt, lt, ne, ne, ne, ne, ne, ne, neMethods inherited from interface com.github.yulichang.extension.kt.interfaces.QueryJoin
fullJoin, fullJoin, fullJoin, fullJoin, fullJoin, fullJoin, fullJoin, fullJoin, fullJoin, fullJoin, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, join, join, join, join, join, join, join, join, join, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin
-
Field Details
-
alias
主表别名 -
subTableAlias
副表别名 -
resultMap
protected boolean resultMap是否构建是否存在一对多 -
resultMapCollection
protected boolean resultMapCollection -
pageInfo
-
pageByMain
protected boolean pageByMain -
tableIndex
protected int tableIndex表序号 -
dynamicTableName
protected boolean dynamicTableName主表 表名处理方法 -
tableFunc
主表 表名处理方法 -
logicDelType
逻辑删除位置 -
from
protected final com.baomidou.mybatisplus.core.conditions.SharedString from查询表 -
hasAlias
protected boolean hasAlias是否有表别名 -
keyWord
连表关键字 on 条件 func 使用 -
subLogicSql
protected boolean subLogicSql副表逻辑删除开关 -
logicSql
protected boolean logicSql主表逻辑删除开关
-
-
Constructor Details
-
KtAbstractLambdaWrapper
public KtAbstractLambdaWrapper()推荐使用 带 class 的构造方法 -
KtAbstractLambdaWrapper
推荐使用此构造方法 -
KtAbstractLambdaWrapper
构造方法- Parameters:
entity- 主表实体
-
KtAbstractLambdaWrapper
自定义主表别名 -
KtAbstractLambdaWrapper
构造方法- Parameters:
clazz- 主表class类alias- 主表别名
-
KtAbstractLambdaWrapper
构造方法- Parameters:
entity- 主表实体类alias- 主表别名
-
-
Method Details
-
pageByMain
根据主表分页 -
pageByMain
根据主表分页 -
getPageInfo
-
setTableName
设置表别名 设置表别名注意sql注入问题- Returns:
- 自定义表别名
-
getTableName
-
getTableNameEnc
-
columnsToString
protected final String columnsToString(Integer index, PrefixEnum prefixEnum, String alias, kotlin.reflect.KProperty<?>... columns) Description copied from class:KtAbstractWrapper多字段转换为逗号 "," 分割字符串- Overrides:
columnsToStringin classKtAbstractWrapper<T,Children extends KtAbstractLambdaWrapper<T, Children>> columns- 多字段
-
columnToString
protected String columnToString(Integer index, String alias, kotlin.reflect.KProperty<?> column, boolean isJoin, PrefixEnum prefixEnum) -
getCache
-
getDefault
返回前缀 -
disableSubLogicDel
关闭副表逻辑删除副表逻辑删除默认在where语句中 但有时候需要让它出现在on语句中, 这两种写法区别还是很大的 所以可以关闭副表逻辑删除, 通过on语句多条件, 自己实现on语句的逻辑删除
-
enableSubLogicDel
-
disableLogicDel
关闭主表逻辑删除 -
enableLogicDel
-
getSubLogicSql
副表部分逻辑删除支持 -
getLogicSql
public boolean getLogicSql()主表部分逻辑删除支持 -
logicDelToOn
调整逻辑删除位置为ON语句 -
logicDelToWhere
调整逻辑删除位置为WHERE语句 -
getFrom
获取连表部分语句 -
join
public Children join(String keyWord, Class<?> clazz, String tableAlias, BiConsumer<KtAbstractLambdaWrapper<?, ?>, Children> consumer) 内部调用, 不建议使用 -
join
自定义关键词连接- Specified by:
joinin interfaceStringJoin<T,Children extends KtAbstractLambdaWrapper<T, Children>> - Parameters:
keyWord- 连表关键词condition- 条件joinSql- sql
-
isUseAnnotationOrderBy
public boolean isUseAnnotationOrderBy()是否使用默认注解OrderBy排序- Returns:
- true 使用 false 不使用
-
initNeed
protected void initNeed()必要的初始化 -
clear
public void clear()- Overrides:
clearin classKtAbstractWrapper<T,Children extends KtAbstractLambdaWrapper<T, Children>>
-