linhw 2024-08-01 10:44:43 +08:00
parent 89471bc539
commit 9107e76fa5
3 changed files with 4 additions and 3 deletions

View File

@ -25,6 +25,7 @@ public class ScheduledService {
appUserMapper.updateAppUserById(ids);
}*/
}
//0 * * ? * *
@Scheduled(cron = "0 */1 * * * *")
public void updateEvents(){

View File

@ -48,7 +48,7 @@ public class AppEventsServiceImpl implements IAppEventsService
*/
@Override
public List<AppEvents> selectAppEventsList(AppEvents appEvents) {
if (appEvents != null && appEvents.getType() == 4 && appEvents.getUserId() != null) {
if (appEvents.getType() != null && appEvents.getType() == 4 && appEvents.getUserId() != null) {
appEvents.setType(2l);
AppEventsUser appEventsUser = new AppEventsUser();
appEventsUser.setUserId(appEvents.getUserId());

View File

@ -115,11 +115,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where
<if test="type == 1">
type = 1
and start_time gt;= now()
and date_format(start_time,'%Y-%m-%d %H:%i') &gt;= date_format(now(),'%Y-%m-%d %H:%i')
</if>
<if test="type == 2">
type = 2
and end_time gt;= now()
and date_format(end_time,'%Y-%m-%d %H:%i') &gt;= date_format(now(),'%Y-%m-%d %H:%i')
</if>
</update>