| | |
| | | "AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt} \n" + |
| | | " </if> " + |
| | | " group by a.id "+ |
| | | " order by a.publish_at desc "+ |
| | | " order by a.status asc,a.publish_at desc "+ |
| | | "</script>") |
| | | IPage<ComActActivityVO> pageActivity( Page page, @Param("comActActivityVO") ComActActivityVO comActActivityVO); |
| | | |
| | |
| | | |
| | | @Update("update com_act_activity set `status`=(if(DATEDIFF(SYSDATE(),end_at)>=0,5,4)) where `status`=3 and TIMESTAMPDIFF(HOUR,SYSDATE(),begin_at)<=0") |
| | | int updateStatusToBeginActiveOrEnd(); |
| | | @Select("<script> " + |
| | | "select t.* from (\n" + |
| | | "SELECT \n" + |
| | | "a.id,\n" + |
| | | "a.activity_name,\n" + |
| | | "u.`name` sponsorName,\n" + |
| | | "a.activity_addr,\n" + |
| | | "a.participant_max,\n" + |
| | | "count(if(s.is_volunteer=1,null,s.id))participant_now,\n"+ |
| | | "a.volunteer_max,\n" + |
| | | "count(if(s.is_volunteer=1,s.id,null))volunteer_now,\n"+ |
| | | "a.`status`,\n" + |
| | | "a.publish_at,\n" + |
| | | "a.begin_at,\n" + |
| | | "a.end_at,\n" + |
| | | "a.sign_up_begin,\n" + |
| | | "a.sign_up_end\n" + |
| | | "FROM\n" + |
| | | "\tcom_act_activity a \n" + |
| | | "\tLEFT JOIN sys_user u on a.sponsor_id=u.user_id\n" + |
| | | "\tLEFT JOIN com_act_act_sign s on a.id=s.activity_id\n" + |
| | | "WHERE\n" + |
| | | "\t a.`status` = 1 and a.community_id=#{comActActivityVO.communityId}\n" + |
| | | "<if test='comActActivityVO.activityName != null and comActActivityVO.activityName !=""'>" + |
| | | "\tand a.activity_name LIKE concat( #{comActActivityVO.activityName}, '%' ) \n" + |
| | | " </if> " + |
| | | "<if test='comActActivityVO.status != null and comActActivityVO.status !=0 and comActActivityVO.status !=1'>" + |
| | | "AND a.`status` = 99 \n" + |
| | | " </if> " + |
| | | "<if test='comActActivityVO.beginAt != null '>" + |
| | | "AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt} \n" + |
| | | " </if> " + |
| | | "group by a.id\n" + |
| | | "\t\n" + |
| | | "\tunion all\n" + |
| | | "select t1.* from (\n"+ |
| | | "\t\n" + |
| | | "\tSELECT \n" + |
| | | "a.id,\n" + |
| | | "a.activity_name,\n" + |
| | | "u.`name` sponsorName,\n" + |
| | | "a.activity_addr,\n" + |
| | | "a.participant_max,\n" + |
| | | "count(if(s.is_volunteer=1,null,s.id))participant_now,\n"+ |
| | | "a.volunteer_max,\n" + |
| | | "count(if(s.is_volunteer=1,s.id,null))volunteer_now,\n"+ |
| | | "a.`status`,\n" + |
| | | "a.publish_at,\n" + |
| | | "a.begin_at,\n" + |
| | | "a.end_at,\n" + |
| | | "a.sign_up_begin,\n" + |
| | | "a.sign_up_end\n" + |
| | | "FROM\n" + |
| | | "\tcom_act_activity a \n" + |
| | | "\tLEFT JOIN sys_user u on a.sponsor_id=u.user_id\n" + |
| | | "\tLEFT JOIN com_act_act_sign s on a.id=s.activity_id\n" + |
| | | "WHERE\n" + |
| | | "\t a.`status` != 1 and a.community_id=#{comActActivityVO.communityId}\n" + |
| | | "<if test='comActActivityVO.activityName != null and comActActivityVO.activityName !=""'>" + |
| | | "\tand a.activity_name LIKE concat( #{comActActivityVO.activityName}, '%' ) \n" + |
| | | " </if> " + |
| | | "<if test='comActActivityVO.status != null and comActActivityVO.status !=0 '>" + |
| | | "AND a.`status` = #{comActActivityVO.status} \n" + |
| | | " </if> " + |
| | | "<if test='comActActivityVO.beginAt != null '>" + |
| | | "AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt} \n" + |
| | | " </if> " + |
| | | " group by a.id order by a.publish_at desc)t1 )t"+ |
| | | "</script>") |
| | | IPage<ComActActivityVO> pageActivityCommunityBack(Page page, @Param("comActActivityVO") ComActActivityVO comActActivityVO); |
| | | |
| | | @Update("update com_act_activity set `status`=4 where `status`=3 and TIMESTAMPDIFF(HOUR,SYSDATE(),sign_up_end)<=0") |
| | | int updateStatusToBeginAfterSingEnd(); |
| | | } |