|
@@ -12,11 +12,27 @@
|
|
|
(select count(1) as articleCount from community_article d where d.user_id = a.user_id) as articleCount
|
|
|
from sys_user a
|
|
|
left join community_user_info b on a.user_id = b.user_id
|
|
|
+ left join community_user_privacy c on a.user_id = c.user_id
|
|
|
<if test="searchValue != null and searchValue != ''">
|
|
|
<where>
|
|
|
- a.nick_name like concat('%', #{searchValue}, '%')
|
|
|
- or b.user_id like concat('%', #{searchValue}, '%')
|
|
|
+ IFNULL(c.is_accounts,0)= 0 and a.user_name like concat('%', #{searchValue}, '%')
|
|
|
</where>
|
|
|
</if>
|
|
|
+ union all
|
|
|
+ select
|
|
|
+ b.id as id,
|
|
|
+ a.nick_name as nickName,
|
|
|
+ a.avatar as avatar,
|
|
|
+ (select count(1) as fansCount from community_user_like c where c.like_user_id = a.user_id) as fansCount,
|
|
|
+ (select count(1) as articleCount from community_article d where d.user_id = a.user_id) as articleCount
|
|
|
+ from sys_user a
|
|
|
+ left join community_user_info b on a.user_id = b.user_id
|
|
|
+ left join community_user_privacy c on a.user_id = c.user_id
|
|
|
+ <if test="searchValue != null and searchValue != ''">
|
|
|
+ <where>
|
|
|
+ IFNULL(c.is_names,0) = 0 and a.nick_name like concat('%', #{searchValue}, '%')
|
|
|
+ </where>
|
|
|
+ </if>
|
|
|
+
|
|
|
</select>
|
|
|
</mapper>
|