package com.zzsmart.qomo.kn.cost.manage.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostHourRate;
import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostHourRateMapper;
import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostHourRateService;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.stereotype.Service;
import org.ttzero.excel.manager.docProps.App;

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

/**
 * @Description: app_scene_cost_hour_rate
 * @Author: jeecg-boot
 * @Date: 2024-08-02
 * @Version: V1.0
 */
@Service
public class AppSceneCostHourRateServiceImpl extends ServiceImpl<AppSceneCostHourRateMapper, AppSceneCostHourRate> implements IAppSceneCostHourRateService {

    /**
     * 查询满足条件的一条小时费率信息
     *
     * @param appSceneCostHourRate
     * @return
     */
    @Override
    public Map<String,AppSceneCostHourRate> getOneHourRateInfo() {
        //QueryWrapper<AppSceneCostHourRate> queryWrapper = new QueryWrapper<>();
        List<AppSceneCostHourRate> appSceneCostHourRateList= this.query().list();
        Map<String, AppSceneCostHourRate> map=new HashMap<>();
        for (AppSceneCostHourRate appSceneCostHourRate:appSceneCostHourRateList){
            if(!map.containsKey(appSceneCostHourRate.getCostCenterCode())){
                map.put(appSceneCostHourRate.getCostCenterCode(),appSceneCostHourRate);
            }
        }
        return map;
    }
}
