package com.qmth.paper.library.common.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.qmth.paper.library.common.bean.params.SysRoleGroupMemberMatchParams;
import com.qmth.paper.library.common.bean.params.SysRoleGroupMemberParams;
import com.qmth.paper.library.common.bean.result.SysRoleGroupMemberMatchResult;
import com.qmth.paper.library.common.bean.result.SysRoleGroupMemberResult;
import com.qmth.paper.library.common.entity.SysRoleGroupMember;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 角色组成员表 服务类
 * </p>
 *
 * @author wangliang
 * @since 2022-03-08
 */
public interface SysRoleGroupMemberService extends IService<SysRoleGroupMember> {

    /**
     * 保存或修改
     *
     * @param roleGroupMemberParams
     * @return
     */
    public boolean saveOrUpdate(SysRoleGroupMemberParams roleGroupMemberParams);

    /**
     * 根据roleId和name查找数据
     *
     * @param roleId
     * @param name
     * @return
     */
    public List<SysRoleGroupMemberResult> findByRoleIdAndName(Long roleId, String name);

    /**
     * 根据ids count数据
     *
     * @param ids
     * @return
     */
    public int findByIdsCount(List<Long> ids);

    /**
     * 根据roleId和userId查找数据
     *
     * @param roleId
     * @param userId
     * @return
     */
    public List<SysRoleGroupMember> findByRoleIdAndUserId(Long roleId, Long userId);

    /**
     * 根据roleIds和memberId查找数据
     *
     * @param roleIds
     * @param memberId
     * @return
     */
    public List<SysRoleGroupMember> findByRoleIdsAndMemberId(List<Long> roleIds, Long memberId);

    /**
     * 根据roleIds和memberIds查找数据
     *
     * @param roleIds
     * @param memberIds
     * @return
     */
    public List<SysRoleGroupMember> findByRoleIdsAndMemberIds(List<Long> roleIds, List<Long> memberIds);

    /**
     * 流程数据组匹配查询
     *
     * @param roleGroupMemberMatchParams
     * @return
     */
    public Map<String, SysRoleGroupMemberMatchResult> matchList(SysRoleGroupMemberMatchParams roleGroupMemberMatchParams);
}
