package com.hz.pm.api.gov.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ningdatech.basic.util.CollUtils;
import com.hz.pm.api.gov.entity.BelongOrg;
import com.hz.pm.api.gov.mapper.BelongOrgMapper;
import com.hz.pm.api.gov.service.IBelongOrgService;
import org.springframework.stereotype.Service;

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

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author liuxinxin
 * @since 2023-04-18
 */
@Service
public class BelongOrgServiceImpl extends ServiceImpl<BelongOrgMapper, BelongOrg> implements IBelongOrgService {

    @Override
    public List<String> listNameByCodes(Collection<String> stripCodes) {
        LambdaQueryWrapper<BelongOrg> query = Wrappers.lambdaQuery(BelongOrg.class)
                .in(BelongOrg::getOrgCode, stripCodes);
        return CollUtils.fieldList(list(query), BelongOrg::getOrgName);
    }

}
