package com.xhpc.activity.service.impl;

import com.xhpc.activity.mapper.XhpcChargingStationMapper;
import com.xhpc.activity.service.StationLogService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Service
public class StationLogServiceImpl implements StationLogService {

    @Resource
    XhpcChargingStationMapper stationMapper;

    @Override
    public List<Map<String, Object>> getStationPage(Map<String, Object> params){
        return stationMapper.selectXhpcChargingStationList(params);
    }


    @Override
    public List<Map<String, Object>> getStationRatePage(Long stationId){
        return stationMapper.selectRateListByStationId(stationId);
    }


    @Override
    public Map<String, Object> getRateInfo(int rateId){
        Map<String, Object> resData = new HashMap<>();
        resData.put("base", stationMapper.selectBaseRateTimeListByRateId(rateId));
        resData.put("current", stationMapper.selectRateTimeListByRateId(rateId));

        return resData;
    }
}
