package com.bonus.zlpt.bigscreen.service.impl;

import com.bonus.zlpt.bigscreen.domain.vo.CompanyInfoVo;
import com.bonus.zlpt.bigscreen.mapper.BmMachinistInfoMapper;
import com.bonus.zlpt.bigscreen.service.BmMachinistInfoService;
import com.bonus.zlpt.company.api.enums.CompanyLtdEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 机手信息表(BmMachinistInfo)表服务实现类
 *
 * @author makejava
 * @since 2023-11-30 12:06:58
 */
@Service("bmMachinistInfoService")
public class BmMachinistInfoServiceImpl implements BmMachinistInfoService {

    @Autowired
    private BmMachinistInfoMapper infoMapper;

    /**
     * 获取企业对应的机手数量
     * @return
     */
    @Override
    public List<CompanyInfoVo> selectMachinistInfoList() {
        List<CompanyInfoVo> list = infoMapper.selectMachinistInfoList();
        ArrayList<CompanyInfoVo> companyInfoVos = new ArrayList<>();
        for (CompanyInfoVo companyInfoVo : list) {
            companyInfoVo.setOwnCo(CompanyLtdEnum.getNameByCode(Integer.parseInt(companyInfoVo.getOwnCo())));
        }
        return companyInfoVos;
    }
}

