1.剔除转换器修改

2.groupBy直接调用MPJ自动解析
This commit is contained in:
Du YinHong 2026-08-24 14:56:56 +08:00
parent 768a0d9801
commit 9ed4cf1bfc
2 changed files with 8 additions and 11 deletions

View File

@ -75,16 +75,13 @@ public final class LambdaJoinQueryBuilder<T> {
return this; return this;
} }
for (SFunction<E, ?> column : columns) { for (SFunction<E, ?> column : columns) {
// 无别名时解析字段所属实体表名作为默认前缀避免同名列歧义 if (StringUtils.isNotBlank(alias)) {
String effectiveAlias = alias; // 使用 MPJ 的别名重载
if (StringUtils.isBlank(effectiveAlias)) { wrapper.groupBy(alias, column);
Class<?> entityClass = LambdaUtils.getEntityClass(column); } else {
TableInfo tableInfo = TableInfoHelper.getTableInfo(entityClass); // 无别名交给 MPJ 自动解析
if (tableInfo != null) { wrapper.groupBy(column);
effectiveAlias = tableInfo.getTableName();
}
} }
wrapper.groupBy(qualifiedColumn(effectiveAlias, column));
} }
return this; return this;
} }

View File

@ -34,7 +34,7 @@ public class DictTypeTranslationImpl implements TranslationInterface<String> {
*/ */
@Override @Override
public String translation(Object key, String other) { public String translation(Object key, String other) {
if (Convert.toStr(key) instanceof String dictValue && StringUtils.isNotBlank(other)) { if (key instanceof String dictValue && StringUtils.isNotBlank(other)) {
return dictService.getDictLabel(other, dictValue); return dictService.getDictLabel(other, dictValue);
} }
return null; return null;
@ -55,7 +55,7 @@ public class DictTypeTranslationImpl implements TranslationInterface<String> {
Map<String, String> dictMap = dictService.getAllDictByDictType(other); Map<String, String> dictMap = dictService.getAllDictByDictType(other);
Map<Object, String> result = new LinkedHashMap<>(keys.size()); Map<Object, String> result = new LinkedHashMap<>(keys.size());
for (Object key : keys) { for (Object key : keys) {
if (Convert.toStr(key) instanceof String dictValue) { if (key instanceof String dictValue) {
result.put(key, StreamUtils.join( result.put(key, StreamUtils.join(
StreamUtils.filter(Arrays.asList(dictValue.split(",")), StringUtils::isNotBlank), StreamUtils.filter(Arrays.asList(dictValue.split(",")), StringUtils::isNotBlank),
value -> dictMap.get(value.trim()) value -> dictMap.get(value.trim())