package egovframework.service.impl;

import egovframework.service.CommonService;
import egovframework.service.mapper.CommonMapper;
import egovframework.vo.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
import org.springframework.stereotype.Service;

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

@Slf4j
@RequiredArgsConstructor
@Service
public class CommonServiceImpl extends EgovAbstractServiceImpl implements CommonService {

    private final CommonMapper commonMapper;

    public Map<String, Object> getWeatherInfo() {
        Map<String, Object> resultMap = new HashMap<>();
        resultMap.put("weather", this.commonMapper.getWeatherInfo());
        resultMap.put("atmp", this.commonMapper.getAtmpInfo());
        return resultMap;
    }

    @Override
    public List<RoadVertexArrVO> getVertexArr() {
        return this.commonMapper.getVertexArr();
    }

    @Override
    public List<VmsCtlrVO> getVmsCtlr() {
        return this.commonMapper.getVmsCtlr();
//        List<VmsCtlrVO> vmsPhaseImgList = this.commonMapper.getVmsPhaseImgList();
//        return vmsCtlrVO;
    }

    @Override
    public List<CctvCtlrVO> getCctvCtlr() {
        return this.commonMapper.getCctvCtlr();
    }

    @Override
    public CctvCtlrVO getOneCctvCtlr(String nmbr) {
        return this.commonMapper.getOneCctvCtlr(nmbr);
    }

    @Override
    public List<WcamCtlrVO> getWcamCtlr() {
        return this.commonMapper.getWcamCtlr();
    }

    @Override
    public List<IncdVO> getIncdOcrr() {
        return this.commonMapper.getIncdOcrr();
    }

    @Override
    public List<AtrdVO> getAtrdNm() {
        return this.commonMapper.getAtrdNm();
    }

    @Override
    public List<ParkingInfoVO> getParkingInfo() {
        return this.commonMapper.getParkingInfo();
    }

    @Override
    public List<ParkingInfoVO> rtParking() {
        return this.commonMapper.rtParking();
    }

    @Override
    public NewParkinginfoVO getNewParkingInfo(String parkId) {
        return this.commonMapper.getNewParkingInfo(parkId);
    }

    @Override
    public List<NewParkingOccVO> getNewParkingOcc(String parkId) {
        return this.commonMapper.getNewParkingOcc(parkId);
    }

    @Override
    public void insertUpdateLogWeb(Map<String, Object> paramMap) {
        this.commonMapper.insertUpdateHourLogWeb(paramMap);
        this.commonMapper.insertUpdateDateLogWeb(paramMap);
        this.commonMapper.insertUpdateMonthLogWeb(paramMap);
    }


    @Override
    public List<RoadVertexArrVO> getLinkVertexArr() {
        return this.commonMapper.getLinkVertexArr();
    }
//	public List<RoadVertexArrVO> getLinkVertexArr(Map<String, Object> paramMap) {
//
//		return this.commonMapper.getLinkVertexArr(paramMap);
//	}

    @Override
    public List<RoadVertexArrVO> getIfscVertexArr() {

        return this.commonMapper.getIfscVertexArr();
    }
//	public List<RoadVertexArrVO> getIfscVertexArr(Map<String, Object> paramMap) {
//
//		return this.commonMapper.getIfscVertexArr(paramMap);
//	}

    @Override
    public List<RoadVertexArrVO> getRoadVertexArr() {

        return this.commonMapper.getRoadVertexArr();
    }
//	public List<RoadVertexArrVO> getRoadVertexArr(Map<String, Object> paramMap) {
//
//		return this.commonMapper.getRoadVertexArr(paramMap);
//	}

    @Override
    public List<TaasVO> getTaasInfo() {
        return this.commonMapper.getTaasInfo();
    }

    @Override
    public List<VmsCtlrVO> getVmsImgTxt(String vms_ctlr_nmbr) {
        return this.commonMapper.getVmsImgTxt(vms_ctlr_nmbr);
    }

    @Override
    public List<CongestTrafficVO> findAllCongestTraffic() {
        return this.commonMapper.findAllCongestTraffic();
    }

    @Override
    public VisitCountVO getVisitCount() {
        return this.commonMapper.getVisitCount();
    }

}