Procházet zdrojové kódy

table partition add

HANTE před 1 měsícem
rodič
revize
5bb7ca9fa8
15 změnil soubory, kde provedl 822 přidání a 0 odebrání
  1. 1 0
      conf/utic-stat-server.pid
  2. 13 0
      utic-stat-server/src/main/java/com/utic/center/utic/stat/server/UticStatServerApplication.java
  3. 2 0
      utic-stat-server/src/main/java/com/utic/center/utic/stat/server/controller/UticStatServerController.java
  4. 29 0
      utic-stat-server/src/main/java/com/utic/center/utic/stat/server/dao/mapper/UticStatTableManagerMapper.java
  5. 78 0
      utic-stat-server/src/main/java/com/utic/center/utic/stat/server/dao/repository/UticStatTableManagerRepository.java
  6. 17 0
      utic-stat-server/src/main/java/com/utic/center/utic/stat/server/dto/PatnTableDto.java
  7. 16 0
      utic-stat-server/src/main/java/com/utic/center/utic/stat/server/dto/TableExistDto.java
  8. 74 0
      utic-stat-server/src/main/java/com/utic/center/utic/stat/server/service/UticStatTableManagerService.java
  9. 59 0
      utic-stat-server/src/main/java/com/utic/center/utic/stat/server/service/partition/LinkFilterLog.java
  10. 23 0
      utic-stat-server/src/main/java/com/utic/center/utic/stat/server/service/partition/MakeTablePartition.java
  11. 87 0
      utic-stat-server/src/main/java/com/utic/center/utic/stat/server/service/partition/PatternHist.java
  12. 61 0
      utic-stat-server/src/main/java/com/utic/center/utic/stat/server/service/partition/RcvLinkTraffic.java
  13. 54 0
      utic-stat-server/src/main/java/com/utic/center/utic/stat/server/service/partition/StatLocalLog.java
  14. 63 0
      utic-stat-server/src/main/java/com/utic/center/utic/stat/server/service/partition/TrafficCenterHist.java
  15. 245 0
      utic-stat-server/src/main/resources/mybatis/mapper/UticStatTableManagerMapper.xml

+ 1 - 0
conf/utic-stat-server.pid

@@ -0,0 +1 @@
+13432

+ 13 - 0
utic-stat-server/src/main/java/com/utic/center/utic/stat/server/UticStatServerApplication.java

@@ -5,6 +5,7 @@ import com.utic.center.common.utils.ApplicationUtils;
 import com.utic.center.utic.stat.server.config.ApplicationConfig;
 import com.utic.center.utic.stat.server.service.ProcessStateService;
 import com.utic.center.utic.stat.server.service.UticStatPrepareService;
+import com.utic.center.utic.stat.server.service.UticStatTableManagerService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.DisposableBean;
 import org.springframework.beans.factory.InitializingBean;
@@ -69,6 +70,18 @@ public class UticStatServerApplication implements CommandLineRunner, Application
         ApplicationConfig applicationConfig = SpringUtils.getBean(ApplicationConfig.class);
         applicationConfig.setStartSchedule(false);
 
+        UticStatTableManagerService tableManagerService = SpringUtils.getBean(UticStatTableManagerService.class);
+        if (!tableManagerService.createCurrentPartitionTable()) {
+            log.error("tableManagerService.makeCurrentPartitionTable: Failed. program shutdown.");
+            SpringApplication.exit(SpringUtils.getApplicationContext());
+            System.exit(0);
+        }
+        if (!tableManagerService.processing()) {
+            log.error("tableManagerService.processing: Failed. program shutdown.");
+            SpringApplication.exit(SpringUtils.getApplicationContext());
+            System.exit(0);
+        }
+
         // 프로세스 상태 저장
         ProcessStateService processStateService = SpringUtils.getBean(ProcessStateService.class);
         processStateService.processStart();

+ 2 - 0
utic-stat-server/src/main/java/com/utic/center/utic/stat/server/controller/UticStatServerController.java

