public abstract class AbstractDynamicResultWrapper<T,R,C extends AbstractDynamicResultWrapper<T,R,C>> extends com.baomidou.mybatisplus.core.conditions.AbstractWrapper<T,com.baomidou.mybatisplus.core.toolkit.support.SFunction<T,?>,C> implements TableSegment, PredicateCompare<C,com.baomidou.mybatisplus.core.toolkit.support.SFunction<T,?>>, PredicateFunc<C,com.baomidou.mybatisplus.core.toolkit.support.SFunction<T,?>>, FuncColumnSelect<com.baomidou.mybatisplus.core.toolkit.support.SFunction<?,?>,com.baomidou.mybatisplus.core.toolkit.support.SFunction<T,?>,com.baomidou.mybatisplus.core.toolkit.support.SFunction<R,?>,C>
| 限定符和类型 | 字段和说明 |
|---|---|
protected String |
alisa
查询主表别名与表信息
|
protected boolean |
isLogic
查询主表是否为逻辑表
|
protected Class<R> |
resultClass |
protected List<ColumnSegment> |
selectColumns
查询字段
|
protected com.baomidou.mybatisplus.core.metadata.TableInfo |
tableInfo |
protected Class<T> |
targetClass
主表实体类型与返回实体类型
|
| 限定符 | 构造器和说明 |
|---|---|
protected |
AbstractDynamicResultWrapper(@NotNull Class<T> targetClass,
@NotNull Class<R> resultClass,
boolean isLogic)
创建条件构造器
|
| 限定符和类型 | 方法和说明 |
|---|---|
String |
columnToString(com.baomidou.mybatisplus.core.toolkit.support.SFunction<T,?> column)
将lambda表达式转为表字段,用于查询条件,字段前带有表别名
|
String |
getSqlSelect()
获取查询字段
|
String |
getTable()
获取主表名。
|
C |
having(ColumnSegment column,
Condition condition,
com.baomidou.mybatisplus.core.conditions.ISqlSegment valueColumn)
having条件
|
protected void |
initLogicDelete()
若主表不为逻辑表,则获取其逻辑删除字段并添加到条件中
|
protected void |
initNeed() |
C |
limit(boolean condition,
int limit)
limit
注意:limit直接调用 Join.last(String)方法,需要注意条件覆盖问题 |
C |
limit(boolean condition,
int limit,
int offset)
limit
注意:limit直接调用 Join.last(String)方法,需要注意条件覆盖问题 |
boolean |
nonEmptyOfEntity() |
C |
notLikeLeft(Predicate<String> condition,
com.baomidou.mybatisplus.core.toolkit.support.SFunction<T,?> column,
String val)
模糊匹配,如“not like '%aaa'”
|
C |
notLikeRight(Predicate<String> condition,
com.baomidou.mybatisplus.core.toolkit.support.SFunction<T,?> column,
String val)
模糊匹配,如“not like 'aaa%'”
|
C |
select(@NotNull ColumnSegment column)
查询字段
|
C |
selectAll()
查询全部字段,比如:“a.*”
|
C |
setEntity(T entity) |
C |
setEntityClass(Class<T> entityClass) |
String |
toStringColumn(com.baomidou.mybatisplus.core.toolkit.support.SFunction<?,?> column)
将lambda表达式转为字段,用于查询字段,字段前不带有表别名
|
ColumnSegment |
toTableColumn(com.baomidou.mybatisplus.core.toolkit.support.SFunction<T,?> column,
com.baomidou.mybatisplus.core.toolkit.support.SFunction<R,?> alisa)
将指定字段组装为当前所属主表的
ColumnSegment |
C |
where(ColumnSegment column,
Condition condition,
com.baomidou.mybatisplus.core.conditions.ISqlSegment valueColumn)
where条件
|
addCondition, 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, instance, 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, getTableWithAlisa, setAlisabetween, 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 String alisa
protected com.baomidou.mybatisplus.core.metadata.TableInfo tableInfo
protected List<ColumnSegment> selectColumns
protected boolean isLogic
protected AbstractDynamicResultWrapper(@NotNull
@NotNull Class<T> targetClass,
@NotNull
@NotNull Class<R> resultClass,
boolean isLogic)
targetClass - 主表实体类型resultClass - 返回实体类型isLogic - 主表是否为逻辑表com.baomidou.mybatisplus.core.exceptions.MybatisPlusException - 当主表不为逻辑表,且找不到对应TableInfo时抛出protected void initLogicDelete()
public C selectAll()
selectAll 在接口中 ColumnQuery<com.baomidou.mybatisplus.core.toolkit.support.SFunction<?,?>,com.baomidou.mybatisplus.core.toolkit.support.SFunction<T,?>,com.baomidou.mybatisplus.core.toolkit.support.SFunction<R,?>,C extends AbstractDynamicResultWrapper<T,R,C>>public C select(@NotNull @NotNull ColumnSegment column)
select 在接口中 ColumnQuery<com.baomidou.mybatisplus.core.toolkit.support.SFunction<?,?>,com.baomidou.mybatisplus.core.toolkit.support.SFunction<T,?>,com.baomidou.mybatisplus.core.toolkit.support.SFunction<R,?>,C extends AbstractDynamicResultWrapper<T,R,C>>column - 字段public C where(ColumnSegment column, Condition condition, com.baomidou.mybatisplus.core.conditions.ISqlSegment valueColumn)
where 在接口中 ColumnQuery<com.baomidou.mybatisplus.core.toolkit.support.SFunction<?,?>,com.baomidou.mybatisplus.core.toolkit.support.SFunction<T,?>,com.baomidou.mybatisplus.core.toolkit.support.SFunction<R,?>,C extends AbstractDynamicResultWrapper<T,R,C>>column - 表字段condition - 条件valueColumn - 值字段public C having(ColumnSegment column, Condition condition, com.baomidou.mybatisplus.core.conditions.ISqlSegment valueColumn)
having 在接口中 ColumnQuery<com.baomidou.mybatisplus.core.toolkit.support.SFunction<?,?>,com.baomidou.mybatisplus.core.toolkit.support.SFunction<T,?>,com.baomidou.mybatisplus.core.toolkit.support.SFunction<R,?>,C extends AbstractDynamicResultWrapper<T,R,C>>column - 表字段condition - 条件valueColumn - 值字段public C notLikeLeft(Predicate<String> condition, com.baomidou.mybatisplus.core.toolkit.support.SFunction<T,?> column, String val)
notLikeLeft 在接口中 PredicateCompare<C extends AbstractDynamicResultWrapper<T,R,C>,com.baomidou.mybatisplus.core.toolkit.support.SFunction<T,?>>condition - 是否生效column - 字段val - 值public C notLikeRight(Predicate<String> condition, com.baomidou.mybatisplus.core.toolkit.support.SFunction<T,?> column, String val)
notLikeRight 在接口中 PredicateCompare<C extends AbstractDynamicResultWrapper<T,R,C>,com.baomidou.mybatisplus.core.toolkit.support.SFunction<T,?>>condition - 是否生效column - 字段val - 值public C limit(boolean condition, int limit)
Join.last(String)方法,需要注意条件覆盖问题condition - 是否生效limit - 条数public C limit(boolean condition, int limit, int offset)
Join.last(String)方法,需要注意条件覆盖问题condition - 是否生效limit - 条数offset - 偏移量public String getTable()
getTable 在接口中 TableSegmentIllegalArgumentException - 当表为逻辑表时抛出public ColumnSegment toTableColumn(com.baomidou.mybatisplus.core.toolkit.support.SFunction<T,?> column, com.baomidou.mybatisplus.core.toolkit.support.SFunction<R,?> alisa)
ColumnSegmenttoTableColumn 在接口中 ColumnQuery<com.baomidou.mybatisplus.core.toolkit.support.SFunction<?,?>,com.baomidou.mybatisplus.core.toolkit.support.SFunction<T,?>,com.baomidou.mybatisplus.core.toolkit.support.SFunction<R,?>,C extends AbstractDynamicResultWrapper<T,R,C>>column - 字段alisa - 别名public String columnToString(com.baomidou.mybatisplus.core.toolkit.support.SFunction<T,?> column)
columnToString 在类中 com.baomidou.mybatisplus.core.conditions.AbstractWrapper<T,com.baomidou.mybatisplus.core.toolkit.support.SFunction<T,?>,C extends AbstractDynamicResultWrapper<T,R,C>>IllegalArgumentException - 表别名为null时抛出public String toStringColumn(com.baomidou.mybatisplus.core.toolkit.support.SFunction<?,?> column)
toStringColumn 在接口中 ColumnQuery<com.baomidou.mybatisplus.core.toolkit.support.SFunction<?,?>,com.baomidou.mybatisplus.core.toolkit.support.SFunction<T,?>,com.baomidou.mybatisplus.core.toolkit.support.SFunction<R,?>,C extends AbstractDynamicResultWrapper<T,R,C>>column - 字段protected void initNeed()
@Nullable public String getSqlSelect()
getSqlSelect 在类中 com.baomidou.mybatisplus.core.conditions.Wrapper<T>public C setEntity(T entity) throws UnsupportedOperationException
setEntity 在类中 com.baomidou.mybatisplus.core.conditions.AbstractWrapper<T,com.baomidou.mybatisplus.core.toolkit.support.SFunction<T,?>,C extends AbstractDynamicResultWrapper<T,R,C>>UnsupportedOperationExceptionpublic C setEntityClass(Class<T> entityClass) throws UnsupportedOperationException
setEntityClass 在类中 com.baomidou.mybatisplus.core.conditions.AbstractWrapper<T,com.baomidou.mybatisplus.core.toolkit.support.SFunction<T,?>,C extends AbstractDynamicResultWrapper<T,R,C>>UnsupportedOperationExceptionpublic boolean nonEmptyOfEntity()
nonEmptyOfEntity 在类中 com.baomidou.mybatisplus.core.conditions.Wrapper<T>Copyright © 2022. All rights reserved.