package com.its.api.its.service.statistics;

import com.its.api.its.model.dto.statistics.IncidentSectStatDto;
import com.its.api.its.model.dto.statistics.IncidentTypeStatDto;
import com.its.api.its.repository.statistics.IncidentStatisticsMapper;
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 IncidentStatisticsService {

    private final IncidentStatisticsMapper mapper;

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

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

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

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

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

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

}
