package com.zhongshu.card.server.core.dao.org;

import com.github.microservice.auth.security.type.AuthType;
import com.github.microservice.components.data.mongo.mongo.dao.MongoDao;
import com.zhongshu.card.client.type.DataState;
import com.zhongshu.card.server.core.dao.org.extend.RoleDaoExtend;
import com.zhongshu.card.server.core.dao.org.extend.UserCountDaoExtend;
import com.zhongshu.card.server.core.domain.org.Organization;
import com.zhongshu.card.server.core.domain.org.Role;

import java.util.List;

/**
 * @author TRX
 * @date 2024/3/21
 */
public interface RoleDao extends MongoDao<Role>, RoleDaoExtend {

    Role findTopById(String id);

    List<Role> findByStateOrderBySortAsc(DataState state);

    List<Role> findByAuthTypeOrderBySortAsc(AuthType authType);

    List<Role> findByOidOrderBySortAsc(String oid);

    List<Role> findByAuthTypeAndStateOrderBySortAsc(AuthType authType, DataState state);

    Role findTopByNameAndOid(String name, String oid);

    Role findTopByCodeAndOid(String code, String oid);

    List<Role> findByOidAndIdIn(String oid, List<String> ids);

    List<Role> findByIdIn(List<String> ids);

    List<Role> findByOidAndNameIn(String oid, List<String> names);

    List<Role> findByOidAndIsAdmin(String oid, Boolean isAdmin);
}
