mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-18 17:38:48 +08:00
1.剔除转换器修改
2.groupBy直接调用MPJ自动解析
This commit is contained in:
parent
768a0d9801
commit
9ed4cf1bfc
@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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())
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user