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.UticStat05MinFltrMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;

@Repository
@RequiredArgsConstructor
public class UticStat05MinFltrRepository {

    private final UticStat05MinFltrMapper mapper;

    @SqlOperation(type = SqlOperation.SqlType.TRUNCATE, table = "STAT_LOCAL")
    public int truncateStatLocal() {
        return this.mapper.truncateStatLocal();
    }

    @SqlOperation(type = SqlOperation.SqlType.INSERT, table = "STAT_LOCAL", param = "RCV_LINK_TRAFFIC(수도권 지역센터)")
    public int insertStatLocalRcvLinkTraffic(String past25Min, String past30Min) {
        return this.mapper.insertStatLocalRcvLinkTraffic(past25Min, past30Min);
    }

    @SqlOperation(type = SqlOperation.SqlType.TRUNCATE, table = "LINK_FILTER")
    public int truncateLinkFilter() {
        return this.mapper.truncateLinkFilter();
    }

    @SqlOperation(type = SqlOperation.SqlType.INSERT, table = "LINK_FILTER", param = "STAT_LOCAL(표준편차값)")
    public int insertLinkFilterStdDev(String past25Min, String codeValue0, String codeValue5) {
        return this.mapper.insertLinkFilterStdDev(past25Min, codeValue0, codeValue5);
    }
    @SqlOperation(type = SqlOperation.SqlType.UPDATE, table = "LINK_FILTER", param = "logTable")
    public int updateLinkFilterPattern(String fromTable, String past25Min, Integer minValue, Integer maxValue, String logTable) {
        return this.mapper.updateLinkFilterPattern(fromTable, past25Min, minValue, maxValue);
    }
    @SqlOperation(type = SqlOperation.SqlType.UPDATE, table = "LINK_FILTER", param = "SPEED NULL")
    public int updateLinkFilterSpeedNull() {
        return this.mapper.updateLinkFilterSpeedNull();
    }
    @SqlOperation(type = SqlOperation.SqlType.UPDATE, table = "LINK_FILTER", param = "도로등급")
    public int updateLinkFilterRoadRank() {
        return this.mapper.updateLinkFilterRoadRank();
    }
    @SqlOperation(type = SqlOperation.SqlType.UPDATE, table = "LINK_FILTER", param = "MIN_MAX(도로등급 필터링)")
    public int updateLinkFilterMinMax(Integer minValue6, Integer maxValue6,
                                      Integer minValue7, Integer maxValue7,
                                      Integer minValue8, Integer maxValue8,
                                      Integer minValue9, Integer maxValue9) {
        return this.mapper.updateLinkFilterMinMax(minValue6, maxValue6, minValue7, maxValue7, minValue8, maxValue8, minValue9, maxValue9);
    }
    @SqlOperation(type = SqlOperation.SqlType.INSERT, table = "STAT_LOCAL_LOG", param = "STAT_LOCAL")
    public int insertStatLocalLog() {
        return this.mapper.insertStatLocalLog();
    }

}
