| | |
| | | + "count(if(s.is_volunteer=1,s.id,null))volunteer_now, " |
| | | + "count(if(s.is_volunteer=0,s.id,null))participant_now, " + "a.participant_max, " + "a.sign_up_begin, " |
| | | + "a.sign_up_end, " + "ca.name as communityName " + "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 " |
| | | + "left join sys_user u on a.sponsor_id=u.user_id " + "left join (select * from com_act_act_sign where `status` = 1) s on a.id=s.activity_id " |
| | | + "left join com_act ca on a.community_id=ca.community_id " + " where 1=1 " + |
| | | |
| | | "<if test='comActActivityVO.choice == 0 '>" + "AND a.community_id=#{comActActivityVO.communityId} " + " </if> " |
| | |
| | | */ |
| | | ComActActivityVO inforActivity(@Param("id") Long id); |
| | | |
| | | @Select("SELECT " + "a.* " + "FROM " + "com_act_act_sign s " + "JOIN com_act_activity a ON s.activity_id = a.id " |
| | | @Select("SELECT " + "a.* " + "FROM " + "(select * from com_act_act_sign where `status` = 1) s " + "JOIN com_act_activity a ON s.activity_id = a.id " |
| | | + "WHERE " + "s.user_id = #{comActActivityVO.sponsorId} " + "ORDER BY " + "s.create_at DESC") |
| | | IPage<ComActActivityVO> pageMyActivity(Page page, @Param("comActActivityVO") ComActActivityVO comActActivityVO); |
| | | |
| | | @Select("select " + "t.activity_name," + "t.id," + "t.end_at," + "t.begin_at," + "t.cover," + "t.status " |
| | | + "from com_act_act_sign s " |
| | | + "from (select * from com_act_act_sign where `status` = 1) s " |
| | | + "join sys_user u on s.user_id=u.user_id and u.phone=#{phone} and s.is_volunteer=1 " |
| | | + "join com_act_activity t on s.activity_id=t.id and t.status=5") |
| | | List<ComActActivityVO> listActivityByPhone(String phone); |
| | |
| | | @Select("select t.id from ( " + "SELECT " + "a.id, " + "a.activity_name, " |
| | | + "COUNT(case when s.is_volunteer=1 then s.id else null end )volunteernum, " |
| | | + "COUNT(case when s.is_volunteer=0 then s.id else null end)usernum, " + "a.participant_min, " |
| | | + "a.volunteer_min " + "FROM " + "com_act_activity a " + "LEFT JOIN com_act_act_sign s on a.id=s.activity_id " |
| | | + "a.volunteer_min " + "FROM " + "com_act_activity a " + "LEFT JOIN (select * from com_act_act_sign where `status` = 1) s on a.id=s.activity_id " |
| | | + "WHERE " + "a.`status` in(3,4) and TIMESTAMPDIFF(MINUTE,SYSDATE(),a.sign_up_end)<=0 " |
| | | + "GROUP BY a.id)t WHERE t.usernum<participant_min or t.volunteernum<volunteer_min") |
| | | List<Long> selectTimedTaskActActivity(); |
| | |
| | | @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(caas.user_id) from (select * from com_act_act_sign where `status` = 1) 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 (select * from com_act_act_sign where `status` = 1) 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}") |
| | |
| | | @Param("actActivityListDTO") ScreenActActivityListDTO actActivityListDTO); |
| | | |
| | | @Select("SELECT " + " count( caas.id ) AS volunteerCount,( " + " SELECT " + " count( caas1.id ) " + " FROM " |
| | | + " com_act_act_sign AS caas1 " + " LEFT JOIN sys_user AS su1 ON su1.user_id = caas1.user_id " + " WHERE " |
| | | + " (select * from com_act_act_sign where `status` = 1) AS caas1 " + " LEFT JOIN sys_user AS su1 ON su1.user_id = caas1.user_id " + " WHERE " |
| | | + " su1.is_volunteer = 0 " + " AND caas1.activity_id = #{activityId} " + " ) AS participantCount " |
| | | + "FROM " + " com_act_act_sign AS caas " + " LEFT JOIN sys_user AS su ON su.user_id = caas.user_id " + "WHERE " |
| | | + "FROM " + " (select * from com_act_act_sign where `status` = 1) AS caas " + " LEFT JOIN sys_user AS su ON su.user_id = caas.user_id " + "WHERE " |
| | | + " su.is_volunteer = 1 " + " AND activity_id = #{activityId} ") |
| | | ActActivityListVO getScreenActActivityPeopleCount(@Param("activityId") Long activityId); |
| | | |