浏览代码

fix 修改没数据时row为null

Administrator 4 年之前
父节点
当前提交
38ab1d19f4
共有 1 个文件被更改,包括 8 次插入2 次删除
  1. 8 2
      boman-web-core/src/main/java/com/boman/web/core/mapper/StandardlyMapper.java

+ 8 - 2
boman-web-core/src/main/java/com/boman/web/core/mapper/StandardlyMapper.java

@@ -608,8 +608,14 @@ public interface StandardlyMapper {
             wholeSql.append(" from ").append(tableName);
             // 条件
             packCondition(packCondition, wholeSql);
-
-            wholeSql.append(" order by ").append(orderBy).append(" limit ").append(limit);
+            if (StringUtils.isNotBlank(orderBy)){
+                String[] s = orderBy.split(" ");
+                if (s.length > 2){
+                    wholeSql.append(" order by ").append(s[0]).append(" ").append(s[1]).append(" limit ").append(limit);
+                }else {
+                    wholeSql.append(" order by ").append(orderBy).append(" limit ").append(limit);
+                }
+            }
             if (isNotEmpty(offset)) {
                 wholeSql.append(", ").append(offset);
             }