package com.engine.organization.transmethod;

import com.engine.organization.entity.DeleteParam;
import com.engine.organization.mapper.scheme.LevelMapper;
import com.engine.organization.util.db.MapperProxyFactory;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @description:
 * @author:dxfeng
 * @createTime: 2022/05/12
 * @version: 1.0
 */
public class LevelTransMethod {

    public static String getLevelId(String levelId) {
        LevelMapper levelMapper = MapperProxyFactory.getProxy(LevelMapper.class);
        List<Map<String, Object>> maps = levelMapper.listLevelsByIds(DeleteParam.builder().ids(levelId).build().getIds());
        String levelName = maps.stream().map(item -> (String) item.get("name")).collect(Collectors.joining(","));
        return levelName;
    }
}
