package com.blueland.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.blueland.bo.Role2userEntity;
import com.blueland.bo.RoleEntity;
import com.blueland.model.TPfRole;

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

/**
 * @auther xcy
 * @create 2022-05-09 15:01
 */
public interface IRoleService extends IService<TPfRole> {

    Page<RoleEntity> getAppRole(Map<String,Object> map, Integer curPage, Integer curPageSize);

    void deleteRole(Map<String, Object> queryParams);

    List<RoleEntity> findRoleUserBy(Map<String, Object> map);

    List<RoleEntity> findRolesByUser(String appId, String userId);

    void saveUser(Role2userEntity role2user);

    int findUserId(String appId, String roleId, String userId);

    int findAppidByRoleId(String appId, String roleId);

    int deleteUserId(String appId, String roleId, String userId);

    void deluser(String roleId, String appId);

    List<RoleEntity> findRoleTenantidByUserid(String userId);

    Map<String, Object> saveRoles(RoleEntity model);

    TPfRole get(RoleEntity bo);

    Page<RoleEntity> findPage(RoleEntity bo);

    // 6.0.0

    /**
     * 根据岗位编码获取角色集合 区分租户
     * @param appId
     * @param postCode
     * @return
     */
    List<RoleEntity> findRolesByPostCode(String appId, String postCode);

    /**
     * 根据岗位编码获取角色集合 不区分租户
     * @return
     */
    List<RoleEntity> findRoleAllByPostCode(String postCode);

    /**
     * 根据岗位编号删除用户
     * @param appId
     * @param roleId
     * @param postCode
     * @return
     */
    int deleteByPostCode(String appId, String roleId, String postCode);

    List<RoleEntity> findRoleUserByCode(String appId, String roleId, String postCode);

    void deleteByAppId(String appId);

    List<RoleEntity> findListByAppId(String appId);

}
