@Query(value="select a from Activity a where CURRENT_TIMESTAMP between startTime and endTime and status=1 order by a.createTime desc")
@Query(value="select a from Activity a where CURRENT_TIMESTAMP between startTime and endTime and status=1 order by a.createTime desc")
Page<Activity>getAllActivity(Pageablepageable);
Page<Activity>getAllActivity(Pageablepageable);
booleanexistsByUseType(IntegeruseType);
booleanexistsByUseType(IntegeruseType);
@Query(value="select * from Activity a where CURRENT_TIMESTAMP between a.start_time and a.end_time and a.status=1 order by a.create_time desc limit 1",nativeQuery=true)
@Query(value="select * from Activity a where CURRENT_TIMESTAMP between a.start_time and a.end_time and a.status=1 and use_type=:useType order by a.create_time desc limit 1",nativeQuery=true)
@Query(value="select * from Activity a where CURRENT_TIMESTAMP between a.start_time and a.end_time and a.status=1 and use_type=:useType",nativeQuery=true)