public abstract class SupportJoinStrQueryWrapper<T,Children extends SupportJoinStrQueryWrapper<T,Children>> extends SupportJoinWrapper<T,String,Children> implements com.baomidou.mybatisplus.core.conditions.query.Query<Children,T,String>, JoinStrCompareFunc<Children>, JoinStrMethodFunc<T,Children>, JoinStrFunc<Children>
| 限定符和类型 | 字段和说明 |
|---|---|
protected Map<String,String> |
alias2table
别名映射表
|
protected Map<String,com.baomidou.mybatisplus.core.conditions.SharedString> |
joinSqlMapping
join sql和别名映射
|
customAliasMap, fieldMappingList, hasDistinct, joinSql, manyToManySelectBuildList, masterLogicDelete, masterTableAlias, mpjConfig, notDefaultSelectAll, oneToOneSelectBuildList, sqlSelect| 构造器和说明 |
|---|
SupportJoinStrQueryWrapper() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
addSelectByFieldMappings(List<FieldMapping> fieldMappings)
根据字段映射列表添加查询字段
|
protected List<FieldMapping> |
buildFieldMappingList(String tableNameOrAlias,
boolean autoAlias,
String... columns)
构建字段映射列表 - 用于oneToOne和manyToMany
|
protected List<FieldMapping> |
buildFieldMappingList(String tableNameOrAlias,
String... columns)
构建字段映射列表 - 用于oneToOne和manyToMany
|
protected void |
buildJoinSql(String joinTable,
String joinTableField,
String masterTableField,
String alias,
SqlExcerpt joinType,
boolean isLogicDelete)
构建Join SQL - 带表名和别名
|
protected void |
buildJoinSql(String joinTable,
String joinTableField,
String masterTableField,
String alias,
SqlExcerpt joinType,
java.util.function.Consumer<Children> consumer,
boolean isLogicDelete)
构建Join SQL - 带表名、别名和回调函数
|
Children |
changeQueryWrapper(String alias,
com.baomidou.mybatisplus.core.conditions.AbstractWrapper queryWrapper)
转换查询Wrapper
|
protected String |
checkAndHandleColumn(String column)
检查并处理字段名
如果字段名不包含点号,则自动添加主表别名前缀
|
protected String |
columnToString(String column) |
Children |
distinct()
添加Distinct
|
String |
getAlias()
获取别名
|
protected String |
getAliasAndField(String alias,
String field)
获取别名和字段的组合
|
String |
getConditionR(Class<?> entityClass,
Field field)
只为避开类型检查
|
protected com.baomidou.mybatisplus.core.metadata.TableFieldInfo |
getTableFieldInfoByColumn(String fieldName,
Class<?> clazz)
根据字段名获取TableFieldInfo
|
protected com.baomidou.mybatisplus.core.metadata.TableFieldInfo |
getTableFieldInfoByColumn(String fieldName,
String tableName)
根据字段名获取TableFieldInfo
|
protected com.baomidou.mybatisplus.core.metadata.TableFieldInfo |
getTableFieldInfoByFieldName(String fieldName,
Class<?> clazz)
根据字段名获取TableFieldInfo
|
protected String |
handleColumnPrefix(String alias,
String column)
处理字段前缀
如果字段没有包含点号"."
|
protected void |
handleSelectPrefix(String alias,
Children children)
处理查询字段前缀
处理子查询中的select字段,为没有前缀的字段添加表别名前缀
|
protected void |
initNeed() |
Children |
joinAnd(boolean condition,
String alias,
java.util.function.Consumer<Children> consumer)
JOIN AND 通用实现
|
Children |
joinAnd(boolean condition,
String alias,
String field,
Object val,
java.util.function.BiConsumer<String,Object> consumer)
Join AND 条件
|
Children |
notDefaultSelectAll()
不默认查询全部
|
Children |
orderBySql(boolean condition,
String sql)
手写SQL排序
|
Children |
selectAll()
查询所有字段
|
void |
setAlias(String alias)
设置别名
|
protected void |
setFieldMappingList(String fieldName,
String columns) |
protected void |
setFieldMappingList(String fieldName,
String columns,
Class<?> clz)
设置字段映射,带有类参数
|
addObjConditions, addObjConditions, executeQuery, getEntityOrMasterClass, getFuncKeyWord, getJoinSql, getTableClass, getTableFieldInfoByFieldName, masterLogicDelete, readWrapperInfo, setFuncKeyWordaddCondition, addNestedCondition, allEq, allEq, and, and, appendSqlSegments, apply, between, clear, clone, columnSqlInjectFilter, columnsToString, columnsToString, columnToSqlSegment, comment, eq, exists, first, formatParam, formatSqlMaybeWithParam, func, ge, geSql, getEntity, getEntityClass, getExpression, getParamAlias, getParamNameValuePairs, getSqlComment, getSqlFirst, getSqlSegment, groupBy, groupBy, groupBy, gt, gtSql, having, in, in, inExpression, inExpression, inSql, instance, isNotNull, isNull, isUseAnnotationOrderBy, last, le, leSql, like, likeLeft, likeRight, likeValue, lt, ltSql, maybeDo, ne, nested, not, not, notBetween, notExists, notIn, notIn, notInSql, notLike, notLikeLeft, notLikeRight, or, or, orderBy, orderBy, orderBy, setEntity, setEntityClass, setParamAliasgetCustomSqlSegment, getSqlSelect, getSqlSet, getTargetSql, isEmptyOfEntity, isEmptyOfNormal, isEmptyOfWhere, nonEmptyOfEntity, nonEmptyOfNormal, nonEmptyOfWhereequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitjoinAndinnerJoin, innerJoin, innerJoin, innerJoin, join, leftJoin, leftJoin, leftJoin, leftJoin, rightJoin, rightJoin, rightJoin, rightJoinbetweenIfNull, eqIfNull, geIfNull, gtIfNull, leIfNull, likeIfNull, likeLeftIfNull, likeRightIfNull, ltIfNull, neIfNull, notBetweenIfNull, notLikeIfNull, notLikeLeftIfNull, notLikeRightIfNullallEq, 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, notLike, notLikeLeft, notLikeLeft, notLikeRight, notLikeRightapply, comment, exists, first, last, notExists, orfunc, geSql, groupBy, groupBy, groupBy, gtSql, having, in, in, inSql, isNotNull, isNull, leSql, ltSql, notIn, notIn, notInSql, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByAsc, orderByDesc, orderByDesc, orderByDesc, orderByDesc, orderByDesc, orderByDescprotected Map<String,com.baomidou.mybatisplus.core.conditions.SharedString> joinSqlMapping
protected void initNeed()
initNeed 在类中 SupportJoinWrapper<T,String,Children extends SupportJoinStrQueryWrapper<T,Children>>public Children selectAll()
public String getAlias()
public void setAlias(String alias)
protected com.baomidou.mybatisplus.core.metadata.TableFieldInfo getTableFieldInfoByFieldName(String fieldName, Class<?> clazz)
getTableFieldInfoByFieldName 在类中 SupportJoinWrapper<T,String,Children extends SupportJoinStrQueryWrapper<T,Children>>protected com.baomidou.mybatisplus.core.metadata.TableFieldInfo getTableFieldInfoByColumn(String fieldName, Class<?> clazz)
protected com.baomidou.mybatisplus.core.metadata.TableFieldInfo getTableFieldInfoByColumn(String fieldName, String tableName)
protected String getAliasAndField(String alias, String field)
getAliasAndField 在类中 SupportJoinWrapper<T,String,Children extends SupportJoinStrQueryWrapper<T,Children>>field - 字段public Children changeQueryWrapper(String alias, com.baomidou.mybatisplus.core.conditions.AbstractWrapper queryWrapper)
protected void buildJoinSql(String joinTable, String joinTableField, String masterTableField, String alias, SqlExcerpt joinType, boolean isLogicDelete)
protected String handleColumnPrefix(String alias, String column)
alias - 表别名column - 字段名protected String checkAndHandleColumn(String column)
column - 字段名protected void handleSelectPrefix(String alias, Children children)
alias - 表别名children - 子查询protected void buildJoinSql(String joinTable, String joinTableField, String masterTableField, String alias, SqlExcerpt joinType, java.util.function.Consumer<Children> consumer, boolean isLogicDelete)
public Children joinAnd(boolean condition, String alias, String field, Object val, java.util.function.BiConsumer<String,Object> consumer)
public Children joinAnd(boolean condition, String alias, java.util.function.Consumer<Children> consumer)
joinAnd 在接口中 JoinStrCompareFunc<Children extends SupportJoinStrQueryWrapper<T,Children>>condition - 执行条件alias - 别名consumer - 条件public Children distinct()
distinct 在类中 SupportJoinWrapper<T,String,Children extends SupportJoinStrQueryWrapper<T,Children>>public Children notDefaultSelectAll()
public String getConditionR(Class<?> entityClass, Field field)
SupportJoinWrappergetConditionR 在类中 SupportJoinWrapper<T,String,Children extends SupportJoinStrQueryWrapper<T,Children>>protected void setFieldMappingList(String fieldName, String columns)
setFieldMappingList 在类中 SupportJoinWrapper<T,String,Children extends SupportJoinStrQueryWrapper<T,Children>>protected void setFieldMappingList(String fieldName, String columns, Class<?> clz)
fieldName - 字段名columns - 列名clz - 类protected List<FieldMapping> buildFieldMappingList(String tableNameOrAlias, String... columns)
tableNameOrAlias - 表名或别名columns - 字段列表protected List<FieldMapping> buildFieldMappingList(String tableNameOrAlias, boolean autoAlias, String... columns)
tableNameOrAlias - 表名或别名autoAlias - 是否自动生成别名columns - 字段列表protected void addSelectByFieldMappings(List<FieldMapping> fieldMappings)
fieldMappings - 字段映射列表Copyright © 2025. All rights reserved.