fix: 优化排序逻辑

This commit is contained in:
tangwei 2026-07-21 10:25:43 +08:00
parent 8a6c319933
commit ac1498b4b2

View File

@ -85,7 +85,7 @@ public class MsThreedRoamMServiceImpl extends ServiceImpl<MsThreedRoamMMapper, M
private String buildThreedRoamMQgcOrderBySql(List<DataSourceRequest.SortDescriptor> sorts) { private String buildThreedRoamMQgcOrderBySql(List<DataSourceRequest.SortDescriptor> sorts) {
if (CollUtil.isEmpty(sorts)) { if (CollUtil.isEmpty(sorts)) {
return " ORDER BY r.tm DESC NULLS LAST, r.stcd ASC, r.name ASC"; return " ORDER BY a.CODE ASC";
} }
List<String> orderByParts = new ArrayList<>(); List<String> orderByParts = new ArrayList<>();
for (DataSourceRequest.SortDescriptor sort : sorts) { for (DataSourceRequest.SortDescriptor sort : sorts) {
@ -100,7 +100,7 @@ public class MsThreedRoamMServiceImpl extends ServiceImpl<MsThreedRoamMMapper, M
orderByParts.add(column + " " + direction + " NULLS LAST"); orderByParts.add(column + " " + direction + " NULLS LAST");
} }
if (orderByParts.isEmpty()) { if (orderByParts.isEmpty()) {
return " ORDER BY r.tm DESC NULLS LAST, r.stcd ASC, r.name ASC"; return " ORDER BY a.CODE ASC";
} }
return " ORDER BY " + String.join(", ", orderByParts); return " ORDER BY " + String.join(", ", orderByParts);
} }
@ -167,6 +167,7 @@ public class MsThreedRoamMServiceImpl extends ServiceImpl<MsThreedRoamMMapper, M
case "rvcd" -> "a.RVCD"; case "rvcd" -> "a.RVCD";
case "remark" -> "a.REMARK"; case "remark" -> "a.REMARK";
case "modifyTime" -> "a.MODIFY_TIME"; case "modifyTime" -> "a.MODIFY_TIME";
case "recordTime" -> "a.RECORD_TIME";
default -> null; default -> null;
}; };
} }