From 75206d4e4ecd2a7789a21362b85906463d3f2c3d Mon Sep 17 00:00:00 2001
From: 101captain <237651143@qq.com>
Date: 星期一, 27 十二月 2021 10:08:13 +0800
Subject: [PATCH] Merge branch 'master' into hemenkou_dev

---
 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