罗元桥
2021-08-05 cc1098fc00a50cb1591d182f04bc37066ff0a9e2
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java
@@ -234,6 +234,9 @@
            "</script>")
    IPage<ComActActivityVO> pageActivityCommunityBack(Page page, @Param("comActActivityVO") ComActActivityVO comActActivityVO);
    @Select("select id from com_act_activity where `status` in (3,4) and TIMESTAMPDIFF(MINUTE,SYSDATE(),sign_up_end)<=0")
    List<Long> getActivityEndIds();
    @Update("update com_act_activity set `status`=4 where `status`=3 and TIMESTAMPDIFF(MINUTE,SYSDATE(),sign_up_end)<=0")
    int updateStatusToBeginAfterSingEnd();
    @Select("select GROUP_CONCAT(t.x1,',',t.x2,',',t.x3,',',t.x4) from ( " +
@@ -261,19 +264,24 @@
            "  AND a.community_id =#{communityId}")
    CommunityActivitiesVO selectCommunityActivitiesVO(@Param("communityId") Long communityId, @Param("date")Date date);
    @Select("SELECT COUNT(id) AS currentNum," +
            "(SELECT COUNT(id) FROM com_act_activity WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) AND participant_max > 0)AS commonNum," +
            "(SELECT COUNT(aas.id) FROM com_act_activity a INNER JOIN com_act_act_sign aas ON a.id = aas.activity_id WHERE a.participant_max > 0 AND (a.status = 3 OR a.status = 4 OR a.status = 5) AND  a.community_id=#{communityId})AS commonPeopleNum," +
            "(SELECT COUNT(id) FROM com_act_activity WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) AND participant_max = 0)AS volunteerNum," +
            "(SELECT COUNT(aas.id) FROM com_act_activity a INNER JOIN com_act_act_sign aas ON a.id = aas.activity_id WHERE a.community_id=#{communityId} AND a.participant_max = 0 AND (a.status = 3 OR a.status = 4 OR a.status = 5))AS volunteerPeopleNum" +
            " FROM com_act_activity WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) AND create_at LIKE CONCAT(#{nowDate},'%') ")
    @Select("SELECT " +
            " count( caa.id ) as totalNum, " +
            " (select count(id) from com_act_activity where `status` IN (1,2,3,4,5) and volunteer_min = 0 and community_id = #{communityId}) as commonNum, " +
            " (select count(id) from com_act_activity where `status` IN (1,2,3,4,5) and volunteer_min > 0 and community_id = #{communityId}) as volunteerNum, " +
            " (select count(caas.user_id) from com_act_act_sign as caas left join com_act_activity as caa on caa.id = caas.activity_id where caa.`status` IN (1,2,3,4,5) and is_volunteer = 0 and caa.community_id = #{communityId}) as commonPeopleNum, " +
            " (select count(caas.user_id) from com_act_act_sign as caas left join com_act_activity as caa on caa.id = caas.activity_id where caa.`status` IN (1,2,3,4,5) and is_volunteer = 1 and caa.community_id = #{communityId}) as volunteerPeopleNum, " +
            " (select count(id) from com_act_activity where `status` IN (1,2,3,4,5) and community_id = #{communityId} and create_at between date_sub(curdate() - day(curdate()) +1,interval 1 month) and now()) as currentNum " +
            "FROM " +
            " com_act_activity AS caa  " +
            "WHERE " +
            " caa.`status` IN (1,2,3,4,5) and community_id = #{communityId}")
    Map<String, Long> countByCommunityId(@Param("communityId")Long communityId,@Param("nowDate")String nowDate);
    @Select("SELECT id,activity_name as content,IF(participant_max = 0,'志愿者活动','居民活动') AS typeName  FROM com_act_activity " +
    @Select("SELECT id,activity_name as content,IF(volunteer_max = 0,'居民活动','志愿者活动') AS typeName  FROM com_act_activity " +
            "WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5) ORDER BY create_at DESC LIMIT #{pageSize}")
    List<CarouselInfoVO> screenActivity(@Param("communityId")Long communityId, @Param("pageSize")Integer pageSize);
    @Select("SELECT cover FROM com_act_activity WHERE community_id = #{communityId} AND (status = 3 OR status = 4 OR status = 5)")
    @Select("SELECT cover FROM com_act_activity WHERE community_id = #{communityId}")
    List<String> listImg(@Param("communityId")Long communityId);
    @Select("<script> " +
@@ -310,7 +318,7 @@
            " AND DATE_FORMAT(caa.create_at,'%Y-%m-%d %H:%i:%s') <![CDATA[ <= ]]> #{actActivityListDTO.endTime} " +
            " </if> " +
            "<if test='actActivityListDTO.type!=null'>" +
            " AND caa.status = #{actActivityListDTO.status} " +
            " AND caa.status = #{actActivityListDTO.type} " +
            " </if> " +
            " </where> "+
            "ORDER BY " +