package com.hz.pm.api.user.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hz.pm.api.user.model.entity.MhCompany;
import com.ningdatech.basic.util.CollUtils;

import java.util.Collection;
import java.util.List;

/**
 * <p>
 * 组织表 服务类
 * </p>
 *
 * @author CMM
 * @since 2023-12-25
 */
public interface IMhCompanyService extends IService<MhCompany> {

    default List<String> listById(Collection<String> companyIds) {
        LambdaQueryWrapper<MhCompany> query = Wrappers.lambdaQuery(MhCompany.class)
                .select(MhCompany::getId)
                .in(MhCompany::getId, companyIds);
        return CollUtils.fieldList(list(query), MhCompany::getId);
    }

}
