81,092
社区成员
发帖
与我相关
我的任务
分享
select
c.id id,
c.content content,
c.commentDate commentDate,
c.article_id articleId,
c.visitor_id visitorId,
v.nickname nickname,
v.email email,
v.sex sex,
(case
length(queryCommentWithAmout(c.id))-length(replace(queryCommentWithAmout(c.id),',',''))
when
0
then
0
else
length(queryCommentWithAmout(c.id))-length(replace(queryCommentWithAmout(c.id),',',''))+1
end)
replyCount
from t_comment c left join visitor v
on c.visitor_id = v.id
where c.article_id =#{articleId} and c.comment_id is null
group by c.id
order by commentDate DESC