package com.its.op.service.its.vds;

import com.its.op.dto.its.vds.VdsDtctTfvlDayDto;
import com.its.op.dto.its.vds.VdsDtctTfvlHourDto;
import com.its.op.dto.its.vds.VdsDtctTfvlMonthDto;
import com.its.op.dao.mapper.its.vds.VdsDtctTfvlStatMapper;
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 VdsDtctTfvlStatService {

    private final VdsDtctTfvlStatMapper mapper;

    public List<VdsDtctTfvlHourDto> findAllHourStatByDateRange(String fromDt, String toDt) {
        Map<String, String> param = new HashMap<>();
        param.put("FROM_DT", fromDt);
        param.put("TO_DT", toDt);
        return this.mapper.findAllHourStatByDateRange(param);
    }

    public List<VdsDtctTfvlDayDto> findAllDayStatByDateRange(String fromDt, String toDt, String fromHm, String toHm) {
        Map<String, String> param = new HashMap<>();
        param.put("FROM_DT", fromDt);
        param.put("TO_DT", toDt);
        param.put("FROM_HM", fromHm);
        param.put("TO_HM", toHm);
        return this.mapper.findAllDayStatByDateRange(param);
    }

    public List<VdsDtctTfvlMonthDto> findAllMonthStatByDateRange(String fromDt, String toDt) {
        Map<String, String> param = new HashMap<>();
        param.put("FROM_DT", fromDt);
        param.put("TO_DT", toDt);
        return this.mapper.findAllMonthStatByDateRange(param);
    }
}
