package com.tofly.xrtygis.custom.service.impl;

import com.tofly.xrtygis.custom.mapper.UnitMapper;
import com.tofly.xrtygis.custom.service.CustomUnitService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

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

/**
 * @author 陈浩
 * @date 2021/4/26
 */
@Service
@AllArgsConstructor
public class CustomUnitServiceImpl implements CustomUnitService {

    private final UnitMapper unitMapper;

    /**
     * 查询制水单耗
     *
     * @param month 实际指标单耗填报信息
     * @return true of false
     */
    @Override
    public Map<String, Object> viewUnit(String month) {
        Map<String, Object> result = new HashMap<>(4);

        result.put("finance",unitMapper.selectFinance(month));

        result.put("real",unitMapper.selectReal(month));

        result.put("plan",unitMapper.selectPlan(month));

        result.put("resultSet", unitMapper.viewReals(month));

        return result;
    }

}
