修复综合浏览查询结果列表中自定义表头排序配置失效的bug

master
xiong_cl 8 months ago
parent c82233b25a
commit dbd03a4fb0
  1. 2
      shandan-browser/src/main/java/com/keyware/shandan/browser/service/MetadataSearchService.java

@ -119,7 +119,7 @@ public class MetadataSearchService {
if (field != null) { if (field != null) {
TableField tableField = field.getAnnotation(TableField.class); TableField tableField = field.getAnnotation(TableField.class);
if (tableField != null && StringUtils.hasText(tableField.value())) { if (tableField != null && StringUtils.hasText(tableField.value())) {
//没有过滤条件时,order by前面会拼接and,导致查询报错 //没有过滤条件时,order by前面会拼接and,导致查询报错 update by xiongcl 2024/04/10
if(condition.getConditions().size()<=0){ if(condition.getConditions().size()<=0){
queryWrapper.last("1=1 ORDER BY "+ tableField.value() + (sort.getSort().equalsIgnoreCase("asc") ? " ASC " :" DESC ")); queryWrapper.last("1=1 ORDER BY "+ tableField.value() + (sort.getSort().equalsIgnoreCase("asc") ? " ASC " :" DESC "));
}else { }else {