|
@@ -133,12 +133,13 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="queryFriendListByUserIdV2" resultMap="ImUserFriendDto">
|
|
|
- SELECT iuf.*,u.real_name_,u.avatar_,u.phone_,u.user_type_,st.member_rank_setting_id_,s.name_ subject_name_,st.subject_id_list_ subject_id_
|
|
|
+ SELECT distinct iuf.*,u.real_name_,u.avatar_,u.phone_,u.user_type_,st.member_rank_setting_id_,s.name_ subject_name_,st.subject_id_list_ subject_id_
|
|
|
FROM im_user_friend iuf
|
|
|
LEFT JOIN sys_user u ON iuf.friend_id_ = u.id_
|
|
|
LEFT JOIN student st ON st.user_id_ = u.id_
|
|
|
+ left join class_group_student_mapper cgs on cgs.user_id_ = st.user_id_
|
|
|
LEFT JOIN `subject` s ON s.id_ = st.subject_id_list_
|
|
|
- WHERE iuf.user_id_ = #{userId}
|
|
|
+ WHERE iuf.user_id_ = #{userId} and st.user_id_ is not null
|
|
|
<if test="search != null">
|
|
|
and (u.real_name_ like concat('%',#{search},'%') or iuf.friend_nickname_ like concat('%',#{search},'%'))
|
|
|
</if>
|
|
@@ -146,7 +147,7 @@
|
|
|
and st.subject_id_list_ = #{subjectId}
|
|
|
</if>
|
|
|
<if test="musicGroupId != null and musicGroupId != ''">
|
|
|
- and st.music_group_id_ = #{musicGroupId}
|
|
|
+ and cgs.music_group_id_ = #{musicGroupId}
|
|
|
</if>
|
|
|
<if test="vipFlag != null">
|
|
|
<if test="vipFlag">
|