| | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.apache.ibatis.annotations.Update; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | **/ |
| | | @Mapper |
| | | public interface ComBpActivityDAO extends BaseMapper<ComPbActivityDO> { |
| | | |
| | | // @Select("<script> " + |
| | | // " <where>" + |
| | | // "<if test='nameCn != null and nameCn.trim() != ""'>" + |
| | | // " </if> " + |
| | | // "<if test='nameCn != null and nameCn.trim() != ""'>" + |
| | | // " </if> " + |
| | | // "<if test='nameCn != null and nameCn.trim() != ""'>" + |
| | | // " </if> " + |
| | | // " </where>" + |
| | | // "</script>") |
| | | @Select("<script> " + |
| | | "SELECT\n" + |
| | | "a.id,\n" + |
| | |
| | | "enroll_time_end \n" + |
| | | "FROM\n" + |
| | | "com_pb_activity \n" + |
| | | "where community_id=#{partyBuildingActivityVO.communityId}\n"+ |
| | | "where community_id=#{partyBuildingActivityVO.communityId}\n" + |
| | | "<if test='partyBuildingActivityVO.name != null and partyBuildingActivityVO.name.trim() != ""'>" + |
| | | "and name = #{partyBuildingActivityVO.name} \n" + |
| | | " </if> " + |
| | |
| | | "AND activity_time_begin BETWEEN #{partyBuildingActivityVO.activityTimeBegin} \n" + |
| | | "AND #{partyBuildingActivityVO.activityTimeEnd}" + |
| | | " </if> " + |
| | | "order by create_at desc "+ |
| | | "order by create_at desc " + |
| | | "</script>") |
| | | IPage<PartyBuildingActivityVO> pageActivity(Page page, @Param("partyBuildingActivityVO") PartyBuildingActivityVO partyBuildingActivityVO); |
| | | |
| | | @Select("select t.id from (\n" + |
| | | "SELECT \n" + |
| | | "a.participation_lowest_num,\n" + |
| | | "a.name,\n" + |
| | | "a.id,\n" + |
| | | "COUNT(m.id)num\n" + |
| | | "FROM\n" + |
| | | "com_pb_activity a\n" + |
| | | "LEFT JOIN com_pb_activity_member m ON a.id = m.activity_id\n" + |
| | | "WHERE a.`status` in (3,4) and DATEDIFF(SYSDATE(),a.enroll_time_end)>=0\n" + |
| | | "GROUP BY a.id)t where t.num<t.participation_lowest_num") |
| | | List<Long> selectTimedTaskPartyBuildingActivity(); |
| | | |
| | | @Select("SELECT \n" + |
| | | "u.user_id\n" + |
| | | "FROM\n" + |
| | | "com_pb_activity_member m\n" + |
| | | "JOIN com_pb_member r on m.member_id=r.id\n" + |
| | | "join sys_user u on r.id_card=u.id_card and u.type=1 \n" + |
| | | "where m.activity_id=#{activityId}") |
| | | List<Long> selectTimedTaskPartyBuildingActivityUserids(Long activityId); |
| | | |
| | | @Update("<script> " + |
| | | "update com_pb_activity set `status`=6 WHERE id in \n" + |
| | | "<foreach item=\"item\" collection=\"ids\" separator=\",\" open=\"(\" close=\")\" index=\"\"> \n" + |
| | | "#{item}\n" + |
| | | "</foreach>\n" + |
| | | "</script>") |
| | | int updateBatchIds(@Param("ids") List<Long> ids); |
| | | |
| | | @Update("update com_pb_activity set status=2 where `status`=1 and DATEDIFF(SYSDATE(),release_time)>=0") |
| | | int updateStatusToNotBegin(); |
| | | |
| | | @Update("update com_pb_activity set status=3 where `status`=2 and DATEDIFF(SYSDATE(),enroll_time_begin)>=0") |
| | | int updateStatusToSign(); |
| | | |
| | | @Update("update com_pb_activity set status=(if(DATEDIFF(SYSDATE(),activity_time_end)>=0,5,4)) where `status`=3 and DATEDIFF(SYSDATE(),activity_time_begin)>=0") |
| | | int updateStatusToActiveOrEnd(); |
| | | } |