package org.jeecg.modules.stm.audit.service.impl;

import org.jeecg.modules.stm.audit.entity.AuditCheckMethodItem;
import org.jeecg.modules.stm.audit.mapper.AuditCheckMethodItemMapper;
import org.jeecg.modules.stm.audit.service.IAuditCheckMethodItemService;
import org.springframework.stereotype.Service;

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

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

/**
 * @Description: 检查方法条目
 * @Author: jeecg-boot
 * @Date:   2024-10-10
 * @Version: V1.0
 */
@Service
public class AuditCheckMethodItemServiceImpl extends ServiceImpl<AuditCheckMethodItemMapper, AuditCheckMethodItem> implements IAuditCheckMethodItemService {

    @Override
    public List<Map<String,Object>> getAllCheckMethodByItem(AuditCheckMethodItem item){
        List<Map<String,Object>> list = this.baseMapper.getAllCheckMethodByItem(item);
        return  list;
    }
    @Override
    public List<Map<String,Object>> getAllCheckMethod(AuditCheckMethodItem item){
        List<Map<String,Object>> list = this.baseMapper.getAllCheckMethod(item);
        return  list;
    }
    @Override
    public List<Map<String,Object>> getAllCheckMethodFiles(AuditCheckMethodItem item){
        List<Map<String,Object>> list = this.baseMapper.getAllCheckMethodFiles(item);
        return  list;
    }

    @Override
    public Map<Integer,Integer> getAllCheckItemCount(){
        List<Map<String,Object>> list = this.baseMapper.getAllCheckItemCount();
        Map<Integer,Integer> retMap = new HashMap<>();
        for(Map<String,Object> item:list) {
            Integer checkId = Integer.valueOf(item.get("checkid").toString());
            Integer cnt = Integer.valueOf(item.get("cnt").toString());
            retMap.put(checkId,cnt);
        }
        return  retMap;
    }





}
