提交 bf3c1c04 authored 作者: Whispa's avatar Whispa

commit commit

上级 f3b35311
......@@ -12,6 +12,6 @@ import org.springframework.data.repository.query.Param;
public interface TbCfItemCommentRepository extends PagingAndSortingRepository<TbCfItemComment,String> {
boolean existsByUserUserIdAndItemId(String userId, String itemId);
Page<TbCfItemComment> findAllByItemId(String itemId, Pageable pageable);
@Query("select a as itemComment, count(x) as commented from #{#entityName} a left join TbCfItemLike x on a.id=x.commentId and x.user=:user where a.itemId=:itemId group by a")
@Query("select a as itemComment, count(x) as commented from #{#entityName} a left join TbCfItemLike x on a=x.comment and x.user=:user where a.itemId=:itemId group by a")
Page<CommentCount> findAllByItemIdAndUser(@Param("itemId") String itemId, @Param("user") TbCfUserInfo user, Pageable pageable);
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论