package com.its.api.its.controller.statistics;

import com.its.api.its.model.dto.statistics.TrafficStatDto;
import com.its.api.its.service.statistics.TrafficHourStatisticsService;
import com.its.api.its.service.statistics.TrafficSpecStatisticsService;
import com.its.api.its.service.statistics.TrafficTermStatisticsService;
import com.its.api.utils.ItsUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/statistics/traffic")
@Api(tags = "03.통계-1.소통정보통계")
public class TrafficStatisticsController {

    private final TrafficTermStatisticsService serviceTerm;
    private final TrafficHourStatisticsService serviceHour;
    private final TrafficSpecStatisticsService serviceSpec;

    //////////// 링크 기간검색
    @ApiOperation(value = "기간검색-링크 15분(TB_LINK_15M_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/term/link-15m", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllLink15MTerm(
            @ApiParam(name = "LINK_ID", value = "링크 ID", example = "2280168600", required = true)
            @RequestParam String LINK_ID,
            @ApiParam(name = "FROM_DT", value = "조회시작시각(YYYYMMDDHH24)", example = "2021120100", required = true)
            @RequestParam String FROM_DT,
            @ApiParam(name = "TO_DT", value = "조회종료시각(YYYYMMDDHH24)", example = "2021120102", required = true)
            @RequestParam String TO_DT) {

        String fromDt = FROM_DT + "0000";
        String toDt = TO_DT + "5959";
        return this.serviceTerm.findAllLink15M(fromDt, toDt, LINK_ID);
    }

    @ApiOperation(value = "기간검색-링크 시간(TB_LINK_HH_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/term/link-hh", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllLinkHHTerm(
            @ApiParam(name = "LINK_ID", value = "링크 ID", example = "2280168600", required = true)
            @RequestParam String LINK_ID,
            @ApiParam(name = "FROM_DT", value = "조회시작시각(YYYYMMDDHH24)", example = "2021120100", required = true)
            @RequestParam String FROM_DT,
            @ApiParam(name = "TO_DT", value = "조회종료시각(YYYYMMDDHH24)", example = "2021120102", required = true)
            @RequestParam String TO_DT) {

        String fromDt = FROM_DT + "0000";
        String toDt = TO_DT + "5959";
        return this.serviceTerm.findAllLinkHH(fromDt, toDt, LINK_ID);
    }

    @ApiOperation(value = "기간검색-링크 일(TB_LINK_DD_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/term/link-dd", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllLinkDDTerm(
            @ApiParam(name = "LINK_ID", value = "링크 ID", example = "2280168600", required = true)
            @RequestParam String LINK_ID,
            @ApiParam(name = "FROM_DT", value = "조회시작일(YYYYMMDD)", example = "20211201", required = true)
            @RequestParam String FROM_DT,
            @ApiParam(name = "TO_DT", value = "조회종료일(YYYYMMDD)", example = "20211201", required = true)
            @RequestParam String TO_DT) {

        String fromDt = FROM_DT + "000000";
        String toDt = TO_DT + "235959";
        return this.serviceTerm.findAllLinkDD(fromDt, toDt, LINK_ID);
    }

    @ApiOperation(value = "기간검색-링크 월(TB_LINK_MN_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/term/link-mn", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllLinkMNTerm(
            @ApiParam(name = "LINK_ID", value = "링크 ID", example = "2280168600", required = true)
            @RequestParam String LINK_ID,
            @ApiParam(name = "FROM_DT", value = "조회시작월(YYYYMM)", example = "202112", required = true)
            @RequestParam String FROM_DT,
            @ApiParam(name = "TO_DT", value = "조회종료월(YYYYMM)", example = "202112", required = true)
            @RequestParam String TO_DT) {

        String fromDt = FROM_DT + "01000000";
        String toDt = ItsUtils.getLastDayOfMonth(TO_DT) + "235959";
        return this.serviceTerm.findAllLinkMN(fromDt, toDt, LINK_ID);
    }

    @ApiOperation(value = "기간검색-링크 년(TB_LINK_YY_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/term/link-yy", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllLinkYYTerm(
            @ApiParam(name = "LINK_ID", value = "링크 ID", example = "2280168600", required = true)
            @RequestParam String LINK_ID,
            @ApiParam(name = "FROM_DT", value = "조회시작연도(YYYY)", example = "2021", required = true)
            @RequestParam String FROM_DT,
            @ApiParam(name = "TO_DT", value = "조회종료연도(YYYY)", example = "2021", required = true)
            @RequestParam String TO_DT) {

        String fromDt = FROM_DT + "0101000000";
        String toDt = TO_DT + "1231235959";
        return this.serviceTerm.findAllLinkYY(fromDt, toDt, LINK_ID);
    }

    //////////// 정보제공 링크 기간검색
    @ApiOperation(value = "기간검색-정보제공구간 15분(TB_IFSC_15M_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/term/ifsc-15m", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllIfsc15MTerm(
            @ApiParam(name = "IFSC_ID", value = "정보제공구간 ID", example = "2200000259", required = true)
            @RequestParam String IFSC_ID,
            @ApiParam(name = "FROM_DT", value = "조회시작시각(YYYYMMDDHH24)", example = "2021120100", required = true)
            @RequestParam String FROM_DT,
            @ApiParam(name = "TO_DT", value = "조회종료시각(YYYYMMDDHH24)", example = "2021120102", required = true)
            @RequestParam String TO_DT) {

        String fromDt = FROM_DT + "0000";
        String toDt = TO_DT + "5959";
        return this.serviceTerm.findAllIfsc15M(fromDt, toDt, IFSC_ID);
    }

    @ApiOperation(value = "기간검색-정보제공구간 시간(TB_IFSC_HH_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/term/ifsc-hh", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllIfscHHTerm(
            @ApiParam(name = "IFSC_ID", value = "정보제공구간 ID", example = "2200000259", required = true)
            @RequestParam String IFSC_ID,
            @ApiParam(name = "FROM_DT", value = "조회시작시각(YYYYMMDDHH24)", example = "2021120100", required = true)
            @RequestParam String FROM_DT,
            @ApiParam(name = "TO_DT", value = "조회종료시각(YYYYMMDDHH24)", example = "2021120102", required = true)
            @RequestParam String TO_DT) {

        String fromDt = FROM_DT + "0000";
        String toDt = TO_DT + "5959";
        return this.serviceTerm.findAllIfscHH(fromDt, toDt, IFSC_ID);
    }

    @ApiOperation(value = "기간검색-정보제공구간 일(TB_IFSC_DD_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/term/ifsc-dd", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllIfscDDTerm(
            @ApiParam(name = "IFSC_ID", value = "정보제공구간 ID", example = "2200000259", required = true)
            @RequestParam String IFSC_ID,
            @ApiParam(name = "FROM_DT", value = "조회시작일(YYYYMMDD)", example = "20211201", required = true)
            @RequestParam String FROM_DT,
            @ApiParam(name = "TO_DT", value = "조회종료일(YYYYMMDD)", example = "20211201", required = true)
            @RequestParam String TO_DT) {

        String fromDt = FROM_DT + "000000";
        String toDt = TO_DT + "235959";
        return this.serviceTerm.findAllIfscDD(fromDt, toDt, IFSC_ID);
    }

    @ApiOperation(value = "기간검색-정보제공구간 월(TB_IFSC_MN_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/term/ifsc-mn", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllIfscMNTerm(
            @ApiParam(name = "IFSC_ID", value = "정보제공구간 ID", example = "2200000259", required = true)
            @RequestParam String IFSC_ID,
            @ApiParam(name = "FROM_DT", value = "조회시작월(YYYYMM)", example = "202112", required = true)
            @RequestParam String FROM_DT,
            @ApiParam(name = "TO_DT", value = "조회종료월(YYYYMM)", example = "202112", required = true)
            @RequestParam String TO_DT) {

        String fromDt = FROM_DT + "01000000";
        String toDt = ItsUtils.getLastDayOfMonth(TO_DT) + "235959";
        return this.serviceTerm.findAllIfscMN(fromDt, toDt, IFSC_ID);
    }

    @ApiOperation(value = "기간검색-정보제공구간 년(TB_IFSC_YY_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/term/ifsc-yy", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllIfscYYTerm(
            @ApiParam(name = "IFSC_ID", value = "정보제공구간 ID", example = "2200000259", required = true)
            @RequestParam String IFSC_ID,
            @ApiParam(name = "FROM_DT", value = "조회시작연도(YYYY)", example = "2021", required = true)
            @RequestParam String FROM_DT,
            @ApiParam(name = "TO_DT", value = "조회종료연도(YYYY)", example = "2021", required = true)
            @RequestParam String TO_DT) {

        String fromDt = FROM_DT + "0101000000";
        String toDt = TO_DT + "1231235959";
        return this.serviceTerm.findAllIfscYY(fromDt, toDt, IFSC_ID);
    }

    //////////// 도로 기간검색
    @ApiOperation(value = "기간검색-도로 15분(TB_ROAD_15M_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/term/road-15m", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllRoad15MTerm(
            @ApiParam(name = "ROAD_ID", value = "도로 ID", example = "3200000023", required = true)
            @RequestParam String ROAD_ID,
            @ApiParam(name = "FROM_DT", value = "조회시작시각(YYYYMMDDHH24)", example = "2021120100", required = true)
            @RequestParam String FROM_DT,
            @ApiParam(name = "TO_DT", value = "조회종료시각(YYYYMMDDHH24)", example = "2021120102", required = true)
            @RequestParam String TO_DT) {

        String fromDt = FROM_DT + "0000";
        String toDt = TO_DT + "5959";
        return this.serviceTerm.findAllRoad15M(fromDt, toDt, ROAD_ID);
    }

    @ApiOperation(value = "기간검색-도로 시간(TB_ROAD_HH_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/term/road-hh", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllRoadHHTerm(
            @ApiParam(name = "ROAD_ID", value = "도로 ID", example = "3200000023", required = true)
            @RequestParam String ROAD_ID,
            @ApiParam(name = "FROM_DT", value = "조회시작시각(YYYYMMDDHH24)", example = "2021120100", required = true)
            @RequestParam String FROM_DT,
            @ApiParam(name = "TO_DT", value = "조회종료시각(YYYYMMDDHH24)", example = "2021120102", required = true)
            @RequestParam String TO_DT) {

        String fromDt = FROM_DT + "0000";
        String toDt = TO_DT + "5959";
        return this.serviceTerm.findAllRoadHH(fromDt, toDt, ROAD_ID);
    }

    @ApiOperation(value = "기간검색-도로 일(TB_ROAD_DD_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/term/road-dd", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllRoadDDTerm(
            @ApiParam(name = "ROAD_ID", value = "도로 ID", example = "3200000023", required = true)
            @RequestParam String ROAD_ID,
            @ApiParam(name = "FROM_DT", value = "조회시작일(YYYYMMDD)", example = "20211201", required = true)
            @RequestParam String FROM_DT,
            @ApiParam(name = "TO_DT", value = "조회종료일(YYYYMMDD)", example = "20211201", required = true)
            @RequestParam String TO_DT) {

        String fromDt = FROM_DT + "000000";
        String toDt = TO_DT + "235959";
        return this.serviceTerm.findAllRoadDD(fromDt, toDt, ROAD_ID);
    }

    @ApiOperation(value = "기간검색-도로 월(TB_ROAD_MN_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/term/road-mn", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllRoadMNTerm(
            @ApiParam(name = "ROAD_ID", value = "도로 ID", example = "3200000023", required = true)
            @RequestParam String ROAD_ID,
            @ApiParam(name = "FROM_DT", value = "조회시작월(YYYYMM)", example = "202112", required = true)
            @RequestParam String FROM_DT,
            @ApiParam(name = "TO_DT", value = "조회종료월(YYYYMM)", example = "202112", required = true)
            @RequestParam String TO_DT) {

        String fromDt = FROM_DT + "01000000";
        String toDt = ItsUtils.getLastDayOfMonth(TO_DT) + "235959";
        return this.serviceTerm.findAllRoadMN(fromDt, toDt, ROAD_ID);
    }

    @ApiOperation(value = "기간검색-도로 년(TB_ROAD_YY_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/term/road-yy", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllRoadYYTerm(
            @ApiParam(name = "ROAD_ID", value = "도로 ID", example = "3200000023", required = true)
            @RequestParam String ROAD_ID,
            @ApiParam(name = "FROM_DT", value = "조회시작연도(YYYY)", example = "2021", required = true)
            @RequestParam String FROM_DT,
            @ApiParam(name = "TO_DT", value = "조회종료연도(YYYY)", example = "2021", required = true)
            @RequestParam String TO_DT) {

        String fromDt = FROM_DT + "0101000000";
        String toDt = TO_DT + "1231235959";
        return this.serviceTerm.findAllRoadYY(fromDt, toDt, ROAD_ID);
    }

    //////////// 링크 시간대검색
    @ApiOperation(value = "시간대검색-링크 15분(TB_LINK_15M_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/hour/link-15m", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllLink15MHour(
            @ApiParam(name = "LINK_ID", value = "링크 ID", example = "2280168600", required = true)
            @RequestParam String LINK_ID,
            @ApiParam(name = "FROM_DT", value = "조회시작일(YYYYMMDD)", example = "20211201", required = true)
            @RequestParam String FROM_DT,
            @ApiParam(name = "TO_DT", value = "조회종료일(YYYYMMDD)", example = "20211201", required = true)
            @RequestParam String TO_DT,
            @ApiParam(name = "FROM_HH", value = "시작시간대(HH24)", example = "00", required = true)
            @RequestParam String FROM_HH,
            @ApiParam(name = "TO_HH", value = "종료시간대(HH24)", example = "23", required = true)
            @RequestParam String TO_HH) {

        String fromDt = FROM_DT + "000000";
        String toDt = TO_DT + "235959";
        String fromHh = FROM_HH + "0000";
        String toHh = TO_HH + "5959";
        return this.serviceHour.findAllLink15M(fromDt, toDt, fromHh, toHh, LINK_ID);
    }

    @ApiOperation(value = "시간대검색-링크 시간(TB_LINK_HH_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/hour/link-hh", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllLinkHHHour(
            @ApiParam(name = "LINK_ID", value = "링크 ID", example = "2280168600", required = true)
            @RequestParam String LINK_ID,
            @ApiParam(name = "FROM_DT", value = "조회시작일(YYYYMMDD)", example = "20211201", required = true)
            @RequestParam String FROM_DT,
            @ApiParam(name = "TO_DT", value = "조회종료일(YYYYMMDD)", example = "20211201", required = true)
            @RequestParam String TO_DT,
            @ApiParam(name = "FROM_HH", value = "시작시간대(HH24)", example = "00", required = true)
            @RequestParam String FROM_HH,
            @ApiParam(name = "TO_HH", value = "종료시간대(HH24)", example = "23", required = true)
            @RequestParam String TO_HH) {

        String fromDt = FROM_DT + "000000";
        String toDt = TO_DT + "235959";
        String fromHh = FROM_HH + "0000";
        String toHh = TO_HH + "5959";
        return this.serviceHour.findAllLinkHH(fromDt, toDt, fromHh, toHh, LINK_ID);
    }

    //////////// 정보제공 링크 시간대검색
    @ApiOperation(value = "시간대검색-정보제공구간 15분(TB_IFSC_15M_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/hour/ifsc-15m", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllIfsc15MHour(
            @ApiParam(name = "IFSC_ID", value = "정보제공구간 ID", example = "2200000259", required = true)
            @RequestParam String IFSC_ID,
            @ApiParam(name = "FROM_DT", value = "조회시작일(YYYYMMDD)", example = "20211201", required = true)
            @RequestParam String FROM_DT,
            @ApiParam(name = "TO_DT", value = "조회종료일(YYYYMMDD)", example = "20211201", required = true)
            @RequestParam String TO_DT,
            @ApiParam(name = "FROM_HH", value = "시작시간대(HH24)", example = "00", required = true)
            @RequestParam String FROM_HH,
            @ApiParam(name = "TO_HH", value = "종료시간대(HH24)", example = "23", required = true)
            @RequestParam String TO_HH) {

        String fromDt = FROM_DT + "000000";
        String toDt = TO_DT + "235959";
        String fromHh = FROM_HH + "0000";
        String toHh = TO_HH + "5959";
        return this.serviceHour.findAllIfsc15M(fromDt, toDt, fromHh, toHh, IFSC_ID);
    }

    @ApiOperation(value = "시간대검색-정보제공구간 시간(TB_IFSC_HH_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/hour/ifsc-hh", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllIfscHHHour(
            @ApiParam(name = "IFSC_ID", value = "정보제공구간 ID", example = "2200000259", required = true)
            @RequestParam String IFSC_ID,
            @ApiParam(name = "FROM_DT", value = "조회시작일(YYYYMMDD)", example = "20211201", required = true)
            @RequestParam String FROM_DT,
            @ApiParam(name = "TO_DT", value = "조회종료일(YYYYMMDD)", example = "20211201", required = true)
            @RequestParam String TO_DT,
            @ApiParam(name = "FROM_HH", value = "시작시간대(HH24)", example = "00", required = true)
            @RequestParam String FROM_HH,
            @ApiParam(name = "TO_HH", value = "종료시간대(HH24)", example = "23", required = true)
            @RequestParam String TO_HH) {

        String fromDt = FROM_DT + "000000";
        String toDt = TO_DT + "235959";
        String fromHh = FROM_HH + "0000";
        String toHh = TO_HH + "5959";
        return this.serviceHour.findAllIfscHH(fromDt, toDt, fromHh, toHh, IFSC_ID);
    }

    //////////// 도로 시간대검색
    @ApiOperation(value = "시간대검색-도로 15분(TB_ROAD_15M_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/hour/road-15m", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllRoad15MHour(
            @ApiParam(name = "ROAD_ID", value = "도로 ID", example = "3200000023", required = true)
            @RequestParam String ROAD_ID,
            @ApiParam(name = "FROM_DT", value = "조회시작일(YYYYMMDD)", example = "20211201", required = true)
            @RequestParam String FROM_DT,
            @ApiParam(name = "TO_DT", value = "조회종료일(YYYYMMDD)", example = "20211201", required = true)
            @RequestParam String TO_DT,
            @ApiParam(name = "FROM_HH", value = "시작시간대(HH24)", example = "00", required = true)
            @RequestParam String FROM_HH,
            @ApiParam(name = "TO_HH", value = "종료시간대(HH24)", example = "23", required = true)
            @RequestParam String TO_HH) {

        String fromDt = FROM_DT + "000000";
        String toDt = TO_DT + "235959";
        String fromHh = FROM_HH + "0000";
        String toHh = TO_HH + "5959";
        return this.serviceHour.findAllRoad15M(fromDt, toDt, fromHh, toHh, ROAD_ID);
    }

    @ApiOperation(value = "시간대검색-도로 시간(TB_ROAD_HH_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/hour/road-hh", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllRoadHHHour(
            @ApiParam(name = "ROAD_ID", value = "도로 ID", example = "3200000023", required = true)
            @RequestParam String ROAD_ID,
            @ApiParam(name = "FROM_DT", value = "조회시작일(YYYYMMDD)", example = "20211201", required = true)
            @RequestParam String FROM_DT,
            @ApiParam(name = "TO_DT", value = "조회종료일(YYYYMMDD)", example = "20211201", required = true)
            @RequestParam String TO_DT,
            @ApiParam(name = "FROM_HH", value = "시작시간대(HH24)", example = "00", required = true)
            @RequestParam String FROM_HH,
            @ApiParam(name = "TO_HH", value = "종료시간대(HH24)", example = "23", required = true)
            @RequestParam String TO_HH) {

        String fromDt = FROM_DT + "000000";
        String toDt = TO_DT + "235959";
        String fromHh = FROM_HH + "0000";
        String toHh = TO_HH + "5959";
        return this.serviceHour.findAllRoadHH(fromDt, toDt, fromHh, toHh, ROAD_ID);
    }

    //////////// 링크 지정시각검색
    //////////// TODO: 지정일은 반드시 조회조건에 포함시켜야 한다.
    @ApiOperation(value = "지정시각검색-링크 15분(TB_LINK_15M_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/spec/link-15m", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllLink15MSpec(
            @ApiParam(name = "LINK_ID", value = "링크 ID", example = "2280168600", required = true)
            @RequestParam String LINK_ID,
            @ApiParam(name = "FROM_HH", value = "시작시간대(HH24)", example = "00", required = true)
            @RequestParam String FROM_HH,
            @ApiParam(name = "TO_HH", value = "종료시간대(HH24)", example = "23", required = true)
            @RequestParam String TO_HH,
            @ApiParam(name = "day", value = "지정일 목록", example = "[20210107,20210107]", required = true)
            @RequestParam List<String> day) {

        String fromHh = FROM_HH + "0000";
        String toHh = TO_HH + "5959";
        return this.serviceSpec.findAllLink15M(fromHh, toHh, day, LINK_ID);
    }

    @ApiOperation(value = "지정시각검색-링크 시간(TB_LINK_HH_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/spec/link-hh", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllLinkHHSpec(
            @ApiParam(name = "LINK_ID", value = "링크 ID", example = "2280168600", required = true)
            @RequestParam String LINK_ID,
            @ApiParam(name = "FROM_HH", value = "시작시간대(HH24)", example = "00", required = true)
            @RequestParam String FROM_HH,
            @ApiParam(name = "TO_HH", value = "종료시간대(HH24)", example = "23", required = true)
            @RequestParam String TO_HH,
            @RequestParam List<String> day) {

        String fromHh = FROM_HH + "0000";
        String toHh = TO_HH + "5959";
        return this.serviceSpec.findAllLinkHH(fromHh, toHh, day, LINK_ID);
    }

    //////////// 정보제공 링크 지정시각검색
    @ApiOperation(value = "지정시각검색-정보제공구간 15분(TB_IFSC_15M_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/spec/ifsc-15m", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllIfsc15MSpec(
            @ApiParam(name = "IFSC_ID", value = "정보제공구간 ID", example = "2200000259", required = true)
            @RequestParam String IFSC_ID,
            @ApiParam(name = "FROM_HH", value = "시작시간대(HH24)", example = "00", required = true)
            @RequestParam String FROM_HH,
            @ApiParam(name = "TO_HH", value = "종료시간대(HH24)", example = "23", required = true)
            @RequestParam String TO_HH,
            @RequestParam List<String> day) {

        String fromHh = FROM_HH + "0000";
        String toHh = TO_HH + "5959";
        return this.serviceSpec.findAllIfsc15M(fromHh, toHh, day, IFSC_ID);
    }

    @ApiOperation(value = "지정시각검색-정보제공구간 시간(TB_IFSC_HH_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/spec/ifsc-hh", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllIfscHHSpec(
            @ApiParam(name = "IFSC_ID", value = "정보제공구간 ID", example = "2200000259", required = true)
            @RequestParam String IFSC_ID,
            @ApiParam(name = "FROM_HH", value = "시작시간대(HH24)", example = "00", required = true)
            @RequestParam String FROM_HH,
            @ApiParam(name = "TO_HH", value = "종료시간대(HH24)", example = "23", required = true)
            @RequestParam String TO_HH,
            @RequestParam List<String> day) {

        String fromHh = FROM_HH + "0000";
        String toHh = TO_HH + "5959";
        return this.serviceSpec.findAllIfscHH(fromHh, toHh, day, IFSC_ID);
    }

    //////////// 도로 지정시각검색
    @ApiOperation(value = "지정시각검색-도로 15분(TB_ROAD_15M_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/spec/road-15m", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllRoad15MSpec(
            @ApiParam(name = "ROAD_ID", value = "도로 ID", example = "3200000023", required = true)
            @RequestParam String ROAD_ID,
            @ApiParam(name = "FROM_HH", value = "시작시간대(HH24)", example = "00", required = true)
            @RequestParam String FROM_HH,
            @ApiParam(name = "TO_HH", value = "종료시간대(HH24)", example = "23", required = true)
            @RequestParam String TO_HH,
            @RequestParam List<String> day) {

        String fromHh = FROM_HH + "0000";
        String toHh = TO_HH + "5959";
        return this.serviceSpec.findAllRoad15M(fromHh, toHh, day, ROAD_ID);
    }

    @ApiOperation(value = "지정시각검색-도로 시간(TB_ROAD_HH_STAT)", response = TrafficStatDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/spec/road-hh", produces = {"application/json; charset=utf8"})
    public List<TrafficStatDto> findAllRoadHHSpec(
            @ApiParam(name = "ROAD_ID", value = "도로 ID", example = "3200000023", required = true)
            @RequestParam String ROAD_ID,
            @ApiParam(name = "FROM_HH", value = "시작시간대(HH24)", example = "00", required = true)
            @RequestParam String FROM_HH,
            @ApiParam(name = "TO_HH", value = "종료시간대(HH24)", example = "23", required = true)
            @RequestParam String TO_HH,
            @RequestParam List<String> day) {

        String fromHh = FROM_HH + "0000";
        String toHh = TO_HH + "5959";
        return this.serviceSpec.findAllRoadHH(fromHh, toHh, day, ROAD_ID);
    }

}
