Hi all,
I have three materialized views in my project
MV_MSG_EXC_REC_HISTORY : Summarizes message data for the past two years up to the beginning of the current year.
MV_MSG_EXC_REC_RECENT : Summarizes message data from the beginning of the current year up to the current day.
MV_MSG_EXC_REC_CURRENT_DAY : Summarizes messages for the current day, grouping by minute-level timestamps and updating based on the nearest half-hour.
From the ui of the application I have two criteria, let it be "From" and "To"
I want when user adds these criteria to translate it to
Java in a Map<
String, Pair<LocalDateTime, LocalDateTime>> which contains the name of the MV, the start_date and end_date in order to construct queries like below :
eg.
I want to have 4 cases :
1. Both dates are filled then -> where min_date >= start_date and min_date <= end_date
2. Left date is null then -> where min_date <= end_date
3. Right date is null then -> where min_date >= start_date
4. Both dates null then -> no where clause
Examples :
Supposing I have the below ranges for all the cases
MV_MSG_EXC_REC_HISTORY: 2022-01-01T00:00 - 2023-12-31T23:59:59.999
MV_MSG_EXC_REC_RECENT: 2024-01-01T00:00 - 2024-11-04T23:59:59.999
MV_MSG_EXC_REC_CURRENT_DAY: 2024-11-05T00:00 - 2024-11-05T07:30:00
====================
Case 1
And user selects the below from UI
From: 2023-01-01T00:00:03
To: 2024-10-10T03:56:04.235
I want to make a Map<String, Pair<LocalDateTime, LocalDateTime>> like
(the left date should be floored in minute level and the right date to be ceiled to next minute)
Case 2
And user selects the below from UI
From: 2023-01-01T00:00:03
To: 2024-12-31T03:56:04.235 (larger than current_date)
====================
Case 3
I have the below ranges
MV_MSG_EXC_REC_HISTORY: 2022-01-01T00:00 - 2023-12-31T23:59:59.999
MV_MSG_EXC_REC_RECENT: 2024-01-01T00:00 - 2024-11-04T23:59:59.999
MV_MSG_EXC_REC_CURRENT_DAY: 2024-11-05T00:00 - 2024-11-05T07:30:00
====================
And user selects the below from UI
From: 2023-01-01T00:00:03
To: 2024-11-03T03:56:04.235 (smaller than current_date)
====================
My code is below :
can you help me please to do the getMvNames to works as expected ?
as now it works with MV ranges
Thanks a lot