package com.its.op.service.its.statistics;

import com.its.op.dto.its.statistics.TrafficStatDto;
import com.its.op.dao.mapper.its.statistics.TrafficHourStatisticsMapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Slf4j
@RequiredArgsConstructor
@Service
public class TrafficHourStatisticsService {

    private final TrafficHourStatisticsMapper mapper;

    public List<TrafficStatDto> findAllLink15M(String fromDt, String toDt, String fromHh, String toHh, String LINK_ID) {
        Map<String, String> param = new HashMap<>();
        param.put("FROM_DT", fromDt);
        param.put("TO_DT", toDt);
        param.put("FROM_HH", fromHh);
        param.put("TO_HH", toHh);
        param.put("LINK_ID", LINK_ID);
        return this.mapper.findAllLink15M(param);
    }
    public List<TrafficStatDto> findAllLinkHH(String fromDt, String toDt, String fromHh, String toHh, String LINK_ID) {
        Map<String, String> param = new HashMap<>();
        param.put("FROM_DT", fromDt);
        param.put("TO_DT", toDt);
        param.put("FROM_HH", fromHh);
        param.put("TO_HH", toHh);
        param.put("LINK_ID", LINK_ID);
        return this.mapper.findAllLinkHH(param);
    }

    public List<TrafficStatDto> findAllIfsc15M(String fromDt, String toDt, String fromHh, String toHh, String IFSC_ID) {
        Map<String, String> param = new HashMap<>();
        param.put("FROM_DT", fromDt);
        param.put("TO_DT", toDt);
        param.put("FROM_HH", fromHh);
        param.put("TO_HH", toHh);
        param.put("IFSC_ID", IFSC_ID);
        return this.mapper.findAllIfsc15M(param);
    }
    public List<TrafficStatDto> findAllIfscHH(String fromDt, String toDt, String fromHh, String toHh, String IFSC_ID) {
        Map<String, String> param = new HashMap<>();
        param.put("FROM_DT", fromDt);
        param.put("TO_DT", toDt);
        param.put("FROM_HH", fromHh);
        param.put("TO_HH", toHh);
        param.put("IFSC_ID", IFSC_ID);
        return this.mapper.findAllIfscHH(param);
    }

    public List<TrafficStatDto> findAllRoad15M(String fromDt, String toDt, String fromHh, String toHh, String ROAD_ID) {
        Map<String, String> param = new HashMap<>();
        param.put("FROM_DT", fromDt);
        param.put("TO_DT", toDt);
        param.put("FROM_HH", fromHh);
        param.put("TO_HH", toHh);
        param.put("ROAD_ID", ROAD_ID);
        return this.mapper.findAllRoad15M(param);
    }
    public List<TrafficStatDto> findAllRoadHH(String fromDt, String toDt, String fromHh, String toHh, String ROAD_ID) {
        Map<String, String> param = new HashMap<>();
        param.put("FROM_DT", fromDt);
        param.put("TO_DT", toDt);
        param.put("FROM_HH", fromHh);
        param.put("TO_HH", toHh);
        param.put("ROAD_ID", ROAD_ID);
        return this.mapper.findAllRoadHH(param);
    }

}
