Authored by 张帅

fix

... ... @@ -18,7 +18,7 @@ public interface PublicUserAttentionRepository extends JpaRepository<PublicUserA
" from PublicUserAttention where createTime > :startTime and create_time <:endTime and attentionType=1 and status=1 group by uid")
List<UidAndAttention> selectUidAttenCount(@Param("startTime")Long startTime, @Param("endTime")Long endTime);
@Query(value = "select new com.yoho.datasync.fullsync.dal.repository.pcms.model.UidAndAttention(uid, count(id),authorType)" +
" from PublicUserAttention where createTime > :startTime and create_time <:endTime and attentionType=1 and status=1 group by uid,authorType")
@Query(value = "select new com.yoho.datasync.fullsync.dal.repository.pcms.model.UidAndAttention(targetId, count(id),authorType)" +
" from PublicUserAttention where createTime > :startTime and create_time <:endTime and attentionType=1 and status=1 group by targetId,authorType")
List<UidAndAttention> selectUidFansCount(@Param("startTime")Long startTime, @Param("endTime")Long endTime);
}
... ...
... ... @@ -279,6 +279,7 @@ public class GrassUserDataSyncServiceImpl implements IGrassUserDataSyncService {
return userPraiseCountMap;
}
//用户的关注数量
private Map<UidAndUserType, Long> getUserAttenNum( Long startTime, Long endTime){
List<UidAndAttention> uidAndAttentionList = publicUserAttentionRepository.selectUidAttenCount(startTime, endTime);
Map<UidAndUserType, Long> userPraiseCountMap = new HashMap<>();
... ... @@ -291,6 +292,7 @@ public class GrassUserDataSyncServiceImpl implements IGrassUserDataSyncService {
return userPraiseCountMap;
}
//用户被关注的数量
private Map<UidAndUserType, Long> getUserFansNum( Long startTime, Long endTime){
List<UidAndAttention> uidAndAttentionList = publicUserAttentionRepository.selectUidFansCount(startTime, endTime);
Map<UidAndUserType, Long> userPraiseCountMap = new HashMap<>();
... ...