|
@@ -2,17 +2,16 @@ package com.example.sqlrun;
|
|
|
|
|
|
import com.example.sqlrun.fixSql.MakePartitionSql;
|
|
|
import com.example.sqlrun.fixSql.MakeTableSpace;
|
|
|
+import java.sql.SQLException;
|
|
|
+import java.sql.Statement;
|
|
|
import java.text.ParseException;
|
|
|
-import java.time.YearMonth;
|
|
|
+import java.util.Calendar;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
-import org.springframework.stereotype.Component;
|
|
|
-
|
|
|
import javax.annotation.PostConstruct;
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.sql.SQLException;
|
|
|
-import java.sql.Statement;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
|
|
|
@Component
|
|
|
public class test {
|
|
@@ -34,13 +33,15 @@ public class test {
|
|
|
"GHJG_DYANMIC.GPSINFO_HISTORY", "GPSINFO_HISTORY", null, 10, 50, 100, "202312", 10);
|
|
|
for (Map map : gpsinfo_history) {
|
|
|
Date date = (Date) map.get("date");
|
|
|
+ Calendar instance = Calendar.getInstance();
|
|
|
+ instance.setTime(date);
|
|
|
List<String> strings =
|
|
|
MakePartitionSql.makePartitionSql(
|
|
|
"GHJG_DYANMIC.GPSINFO_HISTORY",
|
|
|
"GPSINFO_HISTORY",
|
|
|
map.get("tableSpaceName").toString(),
|
|
|
date,
|
|
|
- YearMonth.of(date.getYear() + 1900,date.getMonth() + 1).lengthOfMonth()
|
|
|
+ instance.getActualMaximum(Calendar.DAY_OF_MONTH) - instance.get(Calendar.DAY_OF_MONTH) + 1
|
|
|
);
|
|
|
System.out.println(map.get("tableSpaceSql"));
|
|
|
for (String string : strings) {
|