Class KtLambdaWrapper<T>
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,KtLambdaWrapper<T>>
com.github.yulichang.extension.kt.KtLambdaWrapper<T>
- All Implemented Interfaces:
com.baomidou.mybatisplus.core.conditions.interfaces.Nested<KtLambdaWrapper<T>,,KtLambdaWrapper<T>> com.baomidou.mybatisplus.core.conditions.ISqlSegment,Compare<KtLambdaWrapper<T>>,CompareIfExists<KtLambdaWrapper<T>>,Func<KtLambdaWrapper<T>>,OnCompare<KtLambdaWrapper<T>>,Query<KtLambdaWrapper<T>>,QueryJoin<KtLambdaWrapper<T>,,T> QueryLabel<KtLambdaWrapper<T>>,MPJBaseJoin<T>,StringJoin<KtLambdaWrapper<T>,,T> Chain<T>,CompareStr<KtLambdaWrapper<T>,,String> CompareStrIfExists<KtLambdaWrapper<T>,,String> FuncStr<KtLambdaWrapper<T>,,String> Join<KtLambdaWrapper<T>>,SelectWrapper<T,,KtLambdaWrapper<T>> Serializable
public class KtLambdaWrapper<T>
extends KtAbstractLambdaWrapper<T,KtLambdaWrapper<T>>
implements Query<KtLambdaWrapper<T>>, QueryLabel<KtLambdaWrapper<T>>, Chain<T>, SelectWrapper<T,KtLambdaWrapper<T>>
参考
LambdaQueryWrapper
Lambda 语法使用 Wrapper- Since:
- 1.4.6
- Author:
- yulichang
- See Also:
-
Field Summary
Fields inherited from class com.github.yulichang.extension.kt.KtAbstractLambdaWrapper
alias, dynamicTableName, from, hasAlias, keyWord, logicDelType, logicSql, pageByMain, pageInfo, resultMap, resultMapCollection, subLogicSql, subTableAlias, tableFunc, tableIndexFields 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 的构造方法KtLambdaWrapper(Class<T> clazz) 推荐使用此构造方法KtLambdaWrapper(Class<T> clazz, String alias) 构造方法KtLambdaWrapper(String alias) 自定义主表别名KtLambdaWrapper(T entity) 构造方法KtLambdaWrapper(T entity, String alias) 构造方法 -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclear()distinct()sql去重 select distinctboolean查询条件 SQL 片段protected KtLambdaWrapper<T>instance()用于生成嵌套 sqlprotected KtLambdaWrapper<T>protected KtLambdaWrapper<T>final KtLambdaWrapper<T>select(kotlin.reflect.KProperty<?>... columns) 设置查询字段selectFunc(String sql, MFunction<FuncArgs> column, String alias) 子查询selectSub(Class<?> clazz, Consumer<KtLambdaWrapper<?>> consumer, kotlin.reflect.KProperty<?> alias) 子查询<E,F> KtLambdaWrapper<T> selectSub(Class<E> clazz, String st, Consumer<KtLambdaWrapper<?>> consumer, kotlin.reflect.KProperty<?> alias) final KtLambdaWrapper<T>union(KtLambdaWrapper<?>... wrappers) Deprecated.union 不支持子查询<U> KtLambdaWrapper<T>union(Class<U> clazz, Consumer<KtLambdaWrapper<U>> consumer) unionfinal KtLambdaWrapper<T>unionAll(KtLambdaWrapper<?>... wrappers) Deprecated.union 不支持子查询<U> KtLambdaWrapper<T>unionAll(Class<U> clazz, Consumer<KtLambdaWrapper<U>> consumer) unionMethods inherited from class com.github.yulichang.extension.kt.KtAbstractLambdaWrapper
columnsToString, columnToString, disableLogicDel, disableSubLogicDel, enableLogicDel, enableSubLogicDel, getCache, getDefault, getFrom, getLogicSql, getPageInfo, getSubLogicSql, getTableName, getTableNameEnc, initNeed, isUseAnnotationOrderBy, join, join, logicDelToOn, logicDelToWhere, pageByMain, pageByMain, setTableNameMethods 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, 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, 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.wrapper.interfaces.Chain
count, first, first, getEntityClass, isResultMapCollection, list, list, mapFirst, mapList, mapOne, mapPage, one, one, page, pageMethods 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, getDeleteSqlMethods 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.Query
getAlias, getIndex, isHasAlias, select, select, selectAll, selectAll, selectAs, selectAs, selectAs, selectAs, selectAsClass, selectAvg, selectAvg, selectAvg, selectCount, selectCount, selectCount, selectCount, selectCount, selectFilter, selectFunc, selectFunc, selectFunc, selectFunc, selectFunc, selectFunc, selectLen, selectLen, selectLen, selectMax, selectMax, selectMax, selectMin, selectMin, selectMin, selectSum, selectSum, selectSumMethods 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, rightJoinMethods inherited from interface com.github.yulichang.extension.kt.interfaces.QueryLabel
selectAssociation, selectAssociation, selectAssociation, selectAssociation, selectAssociation, selectCollection, selectCollection, selectCollection, selectCollection, selectCollectionMethods inherited from interface com.github.yulichang.wrapper.interfaces.SelectWrapper
doFill, getAlias, getEntityClass, getFrom, getPageInfo, getResultMapMybatisLabel, getSelectColumns, isPageByMain, isResultMap, isResultMapCollection, setEntityClass
-
Constructor Details
-
KtLambdaWrapper
public KtLambdaWrapper()推荐使用 带 class 的构造方法 -
KtLambdaWrapper
推荐使用此构造方法 -
KtLambdaWrapper
构造方法- Parameters:
entity- 主表实体
-
KtLambdaWrapper
自定义主表别名 -
KtLambdaWrapper
构造方法- Parameters:
clazz- 主表class类alias- 主表别名
-
KtLambdaWrapper
构造方法- Parameters:
entity- 主表实体类alias- 主表别名
-
-
Method Details
-
distinct
sql去重 select distinct -
getSelectColum
- Specified by:
getSelectColumin interfaceQuery<T>
-
addLabel
- Specified by:
addLabelin interfaceQueryLabel<T>
-
getChildren
- Specified by:
getChildrenin interfaceQuery<T>- Specified by:
getChildrenin interfaceQueryLabel<T>
-
select
设置查询字段 -
selectAll
- Specified by:
selectAllin interfaceSelectWrapper<T,KtLambdaWrapper<T>>
-
selectSub
public KtLambdaWrapper<T> selectSub(Class<?> clazz, Consumer<KtLambdaWrapper<?>> consumer, kotlin.reflect.KProperty<?> alias) 子查询 -
selectSub
public <E,F> KtLambdaWrapper<T> selectSub(Class<E> clazz, String st, Consumer<KtLambdaWrapper<?>> consumer, kotlin.reflect.KProperty<?> alias) -
selectSub
public KtLambdaWrapper<T> selectSub(Class<?> clazz, String st, Consumer<KtLambdaWrapper<?>> consumer, String alias) 子查询 -
selectFunc
- Specified by:
selectFuncin interfaceQuery<T>
-
union
Deprecated.union 不支持子查询union推荐使用 union(Class<U> clazz, Consumer<MPJLambdaWrapper<U>> consumer) 例: wrapper.union(UserDO.class, union -> union.selectAll(UserDO.class))
- See Also:
-
union
union例: wrapper.union(UserDO.class, union -> union.selectAll(UserDO.class))
- Parameters:
clazz- union语句的主表类型- Since:
- 1.4.8
-
unionAll
Deprecated.union 不支持子查询union推荐使用 unionAll(Class<U> clazz, Consumer<MPJLambdaWrapper<U>> consumer) 例: wrapper.unionAll(UserDO.class, union -> union.selectAll(UserDO.class))
- See Also:
-
unionAll
union例: wrapper.unionAll(UserDO.class, union -> union.selectAll(UserDO.class))
- Parameters:
clazz- union语句的主表类型- Since:
- 1.4.8
-
getSqlSelect
查询条件 SQL 片段- Specified by:
getSqlSelectin interfaceQuery<T>- Overrides:
getSqlSelectin classcom.baomidou.mybatisplus.core.conditions.Wrapper<T>
-
getUnionSql
- Specified by:
getUnionSqlin interfaceMPJBaseJoin<T>
-
getSelectDistinct
public boolean getSelectDistinct() -
instance
用于生成嵌套 sql故 sqlSelect 不向下传递
- Specified by:
instancein classKtAbstractWrapper<T,KtLambdaWrapper<T>>
-
instanceEmpty
- Specified by:
instanceEmptyin classKtAbstractWrapper<T,KtLambdaWrapper<T>>
-
instance
protected KtLambdaWrapper<T> instance(Integer index, String keyWord, Class<?> joinClass, String tableName) - Specified by:
instancein classKtAbstractWrapper<T,KtLambdaWrapper<T>>
-
clear
public void clear()- Overrides:
clearin classKtAbstractLambdaWrapper<T,KtLambdaWrapper<T>>
-