package org.jeecg.modules.fbsAbnormalWorkingHours.service.impl;

import org.jeecg.modules.fbsAbnormalWorkingHours.entity.FbsAbnormalWorkingHoursDescribe;
import org.jeecg.modules.fbsAbnormalWorkingHours.mapper.FbsAbnormalWorkingHoursDescribeMapper;
import org.jeecg.modules.fbsAbnormalWorkingHours.service.IFbsAbnormalWorkingHoursDescribeService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

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

/**
 * @Description: 异常工时描述
 * @author： jeecg-boot
 * @date：   2020-10-14
 * @version： V1.0
 */
@Service
public class FbsAbnormalWorkingHoursDescribeServiceImpl extends ServiceImpl<FbsAbnormalWorkingHoursDescribeMapper, FbsAbnormalWorkingHoursDescribe> implements IFbsAbnormalWorkingHoursDescribeService {

    @Resource
    FbsAbnormalWorkingHoursDescribeMapper fbsAbnormalWorkingHoursDescribeMapper;

    @Override
    public Map<String, Object> getMonthExceptionByCategory() {
        Map<String,Object> map=new HashMap<>();
        List<FbsAbnormalWorkingHoursDescribe> fbsAbnormalWorkingHoursDescribeMapperList=fbsAbnormalWorkingHoursDescribeMapper.getMonthExceptionByCategory();
        if(fbsAbnormalWorkingHoursDescribeMapperList!=null){
            for(FbsAbnormalWorkingHoursDescribe fbsAbnormalWorkingHoursDescribe:fbsAbnormalWorkingHoursDescribeMapperList){
                map.put(fbsAbnormalWorkingHoursDescribe.getProduct(),fbsAbnormalWorkingHoursDescribe.getTotal());
            }
        }
        return map;
    }

    @Override
    public List<FbsAbnormalWorkingHoursDescribe> getListAndMain(FbsAbnormalWorkingHoursDescribe fbsAbnormalWorkingHoursDescribe) {
        return fbsAbnormalWorkingHoursDescribeMapper.getListAndMain(fbsAbnormalWorkingHoursDescribe);
    }

    @Override
    public List<Map<String, Object>> getMonthExceptionByCategoryTwo() {
        return fbsAbnormalWorkingHoursDescribeMapper.getMonthExceptionByCategoryTwo();
    }
}
