public static String addDateTime(String dateStr, LocalDateTime dateTime,
            IntervalInfo intervalInfo, boolean isPositive) {
        int factor = intervalInfo.getFactor();
        Map<ChronoField, Long> valueMap = intervalInfo.getChronoMap();

        int sign = isPositive ? 1 : -1;

        boolean hasTime = dateStr.indexOf(' ') != -1;
        boolean hasMicroSecond = dateStr.indexOf('.') != -1;

        for (ChronoField field : valueMap.keySet()) {
            long amount = valueMap.get(field) * factor * sign;
            switch (field) {
                case MICRO_OF_SECOND:
                    hasTime = true;
                    hasMicroSecond = true;
                    dateTime = dateTime.plusNanos(amount * 1000L);
                    break;
                case SECOND_OF_MINUTE:
                    hasTime = true;
                    dateTime = dateTime.plusSeconds(amount);
                    break;
                case MINUTE_OF_HOUR:
                    hasTime = true;
                    dateTime = dateTime.plusMinutes(amount);
                    break;
                case HOUR_OF_DAY:
                    hasTime = true;
                    dateTime = dateTime.plusHours(amount);
                    break;
                case DAY_OF_MONTH:
                    dateTime = dateTime.plusDays(amount);
                    break;
                case MONTH_OF_YEAR:
                    dateTime = dateTime.plusMonths(amount);
                    break;
                case YEAR:
                    dateTime = dateTime.plusYears(amount);
                    break;
                default:
                    return null;
            }
        }
        if (hasTime) {
            if (hasMicroSecond) {
                return dateTime.format(DATE_TIME_FORMATTER_MAP.get(YEAR_TO_MICRO));
            } else {
                return dateTime.format(DATE_TIME_FORMATTER_MAP.get(YEAR_TO_SECOND));
            }
        }
        return dateTime.toLocalDate().toString();
    }
@param dateStr The first time string
@param dateTime It is obtained by parsing dateStr
@param intervalInfo addend
@param isPositive   True is positive, false is negative
@return
inlong-sdk/transform-sdk/src/main/java/org/apache/inlong/sdk/transform/process/utils/DateUtil.java