瀏覽代碼

大小写转换

chenw 6 年之前
父節點
當前提交
d4b9788b09

+ 5 - 5
bi-server/src/main/java/com/usoftchina/bi/server/service/chart/ShowPopulationService.java

@@ -119,15 +119,15 @@ public class ShowPopulationService {
                 List<String> operatorOther = new ArrayList<>();
                 String next = null;
                 while (operatorsList.hasNext()){
-                    next = operatorsList.next().toLowerCase();
+                    next = operatorsList.next();
                     //计算25th,75th,和百分比
-                    if (next.toUpperCase() == "PERCENT" || "PERCENT".equals(next.toUpperCase())){
-                        String op = "count(" + columnName + ")/(select count(1) from " + tableName + ") "+ next;
+                    if ("PERCENT".equalsIgnoreCase(next)){
+                        String op = "count(" + columnName + ")/(select count(1) from " + tableName + ") \""+ next + "\"";
                         operatorColumn.add(op);
-                    }else if ("25th".equals(next) || "75th".equals(next)){
+                    }else if ("25th".equalsIgnoreCase(next) || "75th".equalsIgnoreCase(next)){
                         operatorOther.add(next);
                     }else {
-                        String op = next + "(" + columnName + ") as " + next.toLowerCase();
+                        String op = next + "(" + columnName + ") as \"" + next + "\"";
                         operatorColumn.add(op);
                     }
                 }