From 8961d05a46aa30c73c3b85cd25da884a17c00e67 Mon Sep 17 00:00:00 2001
From: puhanshu <a9236326>
Date: 星期二, 19 十月 2021 17:29:40 +0800
Subject: [PATCH] 活动积分优化相关代码提交

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java |   59 ++++++++++++++++++++++++++++++++---------------------------
 1 files changed, 32 insertions(+), 27 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java
index 5a3d820..9da35b2 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java
@@ -104,33 +104,38 @@
     @Update("update com_act_activity set `status`=5 where `status` in (3,4) and TIMESTAMPDIFF(MINUTE,SYSDATE(),end_at)<=0")
     int updateStatusToBeginActiveOrEnd();
 
-    @Select("<script> " + "select t.* from ( " + "SELECT  " + "a.id, " + "a.activity_name, " + "u.`name` sponsorName, "
-        + "a.activity_addr, " + "a.participant_max, " + "count(if(s.is_volunteer=1,null,s.id))participant_now, "
-        + "a.volunteer_max, " + "count(if(s.is_volunteer=1,s.id,null))volunteer_now, " + "a.`status`, "
-        + "a.publish_at, " + "a.is_qr_code, " + "a.begin_at, " + "a.end_at, " + "a.sign_up_begin, " + "a.sign_up_end " + "FROM "
-        + " com_act_activity a  " + " LEFT JOIN sys_user u on a.sponsor_id=u.user_id "
-        + " LEFT JOIN com_act_act_sign s on a.id=s.activity_id " + "WHERE "
-        + "  a.`status` = 1 and a.community_id=#{comActActivityVO.communityId} "
-        + "<if test='comActActivityVO.activityName != null and comActActivityVO.activityName !=&quot;&quot;'>"
-        + " and a.activity_name LIKE concat( #{comActActivityVO.activityName}, '%' )  " + " </if> "
-        + "<if test='comActActivityVO.status != null and comActActivityVO.status !=0 and comActActivityVO.status !=1'>"
-        + "AND a.`status` = 99  " + " </if> " + "<if test='comActActivityVO.beginAt != null '>"
-        + "AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt}  "
-        + " </if> " + "group by a.id " + "  " + " union all " + "select t1.* from ( " + "  " + " SELECT  " + "a.id, "
-        + "a.activity_name, " + "u.`name` sponsorName, " + "a.activity_addr, " + "a.participant_max, "
-        + "count(if(s.is_volunteer=1,null,s.id))participant_now, " + "a.volunteer_max, "
-        + "count(if(s.is_volunteer=1,s.id,null))volunteer_now, " + "a.`status`, " + "a.publish_at, " + "a.is_qr_code, " + "a.begin_at, "
-        + "a.end_at, " + "a.sign_up_begin, " + "a.sign_up_end " + "FROM " + " com_act_activity a  "
-        + " LEFT JOIN sys_user u on a.sponsor_id=u.user_id " + " LEFT JOIN com_act_act_sign s on a.id=s.activity_id "
-        + "WHERE " + "  a.`status` != 1 and a.community_id=#{comActActivityVO.communityId} "
-        + "<if test='comActActivityVO.activityName != null and comActActivityVO.activityName !=&quot;&quot;'>"
-        + " and a.activity_name LIKE concat( #{comActActivityVO.activityName}, '%' )  " + " </if> "
-        + "<if test='comActActivityVO.status != null and comActActivityVO.status !=0 '>"
-        + "AND a.`status` = #{comActActivityVO.status}  " + " </if> " + "<if test='comActActivityVO.beginAt != null '>"
-        + "AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt}  "
-        + " </if> " + " group by a.id order by a.publish_at desc)t1 )t" + "</script>")
-    IPage<ComActActivityVO> pageActivityCommunityBack(Page page,
-        @Param("comActActivityVO") ComActActivityVO comActActivityVO);
+//    @Select("<script> " + "select t.* from ( " + "SELECT  " + "a.id, " + "a.activity_name, " + "u.`name` sponsorName, "
+//        + "a.activity_addr, " + "a.participant_max, " + "count(if(s.is_volunteer=1,null,s.id))participant_now, "
+//        + "a.volunteer_max, " + "count(if(s.is_volunteer=1,s.id,null))volunteer_now, " + "a.`status`, "
+//        + "a.publish_at, " + "a.is_qr_code, " + "a.begin_at, " + "a.end_at, " + "a.sign_up_begin, " + "a.sign_up_end " + "FROM "
+//        + " com_act_activity a  " + " LEFT JOIN sys_user u on a.sponsor_id=u.user_id "
+//        + " LEFT JOIN com_act_act_sign s on a.id=s.activity_id " + "WHERE "
+//        + "  a.`status` = 1 and a.community_id=#{comActActivityVO.communityId} "
+//        + "<if test='comActActivityVO.activityName != null and comActActivityVO.activityName !=&quot;&quot;'>"
+//        + " and a.activity_name LIKE concat( #{comActActivityVO.activityName}, '%' )  " + " </if> "
+//        + "<if test='comActActivityVO.status != null and comActActivityVO.status !=0 and comActActivityVO.status !=1'>"
+//        + "AND a.`status` = 99  " + " </if> " + "<if test='comActActivityVO.beginAt != null '>"
+//        + "AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt}  "
+//        + " </if> " + "group by a.id " + "  " + " union all " + "select t1.* from ( " + "  " + " SELECT  " + "a.id, "
+//        + "a.activity_name, " + "u.`name` sponsorName, " + "a.activity_addr, " + "a.participant_max, "
+//        + "count(if(s.is_volunteer=1,null,s.id))participant_now, " + "a.volunteer_max, "
+//        + "count(if(s.is_volunteer=1,s.id,null))volunteer_now, " + "a.`status`, " + "a.publish_at, " + "a.is_qr_code, " + "a.begin_at, "
+//        + "a.end_at, " + "a.sign_up_begin, " + "a.sign_up_end " + "FROM " + " com_act_activity a  "
+//        + " LEFT JOIN sys_user u on a.sponsor_id=u.user_id " + " LEFT JOIN com_act_act_sign s on a.id=s.activity_id "
+//        + "WHERE " + "  a.`status` != 1 and a.community_id=#{comActActivityVO.communityId} "
+//        + "<if test='comActActivityVO.activityName != null and comActActivityVO.activityName !=&quot;&quot;'>"
+//        + " and a.activity_name LIKE concat( #{comActActivityVO.activityName}, '%' )  " + " </if> "
+//        + "<if test='comActActivityVO.status != null and comActActivityVO.status !=0 '>"
+//        + "AND a.`status` = #{comActActivityVO.status}  " + " </if> " + "<if test='comActActivityVO.beginAt != null '>"
+//        + "AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt}  "
+//        + " </if> " + " group by a.id order by a.publish_at desc)t1 )t" + "</script>")
+    /**
+     * 分页查询社区活动
+     * @param page
+     * @param comActActivityVO
+     * @return
+     */
+    IPage<ComActActivityVO> pageActivityCommunityBack(@Param("page") Page page, @Param("comActActivityVO") ComActActivityVO comActActivityVO);
 
     @Select("select id from com_act_activity where `status` in (3,4) and TIMESTAMPDIFF(MINUTE,SYSDATE(),end_at)<=0")
     List<Long> getActivityEndIds();

--
Gitblit v1.7.1