|
|
@@ -15,7 +15,8 @@ import java.util.List;
|
|
|
@Mapper
|
|
|
public interface LifeFansMapper extends BaseMapper<LifeFans> {
|
|
|
|
|
|
- @Select("select foll.*,lb.id blackListid, if(isnull(fans.id), 0, 1) isFollowMe, 1 as isFollowThis, " +
|
|
|
+ @Select("select MAX(foll.id) id, MAX(foll.name) name, MAX(foll.image) image, foll.phoneId, MAX(foll.blurb) blurb, MAX(foll.blockedType) blockedType, MAX(foll.blockedId) blockedId, MAX(foll.username) username, MAX(foll.accountBlurb) accountBlurb, " +
|
|
|
+ " MAX(lb.id) blackListid, MAX(if(isnull(fans.id), 0, 1)) isFollowMe, 1 as isFollowThis, " +
|
|
|
" (select count(1) from life_fans where fans_id= foll.phoneId and delete_flag =0) followNum, " +
|
|
|
" (select count(1) from life_fans where followed_id= foll.phoneId and delete_flag =0) fansNum from ( " +
|
|
|
" with follow as ( " +
|
|
|
@@ -63,7 +64,8 @@ public interface LifeFansMapper extends BaseMapper<LifeFans> {
|
|
|
"left join life_fans fans on fans.fans_id = foll.phoneId and fans.followed_id = #{fansId} and fans.delete_flag = 0 ")
|
|
|
List<LifeFansVo> getMyFollowedAll(@Param("fansId") String fansId);
|
|
|
|
|
|
- @Select("select foll.*,lb.id blackListid, if(isnull(fans.id), 0, 1) isFollowThis, 1 as isFollowMe, " +
|
|
|
+ @Select("select MAX(foll.id) id, MAX(foll.name) name, MAX(foll.image) image, foll.phoneId, MAX(foll.blurb) blurb, MAX(foll.blockedType) blockedType, MAX(foll.blockedId) blockedId, " +
|
|
|
+ " MAX(lb.id) blackListid, MAX(if(isnull(fans.id), 0, 1)) isFollowThis, 1 as isFollowMe, " +
|
|
|
" (select count(1) from life_fans fans2 where fans2.followed_id = foll.phoneId and fans2.delete_flag = 0) fansNum, " +
|
|
|
" (select count(1) from life_fans fans3 where fans3.fans_id = foll.phoneId and fans3.delete_flag = 0) followNum " +
|
|
|
"from ( " +
|
|
|
@@ -169,7 +171,8 @@ public interface LifeFansMapper extends BaseMapper<LifeFans> {
|
|
|
"${ew.customSqlSegment}")
|
|
|
IPage<LifeFansVo> getMyStoreFans(IPage<LifeFansVo> iPage, @Param("fansId") String fansId, @Param(Constants.WRAPPER) QueryWrapper<LifeFansVo> wrapper);
|
|
|
|
|
|
- @Select("select foll.*, if(isnull(fans.id), 0, 1) isFollowThis, 1 as isFollowMe, " +
|
|
|
+ @Select("select MAX(foll.id) id, MAX(foll.name) name, MAX(foll.image) image, foll.phoneId, MAX(foll.blurb) blurb, " +
|
|
|
+ " MAX(if(isnull(fans.id), 0, 1)) isFollowThis, 1 as isFollowMe, " +
|
|
|
" (select count(1) from life_fans fans2 where fans2.followed_id = foll.phoneId and fans2.delete_flag = 0) fansNum, " +
|
|
|
" (select count(1) from life_fans fans3 where fans3.fans_id = foll.phoneId and fans3.delete_flag = 0) followNum " +
|
|
|
" from ( " +
|
|
|
@@ -187,7 +190,8 @@ public interface LifeFansMapper extends BaseMapper<LifeFans> {
|
|
|
"${ew.customSqlSegment} ")
|
|
|
IPage<LifeFansVo> getMyUserFans(IPage<LifeFansVo> iPage, @Param("fansId") String fansId, @Param(Constants.WRAPPER) QueryWrapper<LifeFansVo> wrapper);
|
|
|
|
|
|
- @Select("select foll.*, lb.id blackListid, 1 as isFollowThis, 1 as isFollowMe, " +
|
|
|
+ @Select("select MAX(foll.id) id, MAX(foll.name) name, MAX(foll.image) image, foll.phoneId, MAX(foll.blurb) blurb, MAX(foll.blockedType) blockedType, MAX(foll.blockedId) blockedId, MAX(foll.username) username, MAX(foll.accountBlurb) accountBlurb, " +
|
|
|
+ " MAX(lb.id) blackListid, 1 as isFollowThis, 1 as isFollowMe, " +
|
|
|
" (select count(1) from life_fans fans2 where fans2.followed_id = foll.phoneId and fans2.delete_flag = 0) fansNum, " +
|
|
|
" (select count(1) from life_fans fans3 where fans3.fans_id = foll.phoneId and fans3.delete_flag = 0) followNum " +
|
|
|
"from ( " +
|
|
|
@@ -213,7 +217,7 @@ public interface LifeFansMapper extends BaseMapper<LifeFans> {
|
|
|
"${ew.customSqlSegment} ")
|
|
|
IPage<LifeFansVo> getMutualAttention(IPage<LifeFansVo> iPage, @Param("fansId") String fansId, @Param("blockerType") String blockerType, @Param("blockerId") String blockerId, @Param(Constants.WRAPPER) QueryWrapper<LifeFansVo> wrapper);
|
|
|
|
|
|
- @Select("select foll.*, 1 as isFollowThis, 1 as isFollowMe, " +
|
|
|
+ @Select("select MAX(foll.id) id, MAX(foll.name) name, MAX(foll.image) image, foll.phoneId, MAX(foll.blurb) blurb, 1 as isFollowThis, 1 as isFollowMe, " +
|
|
|
" (select count(1) from life_fans fans2 where fans2.followed_id = foll.phoneId and fans2.delete_flag = 0) fansNum, " +
|
|
|
" (select count(1) from life_fans fans3 where fans3.fans_id = foll.phoneId and fans3.delete_flag = 0) followNum " +
|
|
|
"from ( " +
|