package com.lantone.qc.dbanaly.lt.facade;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lantone.qc.dbanaly.lt.entity.Mode;
import com.lantone.qc.dbanaly.lt.service.impl.ModeServiceImpl;
import org.springframework.stereotype.Component;

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

/**
 * @Description:
 * @author: rengb
 * @time: 2020/6/4 9:53
 */
@Component
public class ModeFacade extends ModeServiceImpl {

    public Map<Long, String> getModeMap() {
        QueryWrapper<Mode> modeQe = new QueryWrapper<>();
        modeQe.eq("is_deleted", "N");
        return list(modeQe).stream().collect(Collectors.toMap(i -> i.getId(), i -> i.getName()));
    }

}