T - 查询主表实体类型R - 查询返回实体类型public class JoinWrapper<T,R> extends AbstractDynamicResultWrapper<T,R,JoinWrapper<T,R>>
| 限定符和类型 | 类和说明 |
|---|---|
static class |
JoinWrapper.JoinTable<T,J,R>
要join的关联表
|
static class |
JoinWrapper.LogicJoinTable<T,R>
要join的逻辑表
|
static class |
JoinWrapper.LogicTable<T>
不存在对应数据库表的逻辑表
|
| 限定符和类型 | 字段和说明 |
|---|---|
protected List<JoinWrapper.JoinTable<?,?,R>> |
joinTableList
join的表
|
protected AtomicInteger |
joinTableSeq
当前join表数量
|
alisa, isLogic, resultClass, selectColumns, tableInfo, targetClass| 限定符 | 构造器和说明 |
|---|---|
protected |
JoinWrapper(@NotNull Class<T> targetClass,
@NotNull Class<R> resultClass,
boolean isLogic) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected <J> JoinWrapper.JoinTable<T,J,R> |
addJoin(JoinType joinType,
Class<J> joinTable)
添加关联查询
|
protected <J> JoinWrapper<T,R> |
addJoin(JoinType joinType,
Class<J> joinTable,
Consumer<JoinWrapper.JoinTable<T,J,R>> consumer)
添加关联查询
|
protected JoinWrapper.LogicJoinTable<T,R> |
addJoin(JoinType joinType,
JoinWrapper<?,R> logicTable)
添加关联查询
|
static <T,R> JoinWrapper<T,R> |
create(@NotNull Class<T> targetClass,
@NotNull Class<R> resultClass)
创建条件构造器
|
String |
getSqlJoin()
获取“LEFT JOIN xxx a on a.id = b.aid”格式的join语句
|
boolean |
hasJoin()
是否存在join语句
|
protected void |
initNeed() |
<J> JoinWrapper.JoinTable<T,J,R> |
innerJoin(Class<J> joinTable)
内连接
|
<J> JoinWrapper<T,R> |
innerJoin(Class<J> joinTable,
Consumer<JoinWrapper.JoinTable<T,J,R>> consumer)
内连接
|
JoinWrapper.LogicJoinTable<T,R> |
innerJoin(JoinWrapper<?,R> logicTable)
内连接
|
protected JoinWrapper<T,R> |
instance()
获取实例用于or或and的嵌套查询
|
<J> JoinWrapper.JoinTable<T,J,R> |
join(Class<J> joinTable)
连接
|
<J> JoinWrapper<T,R> |
join(Class<J> joinTable,
Consumer<JoinWrapper.JoinTable<T,J,R>> consumer)
连接
|
JoinWrapper.LogicJoinTable<T,R> |
join(JoinWrapper<?,R> logicTable)
连接
|
<J> JoinWrapper.JoinTable<T,J,R> |
leftJoin(Class<J> joinTable)
左连接
|
<J> JoinWrapper<T,R> |
leftJoin(Class<J> joinTable,
Consumer<JoinWrapper.JoinTable<T,J,R>> consumer)
左连接
|
JoinWrapper.LogicJoinTable<T,R> |
leftJoin(JoinWrapper<?,R> logicTable)
左连接
|
<J> JoinWrapper.JoinTable<T,J,R> |
rightJoin(Class<J> joinTable)
右连接
|
<J> JoinWrapper<T,R> |
rightJoin(Class<J> joinTable,
Consumer<JoinWrapper.JoinTable<T,J,R>> consumer)
右连接
|
JoinWrapper.LogicJoinTable<T,R> |
rightJoin(JoinWrapper<?,R> logicTable)
右连接
|
void |
setAlisa(String alisa)
设置表别名,为连表时保证别名不重复,故不允许修改别名
|
protected void |
setAlisaByJoinSeq()
设置当前表别名
|
JoinWrapper.LogicTable<R> |
toLogicTable()
将当前查询转为一张逻辑表
|
columnToString, getSqlSelect, getTable, having, initLogicDelete, limit, limit, nonEmptyOfEntity, notLikeLeft, notLikeRight, select, selectAll, setEntity, setEntityClass, toStringColumn, toTableColumn, whereaddCondition, addNestedCondition, allEq, allEq, and, and, apply, between, clear, clone, columnsToString, comment, doIt, eq, exists, first, formatSql, formatSqlIfNeed, func, ge, getEntity, getEntityClass, getExpression, getParamNameValuePairs, getSqlComment, getSqlFirst, getSqlSegment, groupBy, gt, having, in, inSql, isNotNull, isNull, last, le, like, likeLeft, likeRight, likeValue, lt, ne, nested, not, not, notBetween, notExists, notIn, notInSql, notLike, or, or, orderBygetCustomSqlSegment, getSqlSet, getTargetSql, isEmptyOfEntity, isEmptyOfNormal, isEmptyOfWhere, nonEmptyOfNormal, nonEmptyOfWhereequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAlisa, getTableIfNonAlisa, getTableWithAlisabetween, betweenIfAllNotNull, eq, eqIfNotNull, ge, geIfNotNull, gt, gtIfNotNull, le, leIfNotNull, like, likeIfNotBank, likeLeft, likeLeftIfNotBank, likeRight, likeRightIfNotBank, lt, ltIfNotNull, ne, neIfNotNull, notBetween, notBetweenIfAllNotNull, notLike, notLikeIfNotBank, notLikeLeftIfNotBank, notLikeRightIfNotBankallEq, allEq, allEq, allEq, allEq, allEq, between, between, eq, eq, ge, ge, gt, gt, le, le, like, like, likeLeft, likeLeft, likeRight, likeRight, lt, lt, ne, ne, notBetween, notBetween, notLike, notLikeeqIfNotEmpty, in, notIn, notInIfNotEmptyfunc, func, groupBy, groupBy, groupBy, having, having, in, in, in, in, inSql, inSql, isNotNull, isNotNull, isNull, isNull, notIn, notIn, notIn, notIn, notInSql, notInSql, orderBy, orderByAsc, orderByAsc, orderByAsc, orderByDesc, orderByDesc, orderByDescabs, avg, caseByCondition, caseByValue, concat, count, count, currentDate, currentTime, currentTimestamp, dateFormat, day, div, format, ifNull, ifNull, lower, max, min, month, mul, now, plus, rand, replace, sub, sum, upper, yearhaving, having, select, select, select, toTableColumn, where, whereprotected AtomicInteger joinTableSeq
protected List<JoinWrapper.JoinTable<?,?,R>> joinTableList
public boolean hasJoin()
public static <T,R> JoinWrapper<T,R> create(@NotNull @NotNull Class<T> targetClass, @NotNull @NotNull Class<R> resultClass)
targetClass - 查询主表类型resultClass - 返回类型public void setAlisa(String alisa) throws UnsupportedOperationException
alisa - 表别名UnsupportedOperationException - 调用时抛出protected void setAlisaByJoinSeq()
public String getSqlJoin()
public JoinWrapper.LogicJoinTable<T,R> join(JoinWrapper<?,R> logicTable)
logicTable - 待连接的逻辑表public <J> JoinWrapper.JoinTable<T,J,R> join(Class<J> joinTable)
joinTable - 待连接的表public <J> JoinWrapper<T,R> join(Class<J> joinTable, Consumer<JoinWrapper.JoinTable<T,J,R>> consumer)
joinTable - 待连接的表consumer - 操作public JoinWrapper.LogicJoinTable<T,R> innerJoin(JoinWrapper<?,R> logicTable)
logicTable - 待连接的逻辑表public <J> JoinWrapper.JoinTable<T,J,R> innerJoin(Class<J> joinTable)
joinTable - 待连接的表public <J> JoinWrapper<T,R> innerJoin(Class<J> joinTable, Consumer<JoinWrapper.JoinTable<T,J,R>> consumer)
joinTable - 待连接的表consumer - 操作public JoinWrapper.LogicJoinTable<T,R> rightJoin(JoinWrapper<?,R> logicTable)
logicTable - 待连接的逻辑表public <J> JoinWrapper.JoinTable<T,J,R> rightJoin(Class<J> joinTable)
joinTable - 待连接的表public <J> JoinWrapper<T,R> rightJoin(Class<J> joinTable, Consumer<JoinWrapper.JoinTable<T,J,R>> consumer)
joinTable - 待连接的表consumer - 操作public JoinWrapper.LogicJoinTable<T,R> leftJoin(JoinWrapper<?,R> logicTable)
logicTable - 待连接的逻辑表public <J> JoinWrapper.JoinTable<T,J,R> leftJoin(Class<J> joinTable)
joinTable - 待连接的表public <J> JoinWrapper<T,R> leftJoin(Class<J> joinTable, Consumer<JoinWrapper.JoinTable<T,J,R>> consumer)
joinTable - 待连接的表consumer - 操作protected JoinWrapper.LogicJoinTable<T,R> addJoin(JoinType joinType, JoinWrapper<?,R> logicTable)
joinType - 连接类型logicTable - 要关联查询的逻辑表protected <J> JoinWrapper.JoinTable<T,J,R> addJoin(JoinType joinType, Class<J> joinTable)
joinType - 连接类型joinTable - 连接表类型protected <J> JoinWrapper<T,R> addJoin(JoinType joinType, Class<J> joinTable, Consumer<JoinWrapper.JoinTable<T,J,R>> consumer)
joinType - 连接类型joinTable - 连接表类型consumer - 操作protected JoinWrapper<T,R> instance()
instance 在类中 com.baomidou.mybatisplus.core.conditions.AbstractWrapper<T,com.baomidou.mybatisplus.core.toolkit.support.SFunction<T,?>,JoinWrapper<T,R>>protected void initNeed()
initNeed 在类中 AbstractDynamicResultWrapper<T,R,JoinWrapper<T,R>>public JoinWrapper.LogicTable<R> toLogicTable()
Copyright © 2022. All rights reserved.