manailin
2021-11-03 c3811d01d1929a98a0f34f70ca187d82ee312dbb
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDiscussDAO.java
@@ -152,17 +152,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}")