tj
2025-06-05 2d549a04870d1315868a7cf19952b64e8071e711
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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);
}