From 6fc1e7f179acaeec4df755f72895b3b4fb50d4bb Mon Sep 17 00:00:00 2001
From: 101captain <237651143@qq.com>
Date: 星期五, 14 一月 2022 13:15:59 +0800
Subject: [PATCH] Merge branch 'renhequ' into dev

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java |   27 ++++++++++++++++++++++-----
 1 files changed, 22 insertions(+), 5 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 278a41e..68aea22 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;
@@ -48,7 +49,7 @@
 //        + "COUNT( DISTINCT c.id ) commentNum, " + "u.name userName, " + "u.nick_name userNickName, " + "d.create_at  "
 //        + "FROM " + "com_act_discuss d " + "JOIN sys_user u ON d.user_id = u.user_id "
 //        + "LEFT JOIN com_act_discuss_comment c ON d.id = c.discuss_id  "
-//        + " where d.community_id=#{pageComActDiscussDTO.communityId}"
+//        + " where d.community_id = ${pageComActDiscussDTO.communityId}"
 //        + "<if test='pageComActDiscussDTO.subject != null and pageComActDiscussDTO.subject.trim() != &quot;&quot;'>"
 //        + " and d.`discuss_subject` LIKE concat( #{pageComActDiscussDTO.subject}, '%' )  " + " </if> "
 //        + "<if test='pageComActDiscussDTO.begin != null '>" + "AND d.create_at BETWEEN #{pageComActDiscussDTO.begin}  "
@@ -106,7 +107,7 @@
 //        + "LEFT JOIN com_act_discuss_user du ON d.id = du.discuss_id  "
 //        + "<if test='pageComActDiscussDTO.loginUserId != null '>"
 //        + "LEFT JOIN com_act_discuss_option_user ou on do.id=ou.discuss_option_id and ou.user_id=#{pageComActDiscussDTO.loginUserId} "
-//        + " </if> " + " where d.community_id=#{pageComActDiscussDTO.communityId}" + " and d.is_del = 2"
+//        + " </if> " + " where d.community_id = ${pageComActDiscussDTO.communityId}" + " and d.is_del = 2"
 //        + "<if test='pageComActDiscussDTO.type != null '>"
 //        + " and d.`type` = #{pageComActDiscussDTO.type}  " + " </if> "
 //        + "<if test='pageComActDiscussDTO.subject != null and pageComActDiscussDTO.subject.trim() != &quot;&quot;'>"
@@ -141,7 +142,7 @@
     IPage<ComActDiscussCommentVO> pageDiscussCommentApplets(Page page,
         @Param("pageComActDiscussCommentDTO") PageComActDiscussCommentDTO pageComActDiscussCommentDTO);
 
-    @Select("select name,address from com_act where community_id=#{communityId}")
+    @Select("select name,address from com_act where community_id = ${communityId}")
     ComActVO selectCommunity(Long communityId);
 
     @Select("SELECT  " + "if(du.id is not null,1,0)haveSign, " + "if(ou.id is not null,1,0)haveVote " + "FROM "
@@ -155,13 +156,13 @@
 
     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}")
+    @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}")
     List<CarouselInfoVO> screenDiscuss(@Param("communityId") Long communityId, @Param("pageSize") Integer pageSize);
 
     @Select("<script> " + "SELECT " + " cad.id, " + " su.nick_name AS userName, " + " su.image_url, "
         + " cad.create_at, " + " cad.type, " + " cad.discuss_subject, " + " cad.photo_pah  " + "FROM "
         + " com_act_discuss AS cad " + " LEFT JOIN sys_user AS su ON su.user_id = cad.user_id  " + " <where> "
-        + "<if test='discussListDTO.communityId != null '>" + " and cad.community_id = #{discussListDTO.communityId} "
+        + "<if test='discussListDTO.communityId != null '>" + " and cad.community_id = ${discussListDTO.communityId} "
         + " </if> " + "<if test='discussListDTO.startTime!=null and discussListDTO.startTime != &quot;&quot;'>"
         + " AND DATE_FORMAT(cad.create_at,'%Y-%m-%d %H:%i:%s') <![CDATA[ >= ]]> #{discussListDTO.startTime} "
         + " </if> " + "<if test='discussListDTO.endTime!=null and discussListDTO.endTime != &quot;&quot;'>"
@@ -209,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