Package com.github.yulichang.wrapper
Class MPJLambdaWrapper<T>
java.lang.Object
com.baomidou.mybatisplus.core.conditions.Wrapper<T>
com.github.yulichang.wrapper.JoinAbstractWrapper<T,Children>
com.github.yulichang.wrapper.JoinAbstractLambdaWrapper<T,MPJLambdaWrapper<T>>
com.github.yulichang.wrapper.MPJLambdaWrapper<T>
- All Implemented Interfaces:
com.baomidou.mybatisplus.core.conditions.ISqlSegment,MPJBaseJoin<T>,StringJoin<MPJLambdaWrapper<T>,,T> Ext<MPJLambdaWrapper<T>>,Chain<T>,Compare<MPJLambdaWrapper<T>>,CompareIfExists<MPJLambdaWrapper<T>>,CompareStr<MPJLambdaWrapper<T>,,String> CompareStrIfExists<MPJLambdaWrapper<T>,,String> CompareWrapper<MPJLambdaWrapper<T>>,Fill<MPJLambdaWrapper<T>>,Func<MPJLambdaWrapper<T>>,FuncStr<MPJLambdaWrapper<T>,,String> FuncWrapper<MPJLambdaWrapper<T>>,Join<MPJLambdaWrapper<T>>,Nested<MPJLambdaWrapper<T>,,MPJLambdaWrapper<T>> OnCompare<MPJLambdaWrapper<T>>,Query<MPJLambdaWrapper<T>>,QueryJoin<MPJLambdaWrapper<T>,,T> QueryLabel<MPJLambdaWrapper<T>>,SelectWrapper<T,,MPJLambdaWrapper<T>> Serializable
public class MPJLambdaWrapper<T>
extends JoinAbstractLambdaWrapper<T,MPJLambdaWrapper<T>>
implements Fill<MPJLambdaWrapper<T>>, Query<MPJLambdaWrapper<T>>, QueryLabel<MPJLambdaWrapper<T>>, Chain<T>, SelectWrapper<T,MPJLambdaWrapper<T>>
参考
LambdaQueryWrapper
Lambda 语法使用 Wrapper- Author:
- yulichang
- See Also:
-
Field Summary
Fields inherited from class com.github.yulichang.wrapper.JoinAbstractLambdaWrapper
dynamicTableName, from, hasAlias, keyWord, logicDelType, logicSql, pageByMain, pageInfo, resultMap, resultMapCollection, subLogicSql, tableFunc, tableIndexFields inherited from class com.github.yulichang.wrapper.JoinAbstractWrapper
alias, checkSqlInjection, expression, ifExists, index, isMain, isOn, joinClass, lastSql, onWrappers, paramAlias, paramNameSeq, paramNameValuePairs, sqlComment, sqlFirst, subTableAlias, tableList, tableName, typedThis -
Constructor Summary
ConstructorsModifierConstructorDescription推荐使用 带 class 的构造方法MPJLambdaWrapper(Class<T> clazz) 推荐使用此构造方法MPJLambdaWrapper(Class<T> clazz, String alias) 构造方法MPJLambdaWrapper(String alias) 自定义主表别名MPJLambdaWrapper(T entity) 构造方法protectedMPJLambdaWrapper(T entity, Class<T> entityClass, 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, TableList tableList, Integer index, String keyWord, Class<?> joinClass, String tableName, MBiPredicate<Object, IfExistsSqlKeyWordEnum> IfExists) 不建议直接 new 该实例,使用 JoinWrappers.lambda(UserDO.class)MPJLambdaWrapper(T entity, String alias) 构造方法 -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclear()distinct()sql去重 select distinctvoidboolean查询条件 SQL 片段protected MPJLambdaWrapper<T>instance()用于生成嵌套 sqlprotected MPJLambdaWrapper<T>protected MPJLambdaWrapper<T>final <E> MPJLambdaWrapper<T>select(com.baomidou.mybatisplus.core.toolkit.support.SFunction<E, ?>... columns) 设置查询字段查询主表全部字段查询实体类全部字段final <E> MPJLambdaWrapper<T>查询实体类全部字段final <E> MPJLambdaWrapper<T>selectAll(Class<E> clazz, String prefix, com.baomidou.mybatisplus.core.toolkit.support.SFunction<E, ?>... exclude) 查询实体类全部字段selectFunc(String sql, MFunction<FuncConsumer> column, String alias) <E,F> MPJLambdaWrapper<T> selectSub(Class<E> clazz, String st, Consumer<MPJLambdaWrapper<E>> consumer, com.baomidou.mybatisplus.core.toolkit.support.SFunction<F, ?> alias) <E,F> MPJLambdaWrapper<T> 子查询<E,F> MPJLambdaWrapper<T> selectSub(Class<E> clazz, Consumer<MPJLambdaWrapper<E>> consumer, com.baomidou.mybatisplus.core.toolkit.support.SFunction<F, ?> alias) 子查询<U> MPJLambdaWrapper<T>union(Class<U> clazz, boolean brackets, Consumer<MPJLambdaWrapper<U>> consumer) union<U> MPJLambdaWrapper<T>union(Class<U> clazz, Consumer<MPJLambdaWrapper<U>> consumer) <U> MPJLambdaWrapper<T>unionAll(Class<U> clazz, boolean brackets, Consumer<MPJLambdaWrapper<U>> consumer) union<U> MPJLambdaWrapper<T>unionAll(Class<U> clazz, Consumer<MPJLambdaWrapper<U>> consumer) Methods inherited from class com.github.yulichang.wrapper.JoinAbstractLambdaWrapper
checkJoinTable, columnsToString, columnToString, disableLogicDel, disableSubLogicDel, enableLogicDel, enableSubLogicDel, from, getCache, getDefault, getFrom, getLogicSql, getPageInfo, getSubLogicSql, getTableName, getTableNameEnc, initNeed, isUseAnnotationOrderBy, join, join, logicDelToOn, logicDelToWhere, pageByMain, pageByMain, setAlias, setTableNameMethods inherited from class com.github.yulichang.wrapper.JoinAbstractWrapper
addCondition, addCondition, addCondition, addCondition, addNestedCondition, allEq, 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, eq, eqSql, eqSql, exists, exists, first, formatParam, formatSqlMaybeWithParam, fromInstance, func, ge, ge, ge, ge, geSql, geSql, getEntity, getEntityClass, getExpression, getParamAlias, getSqlComment, getSqlFirst, getSqlSegment, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupByStr, gt, gt, gt, gt, gtSql, gtSql, having, in, in, in, in, in, inExpression, inExpression, inSql, inSql, isNotNull, isNotNull, isNotNull, isNull, isNull, isNull, last, le, le, le, le, leSql, leSql, like, like, likeLeft, likeLeft, likeRight, likeRight, likeValue, likeValue, lt, lt, lt, lt, ltSql, ltSql, maybeDo, ne, ne, ne, ne, nested, not, not, notBetween, notBetween, notExists, notExists, notIn, notIn, notIn, notIn, notIn, notInSql, notInSql, notLike, notLike, notLikeLeft, notLikeLeft, notLikeRight, notLikeRight, or, or, orderBy, orderBy, orderBy, orderBy, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByDesc, orderByDesc, orderByDesc, orderByDesc, orderByDesc, orderByStr, setEntity, setEntityClass, setIfExists, setIfExists, setParamAlias, subInstance, subInstanceMethods 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.wrapper.interfaces.Compare
allEq, allEq, 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.wrapper.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.wrapper.interfaces.CompareWrapper
eq, eq, eq, ge, ge, ge, gt, gt, gt, le, le, le, lt, lt, lt, ne, ne, neMethods inherited from interface com.github.yulichang.wrapper.interfaces.Fill
fill, fill, fill, fill, fill, fillMethods inherited from interface com.github.yulichang.wrapper.interfaces.Func
eqSql, eqSql, eqSql, func, func, geSql, geSql, geSql, 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, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByAsc, 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.FuncWrapper
exists, in, in, in, isNotNull, isNotNull, isNotNull, isNull, isNull, isNull, notExists, notIn, notIn, notInMethods 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.github.yulichang.wrapper.interfaces.Nested
and, nested, not, orMethods inherited from interface com.github.yulichang.wrapper.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.wrapper.interfaces.Query
getAlias, getIndex, isHasAlias, select, select, selectAll, selectAs, selectAs, selectAs, selectAs, selectAsClass, selectAvg, selectAvg, selectAvg, selectCount, selectCount, selectCount, selectCount, selectCount, selectFilter, selectFunc, selectFunc, selectFunc, selectFunc, selectFunc, selectFunc, selectFunc, selectFunc, selectFunc, selectLen, selectLen, selectLen, selectMax, selectMax, selectMax, selectMin, selectMin, selectMin, selectSum, selectSum, selectSumMethods inherited from interface com.github.yulichang.wrapper.interfaces.QueryJoin
fullJoin, fullJoin, fullJoin, fullJoin, fullJoin, fullJoin, fullJoin, fullJoin, fullJoin, fullJoin, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, join, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, rightJoinMethods inherited from interface com.github.yulichang.wrapper.interfaces.QueryLabel
selectAssociation, selectAssociation, selectAssociation, selectAssociation, selectAssociation, selectCollection, selectCollection, selectCollection, selectCollection, selectCollectionMethods inherited from interface com.github.yulichang.wrapper.interfaces.SelectWrapper
getAlias, getEntityClass, getFrom, getPageInfo, getResultMapMybatisLabel, getSelectColumns, isPageByMain, isResultMap, isResultMapCollection, setEntityClass
-
Constructor Details
-
MPJLambdaWrapper
public MPJLambdaWrapper()推荐使用 带 class 的构造方法 -
MPJLambdaWrapper
推荐使用此构造方法 -
MPJLambdaWrapper
构造方法- Parameters:
entity- 主表实体
-
MPJLambdaWrapper
自定义主表别名 -
MPJLambdaWrapper
构造方法- Parameters:
clazz- 主表class类alias- 主表别名
-
MPJLambdaWrapper
构造方法- 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
@SafeVarargs public final <E> MPJLambdaWrapper<T> select(com.baomidou.mybatisplus.core.toolkit.support.SFunction<E, ?>... columns) 设置查询字段 -
selectAll
Description copied from interface:Query查询实体类全部字段 -
selectAll
@SafeVarargs public final <E> MPJLambdaWrapper<T> selectAll(Class<E> clazz, com.baomidou.mybatisplus.core.toolkit.support.SFunction<E, ?>... exclude) 查询实体类全部字段 -
selectAll
@SafeVarargs public final <E> MPJLambdaWrapper<T> selectAll(Class<E> clazz, String prefix, com.baomidou.mybatisplus.core.toolkit.support.SFunction<E, ?>... exclude) 查询实体类全部字段 -
selectAll
查询主表全部字段需要使用 使用 JoinWrappers.lambda(clazz) 或者 new MPJLambdaQueryWrapper<<(clazz) 构造
- Specified by:
selectAllin interfaceSelectWrapper<T,MPJLambdaWrapper<T>> - Returns:
- children
-
selectFunc
- Specified by:
selectFuncin interfaceQuery<T>
-
selectSub
public <E,F> MPJLambdaWrapper<T> selectSub(Class<E> clazz, Consumer<MPJLambdaWrapper<E>> consumer, com.baomidou.mybatisplus.core.toolkit.support.SFunction<F, ?> alias) 子查询 -
selectSub
public <E,F> MPJLambdaWrapper<T> selectSub(Class<E> clazz, String st, Consumer<MPJLambdaWrapper<E>> consumer, com.baomidou.mybatisplus.core.toolkit.support.SFunction<F, ?> alias) -
selectSub
public <E,F> MPJLambdaWrapper<T> selectSub(Class<E> clazz, String st, Consumer<MPJLambdaWrapper<E>> consumer, String alias) 子查询 -
union
-
union
public <U> MPJLambdaWrapper<T> union(Class<U> clazz, boolean brackets, Consumer<MPJLambdaWrapper<U>> consumer) union例: wrapper.union(UserDO.class, union -> union.selectAll(UserDO.class))
- Parameters:
clazz- union语句的主表类型- Since:
- 1.4.8
-
addFill
-
doFill
- Specified by:
doFillin interfaceSelectWrapper<T,MPJLambdaWrapper<T>>
-
unionAll
-
unionAll
public <U> MPJLambdaWrapper<T> unionAll(Class<U> clazz, boolean brackets, Consumer<MPJLambdaWrapper<U>> consumer) 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 classJoinAbstractWrapper<T,MPJLambdaWrapper<T>>
-
instanceEmpty
- Specified by:
instanceEmptyin classJoinAbstractWrapper<T,MPJLambdaWrapper<T>>
-
instance
protected MPJLambdaWrapper<T> instance(Integer index, String keyWord, Class<?> joinClass, String tableName) - Specified by:
instancein classJoinAbstractWrapper<T,MPJLambdaWrapper<T>>
-
clear
public void clear()- Overrides:
clearin classJoinAbstractLambdaWrapper<T,MPJLambdaWrapper<T>>
-