package com.hz.pm.api.expert.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.expert.entity.ExpertGovBusinessStrip;

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

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author Liuxinxin
 * @since 2023-04-17
 */
public interface IExpertGovBusinessStripService extends IService<ExpertGovBusinessStrip> {

    default List<ExpertGovBusinessStrip> listByUserIds(Collection<Long> userIds) {
        LambdaQueryWrapper<ExpertGovBusinessStrip> query = Wrappers
                .lambdaQuery(ExpertGovBusinessStrip.class)
                .in(ExpertGovBusinessStrip::getExpertUserId, userIds);
        return list(query);
    }

    default boolean removeByUserId(Long userId) {
        LambdaQueryWrapper<ExpertGovBusinessStrip> query = Wrappers.lambdaQuery(ExpertGovBusinessStrip.class)
                .eq(ExpertGovBusinessStrip::getExpertUserId, userId);
        return remove(query);
    }

}
