| | |
| | | * @param discussId 一起议主键id |
| | | * @param isFirstComment 是否首次参与 |
| | | */ |
| | | void incrCommentAndJoinNumById(@Param("discussId") Long discussId, @Param("isFirstComment") boolean isFirstComment); |
| | | void incrCommentAndJoinNumById(@Param("discussId") Long discussId, @Param("isFirstComment") boolean isFirstComment, |
| | | @Param("isFirstComment") boolean isAddComment); |
| | | |
| | | /** |
| | | * 一起议点赞/取消点赞 增加/减少点赞总数 |
| | |
| | | comActDiscussDO.setId(id); |
| | | comActDiscussDO.setIsDel(ComActDiscussDO.isOk.yes); |
| | | if (comActDiscussDAO.updateById(comActDiscussDO) > 0) { |
| | | comActDiscussDAO.incrCommentAndJoinNumById(id, false,false); |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | |
| | | //评论成功,评论总数+1 |
| | | //若首次参与评论,参与讨论人数+1 |
| | | if (currentUserCommentCount > 0) { |
| | | comActDiscussDAO.incrCommentAndJoinNumById(discussId, false); |
| | | comActDiscussDAO.incrCommentAndJoinNumById(discussId, false,true); |
| | | } else { |
| | | comActDiscussDAO.incrCommentAndJoinNumById(discussId, true); |
| | | comActDiscussDAO.incrCommentAndJoinNumById(discussId, true,true); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | //回复成功,评论总数+1 |
| | | //若首次参与评论,参与讨论人数+1 |
| | | if (currentUserCommentCount > 0) { |
| | | comActDiscussDAO.incrCommentAndJoinNumById(discussId, false); |
| | | comActDiscussDAO.incrCommentAndJoinNumById(discussId, false,true); |
| | | } else { |
| | | comActDiscussDAO.incrCommentAndJoinNumById(discussId, true); |
| | | comActDiscussDAO.incrCommentAndJoinNumById(discussId, true,true);); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | </update> |
| | | <update id="incrCommentAndJoinNumById"> |
| | | UPDATE `com_act_discuss` |
| | | SET comment_num = comment_num + 1, |
| | | SET |
| | | <if test="isAddComment"> |
| | | comment_num = comment_num + 1, |
| | | </if> |
| | | <if test="!isAddComment"> |
| | | comment_num = comment_num - 1, |
| | | </if> |
| | | <if test="isFirstComment"> |
| | | join_num = join_num + 1, |
| | | </if> |
| | |
| | | FROM com_act_discuss d |
| | | JOIN sys_user u ON d.user_id = u.user_id |
| | | JOIN com_act a ON d.community_id = a.community_id |
| | | LEFT JOIN com_act_discuss_comment cadc on d.id = cadc.discuss_id |
| | | LEFT JOIN com_act_discuss_option do ON d.id = do.discuss_id |
| | | LEFT JOIN com_act_discuss_user du ON d.id = du.discuss_id |
| | | <if test='pageComActDiscussDTO.loginUserId != null '> |