1、controller join表排序问题修复

2、优化插件逻辑
This commit is contained in:
ruying408
2024-07-19 05:42:01 +08:00
parent 81e88bee37
commit cdec3d18f1

View File

@@ -107,14 +107,14 @@ public class CrudOption<T> {
if (ObjectUtil.isNotEmpty(queryTables)) {
// 取主表作为排序字段别名
QueryTable queryTable = queryTables.get(0);
tableAlias = "`" + queryTable.getName() + "`.`";
tableAlias = "`" + queryTable.getName() + "`.";
}
String order = requestParams.getStr("order",
tableAnnotation.camelToUnderline() ? "create_time" : "createTime");
String sort = requestParams.getStr("sort", "desc");
if (StrUtil.isNotEmpty(order) && StrUtil.isNotEmpty(sort)) {
queryWrapper.orderBy(
tableAlias + (tableAnnotation.camelToUnderline() ? StrUtil.toUnderlineCase(order) : order) + "`",
tableAlias + "`" + (tableAnnotation.camelToUnderline() ? StrUtil.toUnderlineCase(order) : order) + "`",
sort.equals("asc"));
}
}