|
@@ -24,8 +24,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
(select count(1) from tb_publish_thumbs t where t.publish_id = p.id) thumbs
|
|
|
from tb_my_publish p ${ew.customSqlSegment}
|
|
|
</select>
|
|
|
-<!-- 族友圈列表-->
|
|
|
- <select id="selectPublish" resultType="com.ruoyi.app.domain.TbMyPublish">
|
|
|
+ <!-- 指定家族的 族友圈列表-->
|
|
|
+ <select id="selectFamilyPublish" resultType="com.ruoyi.app.domain.TbMyPublish">
|
|
|
select b.*,(case when message = 'Y' then concat('#给',nick_name,'的留言纪念') else '' end) message_content
|
|
|
from (
|
|
|
select a.*,
|
|
@@ -62,5 +62,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
left join tb_family_member m on m.app_user_id = a.app_user_id
|
|
|
) b
|
|
|
</select>
|
|
|
+ <!-- 所在家族的 族友圈列表-->
|
|
|
+ <select id="selectPublish" resultType="com.ruoyi.app.domain.TbMyPublish">
|
|
|
+ select b.*,(case when message = 'Y' then concat('#给',nick_name,'的留言纪念') else '' end) message_content
|
|
|
+ from (
|
|
|
+ select a.*,
|
|
|
+ m.id member_id,
|
|
|
+ m.name,
|
|
|
+ u.nick_name nick_name,
|
|
|
+ u.avatar avatar,
|
|
|
+ (select max(family_id) from tb_member_middle mi where mi.member_id = m.id and mi.acquiesce = 'Y') family_id,
|
|
|
+ (select nick_name from tb_app_user us where us.id = a.message_user_id)message_user,
|
|
|
+ (select avatar from tb_app_user us where us.id = a.message_user_id)message_user_avatar,
|
|
|
+ (select count(1) from tb_publish_thumbs where publish_id = a.id)thumbs
|
|
|
+ from (
|
|
|
+ select p.* from tb_my_publish p
|
|
|
+ where deleted = 'N' and app_user_id = #{appUserId}
|
|
|
+ union
|
|
|
+ select p.* from tb_my_publish p
|
|
|
+ where deleted = 'N' and app_user_id in (
|
|
|
+ select f.app_user_id uid from tb_my_friends f where friends_user_id = #{appUserId} and status = 2
|
|
|
+ union all
|
|
|
+ select g.friends_user_id uid from tb_my_friends g where app_user_id = #{appUserId} and status = 2
|
|
|
+ )
|
|
|
+
|
|
|
+ union
|
|
|
+
|
|
|
+ select p.* from tb_my_publish p
|
|
|
+ where deleted = 'N' and app_user_id in (
|
|
|
+ select u.id from tb_app_user u
|
|
|
+ left join tb_family_member m on u.id = m.app_user_id
|
|
|
+ left join tb_member_middle mi on m.id = mi.member_id
|
|
|
+ where deleted = 'N' and mi.status = 2
|
|
|
+ )
|
|
|
+ ) a
|
|
|
+ left join tb_app_user u on u.id = a.app_user_id
|
|
|
+ left join tb_family_member m on m.app_user_id = a.app_user_id
|
|
|
+ ) b
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|