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

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

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

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

    default List<Long> listUnitIds(Collection<Long> unitIds){
        LambdaQueryWrapper<MhUnit> query = Wrappers.lambdaQuery(MhUnit.class)
                .select(MhUnit::getId)
                .in(MhUnit::getId,unitIds);
        return CollUtils.fieldList(list(query), MhUnit::getId);
    }

}
