package com.cloudroam.mapper;
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.cloudroam.model.GroupDO;
|
import org.apache.ibatis.annotations.Param;
|
import org.springframework.stereotype.Repository;
|
|
import java.util.List;
|
|
/**
|
* @author
|
* @author
|
* 分组mapper接口
|
*/
|
@Repository
|
public interface GroupMapper extends BaseMapper<GroupDO> {
|
|
/**
|
* 获得用户的所有分组
|
*
|
* @param userId 用户id
|
* @return 所有分组
|
*/
|
List<GroupDO> selectGroupsByUserId(@Param("userId") Integer userId);
|
|
/**
|
* 获得用户的所有分组id
|
*
|
* @param userId 用户id
|
* @return 所有分组id
|
*/
|
List<Integer> selectUserGroupIds(@Param("userId") Integer userId);
|
|
/**
|
* 通过id获得分组个数
|
*
|
* @param id id
|
* @return 个数
|
*/
|
int selectCountById(@Param("id") Integer id);
|
|
/**
|
* 检查用户是否在该名称的分组里
|
*
|
* @param userId 用户id
|
* @param groupName 分组名
|
* @return 数量
|
*/
|
int selectCountUserByUserIdAndGroupName(@Param("userId") Integer userId, @Param("groupName") String groupName);
|
}
|