houzhongjian
2025-03-12 6077089c5f6ced73cf46a0abdca2c6d77a3b3878
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