Class AptQueryWrapper<T>
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,AptQueryWrapper<T>>
com.github.yulichang.extension.apt.AptQueryWrapper<T>
- All Implemented Interfaces:
com.baomidou.mybatisplus.core.conditions.interfaces.Nested<AptQueryWrapper<T>,,AptQueryWrapper<T>> com.baomidou.mybatisplus.core.conditions.ISqlSegment,Compare<AptQueryWrapper<T>>,CompareIfExists<AptQueryWrapper<T>>,Func<AptQueryWrapper<T>>,FuncLambda<AptQueryWrapper<T>>,OnCompare<AptQueryWrapper<T>>,Query<AptQueryWrapper<T>>,QueryJoin<AptQueryWrapper<T>,,T> QueryLabel<AptQueryWrapper<T>>,MPJBaseJoin<T>,StringJoin<AptQueryWrapper<T>,,T> Chain<T>,CompareStr<AptQueryWrapper<T>,,String> CompareStrIfExists<AptQueryWrapper<T>,,String> FuncStr<AptQueryWrapper<T>,,String> Join<AptQueryWrapper<T>>,SelectWrapper<T,,AptQueryWrapper<T>> Serializable
public class AptQueryWrapper<T>
extends AptAbstractWrapper<T,AptQueryWrapper<T>>
implements Query<AptQueryWrapper<T>>, QueryLabel<AptQueryWrapper<T>>, Chain<T>, SelectWrapper<T,AptQueryWrapper<T>>
Lambda 语法使用 Wrapper
- Since:
- 1.5.0
- Author:
- yulichang
- See Also:
-
Field Summary
Fields inherited from class com.github.yulichang.extension.apt.AptAbstractWrapper
alias, aptIndex, baseColumn, dynamicTableName, from, hasAlias, isMain, keyWord, logicDelType, logicSql, pageByMain, pageInfo, resultMap, resultMapCollection, subLogicSql, subTableAlias, tableFunc, tableIndexFields inherited from class com.github.yulichang.extension.apt.JoinAbstractWrapper
checkSqlInjection, expression, ifExists, index, joinClass, lastSql, onWrappers, paramAlias, paramNameSeq, paramNameValuePairs, sqlComment, sqlFirst, tableName, typedThis -
Constructor Summary
ConstructorsModifierConstructorDescriptionAptQueryWrapper(BaseColumn<T> baseColumn) 推荐使用此构造方法AptQueryWrapper(BaseColumn<T> baseColumn, T entity) protectedAptQueryWrapper(T entity, BaseColumn<T> baseColumn, com.baomidou.mybatisplus.core.conditions.SharedString sqlSelect, AtomicInteger paramNameSeq, Map<String, Object> paramNameValuePairs, com.baomidou.mybatisplus.core.conditions.segments.MergeSegments mergeSegments, com.baomidou.mybatisplus.core.conditions.SharedString paramAlias, com.baomidou.mybatisplus.core.conditions.SharedString lastSql, com.baomidou.mybatisplus.core.conditions.SharedString sqlComment, com.baomidou.mybatisplus.core.conditions.SharedString sqlFirst, TableMap aptIndex, Integer index, String keyWord, Class<?> joinClass, String tableName, MBiPredicate<Object, IfExistsSqlKeyWordEnum> IfExists) 不建议直接 new 该实例,使用 JoinWrappers.lambda(UserDO.class) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclear()distinct()sql去重 select distinctboolean查询条件 SQL 片段protected AptQueryWrapper<T>instance()用于生成嵌套 sqlprotected AptQueryWrapper<T>protected AptQueryWrapper<T>final AptQueryWrapper<T>设置查询字段查询主表全部字段final <E> AptQueryWrapper<T>selectAll(BaseColumn<E> baseColumn, Column... exclude) 查询实体类全部字段selectFunc(String sql, MFunction<AptConsumer> column, String alias) <E,F> AptQueryWrapper<T> selectSub(BaseColumn<E> baseColumn, Consumer<AptQueryWrapper<E>> consumer, com.baomidou.mybatisplus.core.toolkit.support.SFunction<F, ?> alias) <E,F> AptQueryWrapper<T> selectSub(BaseColumn<E> baseColumn, Consumer<AptQueryWrapper<E>> consumer, String alias) 子查询<U> AptQueryWrapper<T>union(BaseColumn<U> baseColumn, Consumer<AptQueryWrapper<U>> consumer) union<U> AptQueryWrapper<T>unionAll(BaseColumn<U> baseColumn, Consumer<AptQueryWrapper<U>> consumer) unionMethods inherited from class com.github.yulichang.extension.apt.AptAbstractWrapper
checkJoinTable, columnsToString, columnToString, disableLogicDel, disableSubLogicDel, enableLogicDel, enableSubLogicDel, getCache, getFrom, getLogicSql, getPageInfo, getSubLogicSql, getTableName, getTableNameEnc, initNeed, isUseAnnotationOrderBy, join, join, logicDelToOn, logicDelToWhere, pageByMain, pageByMain, setTableNameMethods inherited from class com.github.yulichang.extension.apt.JoinAbstractWrapper
addCondition, addCondition, addCondition, addNestedCondition, allEqStr, allEqStr, and, and, appendSqlSegments, apply, applyFunc, applyFunc, around, between, between, checkSqlInjection, clone, columnSqlInjectFilter, columnsToString, columnsToString, columnsToString, columnToSqlSegment, columnToSqlSegment, columnToString, comment, eq, eq, eq, eqSql, eqSql, exists, first, formatParam, formatSqlMaybeWithParam, func, ge, ge, ge, geSql, geSql, getEntity, getEntityClass, getExpression, getParamAlias, getSqlComment, getSqlFirst, getSqlSegment, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupByLambda, 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, orderBy, orderByAsc, orderByAsc, orderByAsc, orderByAscLambda, orderByDesc, orderByDesc, orderByDesc, orderByDescLambda, 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.apt.interfaces.Compare
between, eq, ge, gt, le, like, likeLeft, likeRight, lt, ne, notBetween, notLike, notLikeLeft, notLikeRightMethods inherited from interface com.github.yulichang.extension.apt.interfaces.CompareIfExists
eqIfExists, geIfExists, getIfExists, gtIfExists, leIfExists, likeIfExists, likeLeftIfExists, likeRightIfExists, ltIfExists, neIfExists, notLikeIfExists, notLikeLeftIfExists, 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.apt.interfaces.Func
eqSql, func, func, geSql, groupBy, groupBy, groupBy, gtSql, having, in, in, inSql, isNotNull, isNull, leSql, ltSql, notIn, notIn, notInSql, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByDesc, orderByDesc, orderByDesc, orderByDescMethods inherited from interface com.github.yulichang.extension.apt.interfaces.FuncLambda
groupBy, groupByLambda, orderByAsc, orderByAscLambda, orderByDesc, orderByDescLambdaMethods 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.apt.interfaces.OnCompare
eq, ge, gt, le, lt, neMethods inherited from interface com.github.yulichang.extension.apt.interfaces.Query
select, selectAll, selectAs, selectAs, selectAs, selectAs, selectAsClass, selectAvg, selectAvg, selectAvg, selectCount, selectCount, selectCount, selectFilter, selectFunc, selectFunc, selectFunc, selectFunc, selectLen, selectLen, selectLen, selectMax, selectMax, selectMax, selectMin, selectMin, selectMin, selectSum, selectSum, selectSumMethods inherited from interface com.github.yulichang.extension.apt.interfaces.QueryJoin
innerJoin, innerJoin, join, leftJoin, leftJoin, rightJoin, rightJoinMethods inherited from interface com.github.yulichang.extension.apt.interfaces.QueryLabel
selectAssociation, selectAssociation, selectAssociation, 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
-
AptQueryWrapper
推荐使用此构造方法 -
AptQueryWrapper
-
-
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
查询实体类全部字段 -
selectAll
查询主表全部字段需要使用 使用 JoinWrappers.lambda(clazz) 或者 new MPJLambdaQueryWrapper<<(clazz) 构造
- Specified by:
selectAllin interfaceSelectWrapper<T,AptQueryWrapper<T>> - Returns:
- children
-
selectFunc
- Specified by:
selectFuncin interfaceQuery<T>
-
selectSub
public <E,F> AptQueryWrapper<T> selectSub(BaseColumn<E> baseColumn, Consumer<AptQueryWrapper<E>> consumer, com.baomidou.mybatisplus.core.toolkit.support.SFunction<F, ?> alias) -
selectSub
public <E,F> AptQueryWrapper<T> selectSub(BaseColumn<E> baseColumn, Consumer<AptQueryWrapper<E>> consumer, String alias) 子查询 -
union
public <U> AptQueryWrapper<T> union(BaseColumn<U> baseColumn, Consumer<AptQueryWrapper<U>> consumer) union例: wrapper.union(UserDO.class, union -> union.selectAll(UserDO.class))
- Parameters:
baseColumn- union语句的主表类型- Since:
- 1.4.8
-
unionAll
public <U> AptQueryWrapper<T> unionAll(BaseColumn<U> baseColumn, Consumer<AptQueryWrapper<U>> consumer) union例: wrapper.unionAll(UserDO.class, union -> union.selectAll(UserDO.class))
- Parameters:
baseColumn- 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 classJoinAbstractWrapper<T,AptQueryWrapper<T>>
-
instanceEmpty
- Specified by:
instanceEmptyin classJoinAbstractWrapper<T,AptQueryWrapper<T>>
-
instance
protected AptQueryWrapper<T> instance(Integer index, String keyWord, Class<?> joinClass, String tableName) - Specified by:
instancein classJoinAbstractWrapper<T,AptQueryWrapper<T>>
-
clear
public void clear()- Overrides:
clearin classAptAbstractWrapper<T,AptQueryWrapper<T>>
-