package com.its.op.service.its.scrs;

import com.its.op.dao.mapper.its.scrs.ScSrvcStatisticsMapper;
import com.its.op.dto.its.scrs.ScSrvcDto;
import com.its.op.dto.its.scrs.ScSrvcParam;
import com.its.op.dto.its.scrs.ScSrvcPtrnDto;
import com.its.op.dto.its.scrs.ScSrvcPtrnParam;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@RequiredArgsConstructor
@Service
public class ScSrvcStatisticsService {

    private final ScSrvcStatisticsMapper mapper;

    public List<ScSrvcDto> findSrvc15M(List<String> ixrIds, String fromDt, String toDt) {
        ScSrvcParam param = ScSrvcParam.builder()
                .ixrIds(ixrIds)
                .fromDt(fromDt)
                .toDt(toDt)
                .build();
        return this.mapper.findSrvc15M(param);
    }

    public List<ScSrvcDto> findSrvcHH(List<String> ixrIds, String fromDt, String toDt) {
        ScSrvcParam param = ScSrvcParam.builder()
                .ixrIds(ixrIds)
                .fromDt(fromDt)
                .toDt(toDt)
                .build();
        return this.mapper.findSrvcHH(param);
    }

    public List<ScSrvcDto> findSrvcDD(List<String> ixrIds, String fromDt, String toDt) {
        ScSrvcParam param = ScSrvcParam.builder()
                .ixrIds(ixrIds)
                .fromDt(fromDt)
                .toDt(toDt)
                .build();
        return this.mapper.findSrvcDD(param);
    }

    public List<ScSrvcDto> findSrvcMN(List<String> ixrIds, String fromDt, String toDt) {
        ScSrvcParam param = ScSrvcParam.builder()
                .ixrIds(ixrIds)
                .fromDt(fromDt)
                .toDt(toDt)
                .build();
        return this.mapper.findSrvcMN(param);
    }

    /**
     * 패턴 서비스 수준 데이터 비교
     * @param ixrId
     * @param baseDay
     * @param compDay
     * @return
     */
    public List<ScSrvcPtrnDto> findSrvcPtrnCompare(String ixrId, String baseDay, String compDay) {
        ScSrvcPtrnParam param = ScSrvcPtrnParam.builder()
                .ixrId(ixrId)
                .baseDay(baseDay)
                .compDay(compDay)
                .build();
        return this.mapper.findSrvcPtrnCompare(param);
    }
}
