package com.elephant.framework.galaxy.aroad.module.zhtj.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.elephant.framework.galaxy.aroad.module.zhtj.entity.ZhtjZhzsLnsj;
import com.elephant.framework.galaxy.aroad.module.zhtj.mapper.ZhtjZhzsLnsjMapper;
import com.elephant.framework.galaxy.aroad.module.zhtj.service.ZhtjZhzsLnsjService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

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

/**
 * 历年数据
 *
 * @author xuzhitu
 * @date 2019-04-16 17:23:38
 */
@Service
@AllArgsConstructor
public class ZhtjZhzsLnsjServiceImpl extends ServiceImpl<ZhtjZhzsLnsjMapper, ZhtjZhzsLnsj> implements ZhtjZhzsLnsjService {

    private final ZhtjZhzsLnsjMapper zhtjZhzsLnsjMapper;

    @Override
    public List<ZhtjZhzsLnsj> getListByYear(String year) {
        List<ZhtjZhzsLnsj> aaa =  zhtjZhzsLnsjMapper.getListByYear(year);
        return aaa;
    }

    /**
     * 获取全省与普通国省道历年数据
     * @param zhtjZhzsLnsj
     * @return
     */
    @Override
    public Map<String, List<ZhtjZhzsLnsj>> selectLnsj(ZhtjZhzsLnsj zhtjZhzsLnsj) {

        List<ZhtjZhzsLnsj> qs = zhtjZhzsLnsjMapper.getListByYear(zhtjZhzsLnsj.getYear());
        List<ZhtjZhzsLnsj> ptgsd = zhtjZhzsLnsjMapper.selectListForPtgsd(zhtjZhzsLnsj);
        Map<String,List<ZhtjZhzsLnsj>> map = new HashMap<>();
        map.put("qs",qs);
        map.put("ptgsd",ptgsd);

        return map;
    }
}
