| | |
| | | "count(if(s.is_volunteer=0,s.id,null))participant_now,\n"+ |
| | | "a.participant_max,\n" + |
| | | "a.sign_up_begin,\n" + |
| | | "a.sign_up_end\n" + |
| | | "a.sign_up_end,\n" + |
| | | "ca.name as communityName \n" + |
| | | "FROM\n" + |
| | | "com_act_activity a \n" + |
| | | "join sys_user u on a.sponsor_id=u.user_id\n" + |
| | | "left join com_act_act_sign s on a.id=s.activity_id \n"+ |
| | | "left join com_act ca on a.community_id=ca.community_id \n"+ |
| | | " where 1=1 " + |
| | | |
| | | "<if test='comActActivityVO.choice == 0 '>" + |
| | | "AND d.community_id=#{comActActivityVO.communityId}\n" + |
| | | "AND a.community_id=#{comActActivityVO.communityId}\n" + |
| | | " </if> " + |
| | | |
| | | "<if test='comActActivityVO.activityName != null and comActActivityVO.activityName.trim() != ""'>" + |
| | |
| | | "AND a.`status` in (3,4) \n" + |
| | | " </if> " + |
| | | "<if test='comActActivityVO.isApplets != null and comActActivityVO.isApplets ==1'>" + |
| | | "AND a.`status` != 1 \n" + |
| | | "AND a.`status` != 1 AND a.`status` != 6 \n" + |
| | | " </if> " + |
| | | "<if test='comActActivityVO.beginAt != null '>" + |
| | | "AND a.begin_at <![CDATA[ >= ]]> #{comActActivityVO.beginAt} AND a.end_at <![CDATA[ <= ]]> #{comActActivityVO.endAt} \n" + |
| | |
| | | |
| | | @Select("SELECT \n" + |
| | | "u.name sponsorName,\n" + |
| | | "ca.name communityName,\n" + |
| | | "count(if(s.is_volunteer=1,s.id,null))volunteer_now,\n"+ |
| | | "count(if(s.is_volunteer=0,s.id,null))participant_now,\n"+ |
| | | "a.* \n" + |
| | |
| | | "com_act_activity a \n" + |
| | | "join sys_user u on a.sponsor_id=u.user_id \n"+ |
| | | "left join com_act_act_sign s on a.id=s.activity_id \n"+ |
| | | "left join com_act ca on a.community_id=ca.community_id \n"+ |
| | | "where a.id=#{id} \n"+ |
| | | " group by a.id " |
| | | ) |
| | |
| | | @Update("update com_act_activity set `status`=3 where `status`=2 and TIMESTAMPDIFF(MINUTE,SYSDATE(),sign_up_begin)<=0") |
| | | int updateStatusToBeginSign(); |
| | | |
| | | @Update("update com_act_activity set `status`=(if(DATEDIFF(SYSDATE(),end_at)>=0,5,4)) where `status` in (3,4) and TIMESTAMPDIFF(MINUTE,SYSDATE(),sign_up_end)<=0") |
| | | @Update("update com_act_activity set `status`=5 where `status` in (3,4) and TIMESTAMPDIFF(MINUTE,SYSDATE(),sign_up_end)<=0") |
| | | int updateStatusToBeginActiveOrEnd(); |
| | | @Select("<script> " + |
| | | "select t.* from (\n" + |