From de91c84954157bb9f8b6d938cbe0b1b51fb6e65d Mon Sep 17 00:00:00 2001 From: CeDo <cedoogle@gmail.com> Date: 星期五, 07 五月 2021 15:23:57 +0800 Subject: [PATCH] bugfixed:新增便民服务商家 报错 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleDAO.java | 88 +++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 86 insertions(+), 2 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleDAO.java index 2e012f0..1925342 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleDAO.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleDAO.java @@ -3,9 +3,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAdminDTO; import com.panzhihua.common.model.dtos.neighbor.ComActNeighborCircleAppDTO; import com.panzhihua.common.model.vos.R; +import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAdminVO; import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAppVO; +import com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleDetailAppVO; +import com.panzhihua.common.model.vos.neighbor.ComActNeighborCommentReplyAppVO; +import com.panzhihua.common.model.vos.user.AdministratorsUserVO; import com.panzhihua.service_community.model.dos.ComActNeighborCircleDO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -19,7 +24,86 @@ @Mapper public interface ComActNeighborCircleDAO extends BaseMapper<ComActNeighborCircleDO> { - @Select("") - IPage<ComActNeighborCircleAppVO> pageNeighbor(Page page, @Param("neighborCircleAppDTO") ComActNeighborCircleAppDTO neighborCircleAppDTO); + @Select("<script> " + + "SELECT " + + "canc.id," + + "canc.release_content," + + "canc.release_images," + + "canc.comment_num," + + "canc.fabulous_num," + + "canc.forward_num," + + "canc.views_num," + + "canc.is_boutique," + + "canc.create_at," + + "canc.reply_at," + + "canc.last_comment_num," + + "canc.last_fabulous_num," + + "canc.last_views_num," + + "su.nick_name as name," + + "su.image_url as headUrl " + + " FROM " + + " com_act_neighbor_circle AS canc" + + " left join sys_user as su on su.user_id = canc.release_id" + + " where canc.status = 2 and canc.community_id = #{neighborCircleAppDTO.communityId} " + + "<if test='neighborCircleAppDTO.type != null and neighborCircleAppDTO.type == 1'>" + + " order by (canc.last_views_num + canc.last_comment_num + canc.last_fabulous_num) desc " + + " </if> " + + "<if test='neighborCircleAppDTO.type != null and neighborCircleAppDTO.type == 2'>" + + " order by canc.reply_at desc,canc.create_at desc " + + " </if> " + + "<if test='neighborCircleAppDTO.type != null and neighborCircleAppDTO.type == 3'>" + + " order by (canc.views_num + canc.comment_num + canc.fabulous_num) desc " + + " </if> " + + " </script>") + IPage<ComActNeighborCircleAppVO> pageNeighborByApp(Page page, @Param("neighborCircleAppDTO") ComActNeighborCircleAppDTO neighborCircleAppDTO); + + @Select("<script> " + + "select canc.id,su.nick_name as name,su.image_url as headUrl,canc.release_content " + + ",canc.release_images,canc.comment_num,canc.fabulous_num,canc.forward_num,canc.views_num " + + ",canc.is_boutique,canc.create_at,canc.reply_at from com_act_neighbor_circle as canc " + + " left join sys_user as su on su.user_id = canc.release_id where id = #{circleId}"+ + " </script>") + ComActNeighborCircleDetailAppVO neighborDetailByApp(@Param("circleId") Long circleId); + @Select("<script> \n"+ + "SELECT\n" + + "nc.*,\n" + + "u.`name` AS releaseName,u.`type` as userType\n" + + ",ca.name as communityName\n" + + "FROM\n" + + "com_act_neighbor_circle nc\n" + + "LEFT JOIN sys_user u ON nc.release_id = u.user_id\n" + + "left join com_act ca on u.community_id=ca.community_id \n" + + "<where>"+ + "nc.community_id = #{neighborCircleAdminDTO.communityId} \n"+ + "<if test='neighborCircleAdminDTO.releaseContent != null and neighborCircleAdminDTO.releaseContent != ""'>" + + "and nc.release_content like concat('%',#{neighborCircleAdminDTO.releaseContent},'%') \n" + + " </if> " + + "<if test='neighborCircleAdminDTO.startAt != null and neighborCircleAdminDTO.endAt !=null '>" + + "and nc.create_at between #{neighborCircleAdminDTO.startAt} and #{neighborCircleAdminDTO.endAt} \n" + + " </if> " + + "</where>"+ + "order by " + + "case when nc.`status`=1 then 0 else 1 end, \n" + + "nc.`status` asc,nc.create_at desc " + + "</script>") + IPage<ComActNeighborCircleAdminVO> pageNeighborByAdmin(Page page,@Param("neighborCircleAdminDTO") ComActNeighborCircleAdminDTO neighborCircleAdminDTO); + + @Select("select * from sys_user where user_id=#{userId}") + AdministratorsUserVO selectUserByUserId(@Param("userId") Long userId); + + @Select("<script> " + + "select id,release_content,release_images,status,create_at,comment_num,fabulous_num,forward_num,views_num,refuse_reason " + + " from com_act_neighbor_circle as canc " + + " where canc.release_id = #{userId} order by create_at desc" + + " </script>") + IPage<ComActNeighborCircleAppVO> neighborExamineByApp(Page page,@Param("userId") Long userId); + + @Select("select reply.id,reply.comment_id,reply.reply_content,reply.fabulous_num,reply.create_at" + + ",reply.is_release,su.nick_name as userName,su.image_url as userHeadUrl,su1.nick_name as oldUserName" + + " from com_act_neighbor_circle_comment_reply as reply" + + " left join sys_user as su on su.user_id = reply.user_id" + + " left join sys_user as su1 on su1.user_id = reply.parent_user_id" + + " where reply.comment_id = #{commentId}") + IPage<ComActNeighborCommentReplyAppVO> neighborCommentReplyByApp(Page page, @Param("commentId") Long commentId); } -- Gitblit v1.7.1