package com.sunyard.ssp.modules.user.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sunyard.ssp.modules.user.entity.ScPermission;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author tsz
 * @since 2020-03-11
 */
public interface IScPermissionService extends IService<ScPermission> {

    public List<ScPermission> findByTypeAndStatusOrderBySortOrder(Integer type, Integer status);

    List<ScPermission> findByUserId(Long userId);

    /**
     * 通过层级查找
     * 默认升序
     * @param level
     * @return
     */
    List<ScPermission> findByLevelOrderBySortOrder(Integer level);

    /**
     * 通过parendId查找
     * @param parentId
     * @return
     */
    List<ScPermission> findByParentIdOrderBySortOrder(Long parentId);
}
