From 04e7e62b50fe43b2b601bf0f876c3ecef33cea70 Mon Sep 17 00:00:00 2001
From: puhanshu <a9236326>
Date: 星期五, 24 十二月 2021 16:19:30 +0800
Subject: [PATCH] 修改bug-2997
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java | 29 ++++++++++++++++++-----------
1 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java
index bd5c558..8b5c6a5 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java
@@ -4,6 +4,7 @@
import java.util.List;
import java.util.Map;
+import com.panzhihua.common.model.vos.community.StatisticsCommVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@@ -152,17 +153,7 @@
+ "WHERE " + "d.id =#{id} " + "GROUP BY d.id")
ComActDiscussVO selectHaveSignAndHaveVote(@Param("id") Long id, @Param("loginUserId") Long loginUserId);
- @Select(" SELECT COUNT(id) AS totalNum,"
- + "(SELECT COUNT(id) FROM com_act_discuss WHERE community_id = #{communityId} AND create_at between date_sub(curdate() - day(curdate()) +1,interval 1 month) and now())AS currentNum,"
- + "(SELECT COUNT(id) FROM com_act_discuss WHERE community_id = #{communityId} AND TYPE = 1)AS imgNum," + "("
- + "SELECT " + " count(distinct cadc.user_id) " + "FROM " + " com_act_discuss_comment AS cadc "
- + " LEFT JOIN com_act_discuss AS cad ON cad.id = cadc.discuss_id "
- + " where cad.type = 1 and cad.community_id = #{communityId} " + ")AS imgPeopleNum," + "("
- + "select count(user_id) from ( " + "SELECT " + " distinct cadc.user_id " + "FROM "
- + " com_act_discuss_comment AS cadc " + " LEFT JOIN com_act_discuss AS cad ON cad.id = cadc.discuss_id "
- + " where cad.type = 2 and cad.community_id = #{communityId} " + " union all "
- + " SELECT DISTINCT cadou.user_id FROM com_act_discuss_option_user AS cadou LEFT JOIN com_act_discuss_option AS cado ON cado.id = cadou.discuss_option_id left join com_act_discuss as cad on cad.id = cado.discuss_id where cad.community_id = #{communityId}"
- + ") t" + ")AS votePeopleNum " + " FROM com_act_discuss")
+
Map<String, Long> countByCommunityId(@Param("communityId") Long communityId, @Param("date") String date);
@Select(" SELECT id,discuss_subject AS content,IF(type = 1,'图文','投票') AS typeName FROM com_act_discuss WHERE community_id = #{communityId} ORDER BY create_at DESC LIMIT #{pageSize}")
@@ -219,4 +210,20 @@
* @return
*/
int batchUpdateViewNum(@Param("needDealMap") HashMap<Long, Integer> needDealMap);
+
+ /**
+ * 居民自治-议事投票类型占比统计
+ * @param communityId
+ * @return
+ */
+ List<StatisticsCommVO> selectTypePercent(@Param("communityId") Long communityId);
+
+ /**
+ * 获取一起议标题
+ * @param type
+ * @param communityId
+ * @param pageSize
+ * @return
+ */
+ List<String> getTitles(@Param("type") int type, @Param("communityId") Long communityId, @Param("pageSize") Integer pageSize);
}
--
Gitblit v1.7.1