package com.its.op.service.its.atrd;

import com.its.op.dto.its.atrd.AtrdStatDailyDto;
import com.its.op.dto.its.atrd.AtrdStatHourlyDto;
import com.its.op.dao.mapper.its.atrd.AtrdStatisticsMapper;
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 AtrdStatisticsService {

    private final AtrdStatisticsMapper mapper;

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

    public List<AtrdStatDailyDto> findAllDaily(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.findAllDaily(param);
    }

}
