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

import com.github.microservice.components.data.mongo.mongo.dao.MongoDao;
import com.zhongshu.card.server.core.dao.org.extend.UserGroupToUserDaoExtend;
import com.zhongshu.card.server.core.domain.org.OrganizationUser;
import com.zhongshu.card.server.core.domain.org.UserGroup;
import com.zhongshu.card.server.core.domain.org.UserGroupToUser;

import java.util.List;

/**
 * @author TRX
 * @date 2024/3/21
 */
public interface UserGroupToUserDao extends MongoDao<UserGroupToUser>, UserGroupToUserDaoExtend {

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

    UserGroupToUser findTopById(String id);

    UserGroupToUser findTopByUserGroupAndOrganizationUser(UserGroup userGroup, OrganizationUser organizationUser);

    long countByUserGroup(UserGroup userGroup);

    List<UserGroupToUser> findByUserIdAndProjectOid(String userId, String projectOid);

    List<UserGroupToUser> findByUserGroup(UserGroup userGroup);

    void deleteByUserGroup(UserGroup userGroup);
}
