From 6077089c5f6ced73cf46a0abdca2c6d77a3b3878 Mon Sep 17 00:00:00 2001
From: houzhongjian <houzhongyi@126.com>
Date: 星期三, 12 三月 2025 14:53:32 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/collection/utils/IndSqlUtils.java |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/collection/utils/IndSqlUtils.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/collection/utils/IndSqlUtils.java
index 8be3943..127c42e 100644
--- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/collection/utils/IndSqlUtils.java
+++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/collection/utils/IndSqlUtils.java
@@ -167,7 +167,7 @@
                 whereSql.append(indItem.getTimeLabel());
                 whereSql.append("' < '");
                 whereSql.append(DateUtils.format(calendar.getTime(), PATTERN_MON));
-                whereSql.append("' AND '");
+                whereSql.append("' AND ");
                 whereSql.append(indItem.getTimeLabel());
                 whereSql.append(" >= '");
                 calendar.add(Calendar.MONTH, -1);
@@ -178,7 +178,7 @@
                 whereSql.append(indItem.getTimeLabel());
                 whereSql.append(" <= '");
                 whereSql.append(DateUtils.format(calendar.getTime(), PATTERN_MON));
-                whereSql.append("' AND '");
+                whereSql.append("' AND ");
                 whereSql.append(indItem.getTimeLabel());
                 whereSql.append("' >= '");
                 calendar.add(Calendar.MONTH, -12);
@@ -208,6 +208,17 @@
                 whereSql.append(indItem.getTimeLabel());
                 whereSql.append("='");
                 whereSql.append(DateUtils.format(calendar.getTime(), PATTERN_YEAR));
+                whereSql.append("'");
+                break;
+            case LAST_HOUR_24:
+                whereSql.append(indItem.getTimeLabel());
+                whereSql.append(" <= '");
+                whereSql.append(DateUtils.format(calendar.getTime(), DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND));
+                whereSql.append("' AND ");
+                whereSql.append(indItem.getTimeLabel());
+                whereSql.append(" >= '");
+                calendar.add(Calendar.HOUR_OF_DAY, -24);
+                whereSql.append(DateUtils.format(calendar.getTime(), DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND));
                 whereSql.append("'");
                 break;
             case CUSTOM:
@@ -262,10 +273,10 @@
             selectSql.append(result.getSelectSql());
         } else {
             selectSql.append(result.getSelectSql());
-            selectSql.append(", ");
-            selectSql.append(indItem.getTimeLabel());
-            selectSql.append(" data_time");
         }
+        selectSql.append(", ");
+        selectSql.append(indItem.getTimeLabel());
+        selectSql.append(" data_time");
         result.setSelectSql(selectSql.toString());
 
         // 拼接WHERE

--
Gitblit v1.9.3