| | |
| | | IPage<ComActDiscussVO> pageDiscuss(Page page, |
| | | @Param("pageComActDiscussDTO") PageComActDiscussDTO pageComActDiscussDTO); |
| | | |
| | | |
| | | Integer getCommentNum(@Param("id") String id); |
| | | |
| | | |
| | | IPage<ComActDiscussVO> pageDiscussAdmin(Page page, |
| | | @Param("pageComActDiscussDTO") PageComActDiscussDTO pageComActDiscussDTO); |
| | | |
| | |
| | | + ",( SELECT count( id ) FROM com_act_discuss_option_user WHERE discuss_option_id = c.id ) AS num " + " FROM " |
| | | + " com_act_discuss_option AS c " + " WHERE c.discuss_id = #{discussId}" + " ORDER BY " + " num DESC") |
| | | List<ComActDiscussOptionVO> getScreenDiscussOptionList(@Param("discussId") Long discussId); |
| | | |
| | | /** |
| | | * 添加议事投票评论数 |
| | | * @param discussId 议事投票 |
| | | * @param num 添加数量 |
| | | */ |
| | | void addCommentCount(@Param("discussId") Long discussId,@Param("num") Integer num); |
| | | |
| | | /** |
| | | * 更新一起议主题状态 |
| | |
| | | BeanUtils.copyProperties(comActDiscussDO, comActDiscussVO); |
| | | comActDiscussVO.setSignNum(comActDiscussDO.getFabulousNum()); |
| | | Integer type = comActDiscussVO.getType(); |
| | | Integer num=comActDiscussDAO.getCommentNum(id+""); |
| | | comActDiscussVO.setCommentNum(num); |
| | | if (type.equals(ComActDiscussVO.type.tp)) { |
| | | //查询选项列表 |
| | | List<ComActDiscussOptionVO> comActDiscussOptionList = comActDiscussOptionDAO.getDiscussOptionList(id); |
| | |
| | | BeanUtils.copyProperties(comActDiscussDO, comActDiscussVO); |
| | | comActDiscussVO.setSignNum(comActDiscussDO.getFabulousNum()); |
| | | Integer type = comActDiscussVO.getType(); |
| | | Integer num=comActDiscussDAO.getCommentNum(id+""); |
| | | comActDiscussVO.setCommentNum(num); |
| | | if (type.equals(ComActDiscussVO.type.tp)) { |
| | | //查询选项列表 |
| | | List<ComActDiscussOptionVO> comActDiscussOptionList = comActDiscussOptionDAO.getDiscussOptionList(id); |
| | |
| | | BeanUtils.copyProperties(comActDiscussDO, comActDiscussVO); |
| | | comActDiscussVO.setSignNum(comActDiscussDO.getFabulousNum()); |
| | | Integer type = comActDiscussVO.getType(); |
| | | Integer num=comActDiscussDAO.getCommentNum(id+""); |
| | | comActDiscussVO.setCommentNum(num); |
| | | if (type.equals(2)) { |
| | | List<ComActDiscussOptionDO> comActDiscussOptionDOS = comActDiscussOptionDAO.selectList( |
| | | new QueryWrapper<ComActDiscussOptionDO>().lambda().eq(ComActDiscussOptionDO::getDiscussId, id)); |
| | |
| | | BeanUtils.copyProperties(comActDiscussDO, comActDiscussVO); |
| | | comActDiscussVO.setSignNum(comActDiscussDO.getFabulousNum()); |
| | | Integer type = comActDiscussVO.getType(); |
| | | Integer num=comActDiscussDAO.getCommentNum(id+""); |
| | | comActDiscussVO.setCommentNum(num); |
| | | if (type.equals(2)) { |
| | | List<ComActDiscussOptionDO> comActDiscussOptionDOS = comActDiscussOptionDAO.selectList( |
| | | new QueryWrapper<ComActDiscussOptionDO>().lambda().eq(ComActDiscussOptionDO::getDiscussId, id)); |
| | |
| | | <update id="incrCommentAndJoinNumById"> |
| | | UPDATE `com_act_discuss` |
| | | 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> |
| | |
| | | GROUP BY d.id )t |
| | | order by t.create_at desc |
| | | </select> |
| | | |
| | | <select id="getCommentNum" resultType="Integer"> |
| | | select COUNT( DISTINCT c.id ) from com_act_discuss_comment where discuss_id=#{id} |
| | | </select> |
| | | |
| | | |
| | | <select id="pageDiscussAdmin" parameterType="com.panzhihua.common.model.dtos.community.PageComActDiscussDTO" |
| | | resultType="com.panzhihua.common.model.vos.community.ComActDiscussVO"> |
| | |
| | | SELECT t.* FROM ( |
| | | SELECT d.id, d.vote_title, if(d.address IS NULL OR d.address='null',a.name,d.address )address, d.photo_pah,d.content_type, |
| | | d.`discuss_subject`, d.type, d.end_time, d.status, d.views_num, d.join_num, d.fabulous_num AS signNum, |
| | | d.comment_num AS commentNum, d.release_at, d.img_width, d.img_height, d.is_repeat, d.count, u.type AS userType, if(u.type=1,u.name,a.name) userName, |
| | | (select count(id) from com_act_discuss_comment where discuss_id = d.id and is_del = 2 and parent_id = 0) AS commentNum, |
| | | d.release_at, d.img_width, d.img_height, d.is_repeat, d.count, u.type AS userType, if(u.type=1,u.name,a.name) userName, |
| | | if(u.type=1,u.nick_name,a.name) userNickName, |
| | | <if test='pageComActDiscussDTO.loginUserId != null '> |
| | | if(du.id IS NOT NULL,1,0) haveSign, if(ou.id IS NOT NULL,1,0) haveVote, |
| | |
| | | ) t ORDER BY t.create_at DESC |
| | | </select> |
| | | |
| | | <update id="addCommentCount"> |
| | | update com_act_discuss set comment_num = comment_num + #{num} where id = #{discussId} |
| | | </update> |
| | | |
| | | |
| | | <select id="pageDiscussCommentAdmin" parameterType="com.panzhihua.common.model.dtos.community.PageComActDiscussCommentDTO" |
| | | resultType="com.panzhihua.common.model.vos.community.ComActDiscussCommentVO"> |