From 1775bb71f952106c58657cf02891cbe2a286c8f8 Mon Sep 17 00:00:00 2001 From: 101captain <237651143@qq.com> Date: 星期三, 22 九月 2021 11:30:47 +0800 Subject: [PATCH] Merge branch 'test' of http://gitlab.nhys.cdnhxx.com/root/zhihuishequ into test --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActNeighborCircleDAO.java | 60 +++++++++++++++++++----------------------------------------- 1 files changed, 19 insertions(+), 41 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 2cb0ac5..a6c0b7f 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 @@ -29,49 +29,23 @@ @Mapper public interface ComActNeighborCircleDAO extends BaseMapper<ComActNeighborCircleDO> { - @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," + "canc.type," + "canc.topic_id," + "su.nick_name as name," + "su.community_id," - + "canct.name as topicName," + "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 " - + " left join com_act_neighbor_circle_topic as canct on canct.id = canc.topic_id " - + " where canc.status = 2 and canc.community_id = #{neighborCircleAppDTO.communityId} " - + "<if test='neighborCircleAppDTO.topicId != null '>" + " and canc.topic_id = #{neighborCircleAppDTO.topicId} " - + " </if> " + "<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.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); + + /** + * 分页查询邻里圈列表 + * @param neighborCircleAppDTO 请求参数 + * @return 邻里圈列表 + */ + 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,canct.name as topicName " + + ",canc.release_images,canc.comment_num,canc.fabulous_num,canc.forward_num,canc.views_num,canct.name as topicName,canc.refuse_reason " + ",canc.is_boutique,canc.create_at,canc.reply_at,su.community_id,canc.type from com_act_neighbor_circle as canc " + " left join sys_user as su on su.user_id = canc.release_id " - + " left join com_act_neighbor_circle_topic as canct on canct.id = canc.topic_id where canc.id = #{circleId}" + + " left join com_act_neighbor_circle_topic as canct on canct.id = canc.topic_id where canc.id = #{circleId} and canc.is_del = 2" + " </script>") ComActNeighborCircleDetailAppVO neighborDetailByApp(@Param("circleId") Long circleId); - @Select("<script> \n" + "SELECT\n" + "nc.*,\n" - + "u.`nick_name` AS releaseName,u.image_url,canct.`name` as topicName ,u.`type` as userType\n" - + ",u.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_neighbor_circle_topic as canct ON canct.id = nc.topic_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.topicName != null and neighborCircleAdminDTO.topicName != ""'>" - + "and canct.`name` = #{neighborCircleAdminDTO.topicName} " + " </if> " - + "<if test='neighborCircleAdminDTO.startAt != null and neighborCircleAdminDTO.endAt !=null '>" - + "and nc.create_at between #{neighborCircleAdminDTO.startAt} and #{neighborCircleAdminDTO.endAt} \n" - + " </if> " + "<if test='neighborCircleAdminDTO.status != null '>" - + "and nc.status = #{neighborCircleAdminDTO.status} \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); + IPage<ComActNeighborCircleAdminVO> pageNeighborByAdmin(Page page,@Param("neighborCircleAdminDTO") ComActNeighborCircleAdminDTO neighborCircleAdminDTO); @Select("select * from sys_user where user_id=#{userId}") AdministratorsUserVO selectUserByUserId(@Param("userId") Long userId); @@ -81,7 +55,7 @@ + ",canc.comment_num,canc.fabulous_num,canc.forward_num,canc.views_num,canc.refuse_reason,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 " + " left join com_act_neighbor_circle_topic as canct on canct.id = canc.topic_id " - + " where canc.release_id = #{userId} and canc.status != 3 order by create_at desc" + " </script>") + + " where canc.release_id = #{userId} and canc.is_del = 2 and canc.status != 3 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" @@ -134,8 +108,12 @@ List<PieElementVO> countAllNoneCompletedWorkByCommunityId(@Param("communityId") Long communityId); @Select(" SELECT AVG(b.t)AS avgTime " - + " FROM (SELECT TIMESTAMPDIFF(MINUTE,create_at,feedback_at) AS t FROM com_act_easy_photo WHERE community_id = #{communityId} and STATUS = 4 " - + " UNION ALL SELECT TIMESTAMPDIFF(MINUTE,create_at,finish_at) AS t FROM com_act_micro_wish WHERE community_id = #{communityId} and STATUS = 6 " - + " )AS b ") - Map<String, Object> countAvgByCommunityId(@Param("communityId") Long communityId); + + " FROM (SELECT TIMESTAMPDIFF(MINUTE,create_at,feedback_at) AS t FROM com_act_easy_photo WHERE community_id = #{communityId} and STATUS = 4 " + + " UNION ALL SELECT TIMESTAMPDIFF(MINUTE,create_at,finish_at) AS t FROM com_act_micro_wish WHERE community_id = #{communityId} and STATUS = 6 " + + " )AS b ") + Map<String, Object> countAvgByCommunityId(@Param("communityId")Long communityId); + + void addHotNum(@Param("circleId") Long circleId,@Param("hotNum") Long hotNum); + + void addTopicHotNum(@Param("circleId") Long circleId,@Param("hotNum") Long hotNum); } \ No newline at end of file -- Gitblit v1.7.1