|
@@ -4,6 +4,23 @@
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.ruoyi.generator.mapper.community.CommunityUserInfoMapper">
|
|
|
<select id="selectUserBySearchValue" resultType="com.ruoyi.generator.vo.CommunityUserInfoVo">
|
|
|
+ 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
|
|
|
+ <if test="searchValue != null and searchValue != ''">
|
|
|
+ <where>
|
|
|
+ a.nick_name like concat('%', #{searchValue}, '%')
|
|
|
+ or b.user_id like concat('%', #{searchValue}, '%')
|
|
|
+ </where>
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </select>
|
|
|
+ <select id="selectUsersByAccountOrName" resultType="com.ruoyi.generator.vo.CommunityUserInfoVo">
|
|
|
select
|
|
|
b.id as id,
|
|
|
a.nick_name as nickName,
|
|
@@ -33,6 +50,5 @@
|
|
|
IFNULL(c.is_names,0) = 0 and a.nick_name like concat('%', #{searchValue}, '%')
|
|
|
</where>
|
|
|
</if>
|
|
|
-
|
|
|
</select>
|
|
|
-</mapper>
|
|
|
+</mapper>
|