@@ -22,6 +22,7 @@ public class UticStatServerController {
     private final UticStat05MinStatService stat05MinService;
     private final UticStat15MinStatService stat15MinService;
     private final UticStatPatternService patternService;
+    private final UticStatTableManagerService tableManagerService;
 
     private long etlpElapsed = 0;
     private String prevPrcsTime = "";
@@ -156,6 +157,7 @@ public class UticStatServerController {
 
             }
             if (this.isDay) {
+                this.tableManagerService.processing();
                 // 7. 월 통계작업 실행(연계하지 않음, 2025-09-08)
 //                tmpStart = System.currentTimeMillis();
 //                this.stat01MonthService.processing();

+ 29 - 0
utic-stat-server/src/main/java/com/utic/center/utic/stat/server/dao/mapper/UticStatTableManagerMapper.java

@@ -0,0 +1,29 @@
+package com.utic.center.utic.stat.server.dao.mapper;
+
+import com.utic.center.utic.stat.server.dto.TableExistDto;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+@Mapper
+public interface UticStatTableManagerMapper {
+
+    TableExistDto findTableExist(@Param("tableName") String tableName);
+    int dropTable(@Param("tableName") String tableName);
+    int addTableComment(@Param("tableName") String tableName, @Param("tableComment") String tableComment);
+    int addColumnComment(@Param("tableName") String tableName, @Param("columnName") String columnName, @Param("columnComment") String columnComment);
+
+    int createTrafficCenterHistTable(@Param("crtMonth") String crtMonth);
+    int addTrafficCenterHistPrimaryKey(@Param("crtMonth") String crtMonth);
+
+    int createRcvLinkTrafficTable(@Param("crtMonth") String crtMonth);
+    int addRcvLinkTrafficPrimaryKey(@Param("crtMonth") String crtMonth);
+
+    int createPatnHistTable(@Param("tableName") String tableName, @Param("dataSpace") String dataSpace);
+    int addPatnHistPrimaryKey(@Param("tableName") String tableName, @Param("indexSpace") String indexSpace);
+
+    int createStatLocalLogTable(@Param("crtMonth") String crtMonth);
+    int addStatLocalLogPrimaryKey(@Param("crtMonth") String crtMonth);
+
+    int createLinkFilterLogTable(@Param("crtMonth") String crtMonth);
+    int addLinkFilterLogPrimaryKey(@Param("crtMonth") String crtMonth);
+}

+ 78 - 0
utic-stat-server/src/main/java/com/utic/center/utic/stat/server/dao/repository/UticStatTableManagerRepository.java

@@ -0,0 +1,78 @@
+package com.utic.center.utic.stat.server.dao.repository;
+
+import com.utic.center.common.annotation.SqlOperation;
+import com.utic.center.utic.stat.server.dao.mapper.UticStatTableManagerMapper;
+import com.utic.center.utic.stat.server.dto.TableExistDto;
+import lombok.RequiredArgsConstructor;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+@Repository
+@RequiredArgsConstructor
+public class UticStatTableManagerRepository {
+
+    private final UticStatTableManagerMapper mapper;
+
+    @SqlOperation(type = SqlOperation.SqlType.SELECT, table = "USER_TABLES", param = "tableName")
+    public TableExistDto findTableExist(@Param("tableName") String tableName) {
+        return this.mapper.findTableExist(tableName);
+    }
+    @SqlOperation(type = SqlOperation.SqlType.UPDATE, table = "DROP TABLE", param = "tableName")
+    public int dropTable(String tableName) {
+        return this.mapper.dropTable(tableName);
+    }
+    @SqlOperation(type = SqlOperation.SqlType.UPDATE, table = "TABLE COMMENT", param = "tableName", param2 = "tableComment")
+    public int addTableComment(String tableName, String tableComment) {
+        return this.mapper.addTableComment(tableName, tableComment);
+    }
+    @SqlOperation(type = SqlOperation.SqlType.UPDATE, table = "COLUMN COMMENT", param = "tableName", param2 = "columnName")
+    public int addColumnComment(String tableName, String columnName, String columnComment) {
+        return this.mapper.addColumnComment(tableName, columnName, columnComment);
+    }
+
+    @SqlOperation(type = SqlOperation.SqlType.UPDATE, table = "TRAFFIC_CENTER_HIST_", param = "crtMonth", param2 = "create table")
+    public int createTrafficCenterHistTable(String crtMonth) {
+        return this.mapper.createTrafficCenterHistTable(crtMonth);
+    }
+    @SqlOperation(type = SqlOperation.SqlType.UPDATE, table = "TRAFFIC_CENTER_HIST_", param = "crtMonth", param2 = "add constraints")
+    public int addTrafficCenterHistPrimaryKey(String crtMonth) {
+        return this.mapper.addTrafficCenterHistPrimaryKey(crtMonth);
+    }
+
+    @SqlOperation(type = SqlOperation.SqlType.UPDATE, table = "RCV_LINK_TRAFFIC_", param = "crtMonth", param2 = "create table")
+    public int createRcvLinkTrafficTable(String crtMonth) {
+        return this.mapper.createRcvLinkTrafficTable(crtMonth);
+    }
+    @SqlOperation(type = SqlOperation.SqlType.UPDATE, table = "RCV_LINK_TRAFFIC_", param = "crtMonth", param2 = "add constraints")
+    public int addRcvLinkTrafficCenterPrimaryKey(String crtMonth) {
+        return this.mapper.addRcvLinkTrafficPrimaryKey(crtMonth);
+    }
+
+    @SqlOperation(type = SqlOperation.SqlType.UPDATE, table = "PATN_HIST", param = "tableName", param2 = "dataSpace")
+    public int createPatnHistTable(String tableName, String dataSpace) {
+        return this.mapper.createPatnHistTable(tableName, dataSpace);
+    }
+    @SqlOperation(type = SqlOperation.SqlType.UPDATE, table = "PATN_HIST", param = "tableName", param2 = "indexSpace")
+    public int addPatnHistPrimaryKey(String tableName, String indexSpace) {
+        return this.mapper.addPatnHistPrimaryKey(tableName, indexSpace);
+    }
+
+    @SqlOperation(type = SqlOperation.SqlType.UPDATE, table = "STAT_LOCAL_LOG_", param = "crtMonth", param2 = "create table")
+    public int createStatLocalLogTable(@Param("crtMonth") String crtMonth) {
+        return this.mapper.createStatLocalLogTable(crtMonth);
+    }
+    @SqlOperation(type = SqlOperation.SqlType.UPDATE, table = "STAT_LOCAL_LOG_", param = "crtMonth", param2 = "add constraints")
+    public int addStatLocalLogPrimaryKey(@Param("crtMonth") String crtMonth) {
+        return this.mapper.addStatLocalLogPrimaryKey(crtMonth);
+    }
+
+    @SqlOperation(type = SqlOperation.SqlType.UPDATE, table = "LINK_FILTER_LOG_", param = "crtMonth", param2 = "create table")
+    public int createLinkFilterLogTable(@Param("crtMonth") String crtMonth) {
+        return this.mapper.createLinkFilterLogTable(crtMonth);
+    }
+    @SqlOperation(type = SqlOperation.SqlType.UPDATE, table = "LINK_FILTER_LOG_", param = "crtMonth", param2 = "add constraints")
+    public int addLinkFilterLogPrimaryKey(@Param("crtMonth") String crtMonth) {
+        return this.mapper.addLinkFilterLogPrimaryKey(crtMonth);
+    }
+
+}

+ 17 - 0
utic-stat-server/src/main/java/com/utic/center/utic/stat/server/dto/PatnTableDto.java

@@ -0,0 +1,17 @@
+package com.utic.center.utic.stat.server.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class PatnTableDto {
+
+    private String table;
+    private String desc;
+
+}

+ 16 - 0
utic-stat-server/src/main/java/com/utic/center/utic/stat/server/dto/TableExistDto.java

@@ -0,0 +1,16 @@
+package com.utic.center.utic.stat.server.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class TableExistDto {
+
+    private Integer tableExist;
+
+}

+ 74 - 0
utic-stat-server/src/main/java/com/utic/center/utic/stat/server/service/UticStatTableManagerService.java

@@ -0,0 +1,74 @@
+package com.utic.center.utic.stat.server.service;
+
+import com.utic.center.common.annotation.ProcessingElapsed;
+import com.utic.center.common.service.AbstractProcessService;
+import com.utic.center.utic.stat.server.dao.repository.UticStatTableManagerRepository;
+import com.utic.center.utic.stat.server.service.partition.*;
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import java.time.YearMonth;
+import java.time.format.DateTimeFormatter;
+
+@Slf4j
+@Getter
+@RequiredArgsConstructor
+@Service
+public class UticStatTableManagerService implements AbstractProcessService {
+
+    private final UticStatTableManagerRepository repo;
+
+    @ProcessingElapsed(type="TABLE", name="Table Partition Manager", starting = false)
+    @Override
+    public boolean processing() {
+        YearMonth next = YearMonth.now().plusMonths(1);
+        final String nextMonth = next.format(DateTimeFormatter.ofPattern("yyMM"));       // 예: 2510
+        final String commentNextMonth = next.format(DateTimeFormatter.ofPattern("yyyy년 MM월"));
+
+        return createPartitionTable(nextMonth, commentNextMonth);
+    }
+
+    public boolean createCurrentPartitionTable() {
+        YearMonth current = YearMonth.now();
+        final String currMonth = current.format(DateTimeFormatter.ofPattern("yyMM"));    // 예: 2509
+        final String commentCurrMonth = current.format(DateTimeFormatter.ofPattern("yyyy년 MM월"));
+
+        return createPartitionTable(currMonth, commentCurrMonth);
+    }
+
+    private boolean createPartitionTable(String crtMonth, String commentCrtMonth) {
+        // TRAFFIC_CENTER_HIST
+        MakeTablePartition trafficCenter = new TrafficCenterHist(this.repo, crtMonth, commentCrtMonth);
+        if (!trafficCenter.createPartitionTable()) {
+            return false;
+        }
+
+        // RCV_LINK_TRAFFIC
+        MakeTablePartition rcvLinkTraffic = new RcvLinkTraffic(this.repo, crtMonth, commentCrtMonth);
+        if (!rcvLinkTraffic.createPartitionTable()) {
+            return false;
+        }
+
+        // PATN_XXX_HIST
+        MakeTablePartition patnHist = new PatternHist(this.repo, crtMonth, commentCrtMonth);
+        if (!patnHist.createPartitionTable()) {
+            return false;
+        }
+
+        // STAT_LOCAL_LOG
+        MakeTablePartition statLocalLog = new StatLocalLog(this.repo, crtMonth, commentCrtMonth);
+        if (!statLocalLog.createPartitionTable()) {
+            return false;
+        }
+
+        // LINK_FILTER_LOG
+        MakeTablePartition linkFilterLog = new LinkFilterLog(this.repo, crtMonth, commentCrtMonth);
+        if (!linkFilterLog.createPartitionTable()) {
+            return false;
+        }
+
+        return true;
+    }
+}

+ 59 - 0
utic-stat-server/src/main/java/com/utic/center/utic/stat/server/service/partition/LinkFilterLog.java

@@ -0,0 +1,59 @@
+package com.utic.center.utic.stat.server.service.partition;
+
+import com.utic.center.utic.stat.server.dao.repository.UticStatTableManagerRepository;
+import com.utic.center.utic.stat.server.dto.TableExistDto;
+import lombok.Getter;
+
+@Getter
+public class LinkFilterLog extends MakeTablePartition {
+
+    private final String tablePrefix = "LINK_FILTER_LOG_";
+
+    public LinkFilterLog(UticStatTableManagerRepository repo,
+                         String crtMonth,
+                         String commentCrtMonth) {
+        super(repo, crtMonth, commentCrtMonth);
+    }
+
+    @Override
+    public boolean createPartitionTable() {
+        final String tableName = this.tablePrefix + crtMonth;
+        return createTable(tableName, this.crtMonth, this.commentCrtMonth);
+    }
+
+    private boolean createTable(String tableName, String crtMonth, String commentCrtMonth) {
+        TableExistDto existDto = this.repo.findTableExist(tableName);
+        if (existDto == null) {
+            return false;
+        }
+        if (existDto.getTableExist() > 0) {
+            return true;
+        }
+
+        if (this.repo.createLinkFilterLogTable(crtMonth) < 0) {
+            return false;
+        }
+        if (this.repo.addLinkFilterLogPrimaryKey(crtMonth) < 0) {
+            return false;
+        }
+        addComments(tableName, commentCrtMonth);
+        return true;
+    }
+
+    private void addComments(String tableName, String commentCrtMonth) {
+        String tableComment = "링크필터링이력정보 " + commentCrtMonth;
+        this.repo.addTableComment(tableName, tableComment);
+
+        this.repo.addColumnComment(tableName, "local_date", "저장시각");
+        this.repo.addColumnComment(tableName, "center_id", "센터코드");
+        this.repo.addColumnComment(tableName, "linkid", "링크ID");
+        this.repo.addColumnComment(tableName, "rev_type", "수집구분 U:수도권지역센터, S:통합배포연계, L:12개지자체연계");
+        this.repo.addColumnComment(tableName, "link_filter_yn", "링크필터링여부");
+        this.repo.addColumnComment(tableName, "linklevel_filter_yn", "링크레벨필터링여부");
+        this.repo.addColumnComment(tableName, "zero_yn", "속도0값 필터링여부");
+        this.repo.addColumnComment(tableName, "std_yn", "표준편차 필터링여부");
+        this.repo.addColumnComment(tableName, "sta_yn", "패턴정보 필터링여부");
+        this.repo.addColumnComment(tableName, "rgf_yn", "도로등급 필터링여부");
+    }
+
+}

+ 23 - 0
utic-stat-server/src/main/java/com/utic/center/utic/stat/server/service/partition/MakeTablePartition.java

@@ -0,0 +1,23 @@
+package com.utic.center.utic.stat.server.service.partition;
+
+import com.utic.center.utic.stat.server.dao.repository.UticStatTableManagerRepository;
+import lombok.Getter;
+
+@Getter
+public abstract class MakeTablePartition {
+
+    protected final UticStatTableManagerRepository repo;
+    protected final String crtMonth;
+    protected final String commentCrtMonth;
+
+    public MakeTablePartition(UticStatTableManagerRepository repo,
+                              String crtMonth,
+                              String commentCrtMonth) {
+        this.repo = repo;
+        this.crtMonth = crtMonth;
+        this.commentCrtMonth = commentCrtMonth;
+    }
+
+    public abstract boolean createPartitionTable();
+
+}

+ 87 - 0
utic-stat-server/src/main/java/com/utic/center/utic/stat/server/service/partition/PatternHist.java

@@ -0,0 +1,87 @@
+package com.utic.center.utic.stat.server.service.partition;
+
+import com.utic.center.utic.stat.server.dao.repository.UticStatTableManagerRepository;
+import com.utic.center.utic.stat.server.dto.PatnTableDto;
+import com.utic.center.utic.stat.server.dto.TableExistDto;
+import lombok.Getter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Getter
+public class PatternHist extends MakeTablePartition {
+
+    private final List<PatnTableDto> patnTables = new ArrayList<>();
+
+    private final String table05MinPrefix = "PATN_";
+    private final String table15MinPrefix = "PATN_15MIN_";
+
+    private final String data05MinSpace = "PATN_DATA";
+    private final String indx05MinSpace = "PATN_INDX";
+    private final String data15MinSpace = "PATN_15MIN_DATA";
+    private final String indx15MinSpace = "PATN_15MIN_INDX";
+
+    public PatternHist(UticStatTableManagerRepository repo,
+                       String crtMonth,
+                       String commentCrtMonth) {
+        super(repo, crtMonth, commentCrtMonth);
+
+        this.patnTables.add(new PatnTableDto("HOLIDAY", "휴일"));
+        this.patnTables.add(new PatnTableDto("MON", "월요일"));
+        this.patnTables.add(new PatnTableDto("SAT", "토요일"));
+        this.patnTables.add(new PatnTableDto("SUN", "일요일"));
+        this.patnTables.add(new PatnTableDto("FRI", "금요일"));
+        this.patnTables.add(new PatnTableDto("WEEK", "평일"));
+    }
+
+    @Override
+    public boolean createPartitionTable() {
+        for (PatnTableDto patnTable : this.patnTables) {
+            // 05분 패턴 이력
+            final String table05MinHist = this.table05MinPrefix + patnTable.getTable() + "_" + this.crtMonth;
+            final String table05MinHistDesc = "링크패턴_" + patnTable.getDesc() + "_이력 " + this.commentCrtMonth;
+            if (!createTable(table05MinHist, table05MinHistDesc, this.data05MinSpace, this.indx05MinSpace)) {
+                return false;
+            }
+
+            // 15분 패턴 이력
+            final String table15MinHist = this.table15MinPrefix + patnTable.getTable() + "_" + this.crtMonth;
+            final String table15MinHistDesc = "링크패턴15분_" + patnTable.getDesc() + "_이력 " + this.commentCrtMonth;
+            if (!createTable(table15MinHist, table15MinHistDesc, this.data15MinSpace, this.indx15MinSpace)) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    private boolean createTable(String tableName, String tableComment, String dataSpace, String indexSpace) {
+        TableExistDto existDto = this.repo.findTableExist(tableName);
+        if (existDto == null) {
+            return false;
+        }
+        if (existDto.getTableExist() > 0) {
+            return true;
+        }
+
+        if (this.repo.createPatnHistTable(tableName, dataSpace) < 0) {
+            return false;
+        }
+        if (this.repo.addPatnHistPrimaryKey(tableName, indexSpace) < 0) {
+            return false;
+        }
+        addComments(tableName, tableComment);
+        return true;
+    }
+
+    private void addComments(String tableName, String tableComment) {
+        this.repo.addTableComment(tableName, tableComment);
+
+        this.repo.addColumnComment(tableName, "patn_date", "패턴일시_일");
+        this.repo.addColumnComment(tableName, "patn_time", "패턴시간");
+        this.repo.addColumnComment(tableName, "linkid", "링크ID");
+        this.repo.addColumnComment(tableName, "speed", "속도");
+        this.repo.addColumnComment(tableName, "log_date", "저장시간");
+        this.repo.addColumnComment(tableName, "linklevel", "링크레벨");
+    }
+
+}

+ 61 - 0
utic-stat-server/src/main/java/com/utic/center/utic/stat/server/service/partition/RcvLinkTraffic.java

@@ -0,0 +1,61 @@
+package com.utic.center.utic.stat.server.service.partition;
+
+import com.utic.center.utic.stat.server.dao.repository.UticStatTableManagerRepository;
+import com.utic.center.utic.stat.server.dto.TableExistDto;
+import lombok.Getter;
+
+@Getter
+public class RcvLinkTraffic extends MakeTablePartition {
+
+    private final String tablePrefix = "RCV_LINK_TRAFFIC_";
+
+    public RcvLinkTraffic(UticStatTableManagerRepository repo,
+                          String crtMonth,
+                          String commentCrtMonth) {
+        super(repo, crtMonth, commentCrtMonth);
+    }
+
+    @Override
+    public boolean createPartitionTable() {
+        final String tableName = this.tablePrefix + crtMonth;
+        return createTable(tableName, this.crtMonth, this.commentCrtMonth);
+    }
+
+    private boolean createTable(String tableName, String crtMonth, String commentCrtMonth) {
+        TableExistDto existDto = this.repo.findTableExist(tableName);
+        if (existDto == null) {
+            return false;
+        }
+        if (existDto.getTableExist() > 0) {
+            return true;
+        }
+
+        if (this.repo.createRcvLinkTrafficTable(crtMonth) < 0) {
+            return false;
+        }
+        if (this.repo.addRcvLinkTrafficCenterPrimaryKey(crtMonth) < 0) {
+            return false;
+        }
+        addComments(tableName, commentCrtMonth);
+        return true;
+    }
+
+    private void addComments(String tableName, String commentCrtMonth) {
+        String tableComment = "수도권수집교통정보 " + commentCrtMonth;
+        this.repo.addTableComment(tableName, tableComment);
+
+        this.repo.addColumnComment(tableName, "regdate", "등록시각");
+        this.repo.addColumnComment(tableName, "tocenterid", "목적지센터ID");
+        this.repo.addColumnComment(tableName, "linknumber", "링크ID");
+        this.repo.addColumnComment(tableName, "logdate", "저장시각");
+        this.repo.addColumnComment(tableName, "fromcenterid", "소스센터ID");
+        this.repo.addColumnComment(tableName, "speedrate", "Km/h");
+        this.repo.addColumnComment(tableName, "volumerate", "대/h");
+        this.repo.addColumnComment(tableName, "densityrate", "대/h");
+        this.repo.addColumnComment(tableName, "traveltimequantity", "초/기준");
+        this.repo.addColumnComment(tableName, "delayquanity", "초/기준");
+        this.repo.addColumnComment(tableName, "vehiclequeuelengthquantity", "m/기준");
+        this.repo.addColumnComment(tableName, "occupancypercent", "점유율");
+    }
+
+}

+ 54 - 0
utic-stat-server/src/main/java/com/utic/center/utic/stat/server/service/partition/StatLocalLog.java

@@ -0,0 +1,54 @@
+package com.utic.center.utic.stat.server.service.partition;
+
+import com.utic.center.utic.stat.server.dao.repository.UticStatTableManagerRepository;
+import com.utic.center.utic.stat.server.dto.TableExistDto;
+import lombok.Getter;
+
+@Getter
+public class StatLocalLog extends MakeTablePartition {
+
+    private final String tablePrefix = "STAT_LOCAL_LOG_";
+
+    public StatLocalLog(UticStatTableManagerRepository repo,
+                        String crtMonth,
+                        String commentCrtMonth) {
+        super(repo, crtMonth, commentCrtMonth);
+    }
+
+    @Override
+    public boolean createPartitionTable() {
+        final String tableName = this.tablePrefix + crtMonth;
+        return createTable(tableName, this.crtMonth, this.commentCrtMonth);
+    }
+
+    private boolean createTable(String tableName, String crtMonth, String commentCrtMonth) {
+        TableExistDto existDto = this.repo.findTableExist(tableName);
+        if (existDto == null) {
+            return false;
+        }
+        if (existDto.getTableExist() > 0) {
+            return true;
+        }
+
+        if (this.repo.createStatLocalLogTable(crtMonth) < 0) {
+            return false;
+        }
+        if (this.repo.addStatLocalLogPrimaryKey(crtMonth) < 0) {
+            return false;
+        }
+        addComments(tableName, commentCrtMonth);
+        return true;
+    }
+
+    private void addComments(String tableName, String commentCrtMonth) {
+        String tableComment = "통계_지역센터이력 " + commentCrtMonth;
+        this.repo.addTableComment(tableName, tableComment);
+
+        this.repo.addColumnComment(tableName, "local_date", "저장시각");
+        this.repo.addColumnComment(tableName, "center_id", "센터코드");
+        this.repo.addColumnComment(tableName, "linkid", "링크ID");
+        this.repo.addColumnComment(tableName, "rev_type", "수집구분");
+        this.repo.addColumnComment(tableName, "speed", "속도");
+    }
+
+}

+ 63 - 0
utic-stat-server/src/main/java/com/utic/center/utic/stat/server/service/partition/TrafficCenterHist.java

@@ -0,0 +1,63 @@
+package com.utic.center.utic.stat.server.service.partition;
+
+import com.utic.center.utic.stat.server.dao.repository.UticStatTableManagerRepository;
+import com.utic.center.utic.stat.server.dto.TableExistDto;
+import lombok.Getter;
+
+@Getter
+public class TrafficCenterHist extends MakeTablePartition {
+
+    private final String tablePrefix= "TRAFFIC_CENTER_";
+
+    public TrafficCenterHist(UticStatTableManagerRepository repo,
+                             String crtMonth,
+                             String commentCrtMonth) {
+        super(repo, crtMonth, commentCrtMonth);
+    }
+
+    @Override
+    public boolean createPartitionTable() {
+        final String tableName = this.tablePrefix + crtMonth;
+        return createTable(tableName, this.crtMonth, this.commentCrtMonth);
+    }
+
+    private boolean createTable(String tableName, String crtMonth, String commentCrtMonth) {
+        TableExistDto existDto = this.repo.findTableExist(tableName);
+        if (existDto == null) {
+            return false;
+        }
+        if (existDto.getTableExist() > 0) {
+            return true;
+        }
+
+        if (this.repo.createTrafficCenterHistTable(crtMonth) < 0) {
+            return false;
+        }
+        if (this.repo.addTrafficCenterHistPrimaryKey(crtMonth) < 0) {
+            return false;
+        }
+        addComments(tableName, commentCrtMonth);
+        return true;
+    }
+
+    private void addComments(String tableName, String commentCrtMonth) {
+        String tableComment = "제공이력정보_통합 " + commentCrtMonth;
+        this.repo.addTableComment(tableName, tableComment);
+
+        this.repo.addColumnComment(tableName, "linkid", "링크ID");
+        this.repo.addColumnComment(tableName, "missvalueyn", "결측여부");
+        this.repo.addColumnComment(tableName, "regdate", "등록일시");
+        this.repo.addColumnComment(tableName, "linklevel", "링크레벨");
+        this.repo.addColumnComment(tableName, "speed", "속도");
+        this.repo.addColumnComment(tableName, "traveltime", "여행시간");
+        this.repo.addColumnComment(tableName, "trafficgrade", "소통등급");
+        this.repo.addColumnComment(tableName, "incidentid", "돌발ID");
+        this.repo.addColumnComment(tableName, "datarestype", "데이터유형");
+        this.repo.addColumnComment(tableName, "centerid", "센터ID");
+        this.repo.addColumnComment(tableName, "psdmissvalueyn", "PSD결측보정여부");
+        this.repo.addColumnComment(tableName, "psdspeed", "PSD속도");
+        this.repo.addColumnComment(tableName, "knnspeed", "KNN속도");
+        this.repo.addColumnComment(tableName, "knncnt", "KNN결측갯수");
+    }
+
+}

+ 245 - 0
utic-stat-server/src/main/resources/mybatis/mapper/UticStatTableManagerMapper.xml

@@ -0,0 +1,245 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.utic.center.utic.stat.server.dao.mapper.UticStatTableManagerMapper">
+
+    <select id="findTableExist" parameterType="java.lang.String" resultType="com.utic.center.utic.stat.server.dto.TableExistDto" timeout="10">
+        <![CDATA[
+        SELECT COUNT(1) AS tableExist FROM USER_TABLES WHERE TABLE_NAME = #{tableName}
+        ]]>
+    </select>
+
+    <update id="dropTable">
+        <![CDATA[
+        DROP TABLE ${tableName} PURGE
+        ]]>
+    </update>
+
+    <update id="addTableComment" parameterType="java.lang.String">
+        COMMENT ON TABLE ${tableName} IS '${tableComment}'
+    </update>
+
+    <update id="addColumnComment" parameterType="java.lang.String">
+        COMMENT ON COLUMN ${tableName}.${columnName} IS '${columnComment}'
+    </update>
+
+    <update id="createTrafficCenterHistTable" parameterType="java.lang.String">
+        create table TRAFFIC_CENTER_${crtMonth}
+        (
+            linkid         VARCHAR2(10) not null,
+            missvalueyn    CHAR(1),
+            regdate        DATE not null,
+            linklevel      CHAR(1),
+            speed          NUMBER(3),
+            traveltime     NUMBER(7),
+            trafficgrade   CHAR(2),
+            incidentid     VARCHAR2(12),
+            datarestype    CHAR(1),
+            centerid       VARCHAR2(3),
+            psdmissvalueyn CHAR(1),
+            psdspeed       NUMBER(3),
+            knnspeed       NUMBER(3),
+            knncnt         NUMBER(3)
+        )
+        tablespace ODS_DATA
+        pctfree 10
+        initrans 1
+        maxtrans 255
+        storage
+        (
+           initial 64K
+            next 1M
+            minextents 1
+            maxextents unlimited
+        )
+    </update>
+
+    <update id="addTrafficCenterHistPrimaryKey" parameterType="java.lang.String">
+        alter table TRAFFIC_CENTER_${crtMonth}
+            add constraint PK_TRAFFIC_CENTER_${crtMonth} primary key (REGDATE, LINKID)
+            using index
+            tablespace ODS_INDX
+            pctfree 10
+            initrans 2
+            maxtrans 255
+            storage
+            (
+                initial 64K
+                next 1M
+                minextents 1
+                maxextents unlimited
+            )
+    </update>
+
+    <update id="createRcvLinkTrafficTable" parameterType="java.lang.String">
+        create table RCV_LINK_TRAFFIC_${crtMonth}
+        (
+            regdate                    DATE not null,
+            tocenterid                 VARCHAR2(20),
+            linknumber                 VARCHAR2(20) not null,
+            logdate                    DATE,
+            fromcenterid               VARCHAR2(20) not null,
+            speedrate                  NUMBER(3),
+            volumerate                 NUMBER(6),
+            densityrate                NUMBER(4),
+            traveltimequantity         NUMBER(5),
+            delayquanity               NUMBER(5),
+            vehiclequeuelengthquantity NUMBER(6),
+            occupancypercent           NUMBER(3)
+        )
+        tablespace ODS_DATA
+        pctfree 10
+        initrans 1
+        maxtrans 255
+        storage
+        (
+            initial 64K
+            next 1M
+            minextents 1
+            maxextents unlimited
+        )
+    </update>
+
+    <update id="addRcvLinkTrafficPrimaryKey" parameterType="java.lang.String">
+        alter table RCV_LINK_TRAFFIC_${crtMonth}
+            add constraint PK_RCV_LINK_TRAFFIC_${crtMonth} primary key (REGDATE, FROMCENTERID, LINKNUMBER)
+            using index
+            tablespace ODS_INDX
+            pctfree 10
+            initrans 2
+            maxtrans 255
+            storage
+            (
+                initial 64K
+                next 1M
+                minextents 1
+                maxextents unlimited
+            )
+    </update>
+
+    <update id="createPatnHistTable" parameterType="java.lang.String">
+        create table ${tableName}
+        (
+            patn_date CHAR(8) not null,
+            patn_time CHAR(4) not null,
+            linkid    VARCHAR2(10) not null,
+            speed     NUMBER(3),
+            log_date  DATE,
+            linklevel CHAR(1)
+        )
+        tablespace ${dataSpace}
+        pctfree 10
+        initrans 1
+        maxtrans 255
+        storage
+        (
+            initial 64K
+            next 1M
+            minextents 1
+            maxextents unlimited
+        )
+    </update>
+
+    <update id="addPatnHistPrimaryKey" parameterType="java.lang.String">
+        alter table ${tableName}
+            add constraint PK_${tableName} primary key (PATN_DATE, PATN_TIME, LINKID)
+            using index
+            tablespace ${indexSpace}
+            pctfree 10
+            initrans 2
+            maxtrans 255
+            storage
+            (
+                initial 64K
+                next 1M
+                minextents 1
+                maxextents unlimited
+            )
+    </update>
+
+    <update id="createStatLocalLogTable" parameterType="java.lang.String">
+        create table STAT_LOCAL_LOG_${crtMonth}
+        (
+            local_date CHAR(14) not null,
+            center_id  VARCHAR2(3) not null,
+            linkid     VARCHAR2(10) not null,
+            rev_type   CHAR(1),
+            speed      NUMBER(3)
+        )
+        tablespace ODS_DATA
+        pctfree 10
+        initrans 1
+        maxtrans 255
+        storage
+        (
+            initial 64K
+            next 1M
+            minextents 1
+            maxextents unlimited
+        )
+    </update>
+
+    <update id="addStatLocalLogPrimaryKey" parameterType="java.lang.String">
+        alter table STAT_LOCAL_LOG_${crtMonth}
+            add constraint PK_STAT_LOCAL_LOG_${crtMonth} primary key (LOCAL_DATE, CENTER_ID, LINKID)
+            using index
+            tablespace ODS_INDX
+            pctfree 10
+            initrans 2
+            maxtrans 255
+            storage
+            (
+            initial 64K
+            next 1M
+            minextents 1
+            maxextents unlimited
+            )
+    </update>
+
+    <update id="createLinkFilterLogTable" parameterType="java.lang.String">
+        create table LINK_FILTER_LOG_${crtMonth}
+        (
+            local_date          CHAR(14) not null,
+            center_id           VARCHAR2(3) not null,
+            linkid              VARCHAR2(10) not null,
+            rev_type            CHAR(1),
+            link_filter_yn      CHAR(1),
+            linklevel_filter_yn CHAR(1),
+            zero_yn             CHAR(1),
+            std_yn              CHAR(1),
+            sta_yn              CHAR(1),
+            rgf_yn              CHAR(1)
+        )
+        tablespace ODS_DATA
+        pctfree 10
+        initrans 1
+        maxtrans 255
+        storage
+        (
+            initial 64K
+            next 1M
+            minextents 1
+            maxextents unlimited
+        )
+    </update>
+
+    <update id="addLinkFilterLogPrimaryKey" parameterType="java.lang.String">
+        alter table LINK_FILTER_LOG_${crtMonth}
+            add constraint PK_LINK_FILTER_LOG_${crtMonth} primary key (LOCAL_DATE, CENTER_ID, LINKID)
+            using index
+            tablespace ODS_INDX
+            pctfree 10
+            initrans 2
+            maxtrans 255
+            storage
+            (
+            initial 64K
+            next 1M
+            minextents 1
+            maxextents unlimited
+            )
+    </update>
+
+
+
+</mapper>