<%_ if (position === 'import') { _%>
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import <%= packageName %>.job.service.dto.XxlJobInfoDTO;
import java.util.List;
<%_ } _%>
<%_ if (position === 'methodInterface') { _%>
<%_ } _%>
<%_ if (position === 'method') { _%>

    public void scheduleUpdate(XxlJobInfoDTO jobInfo) {
        LambdaUpdateWrapper<XxlJobInfo> updateWrapper = new LambdaUpdateWrapper<>();
        updateWrapper.eq(XxlJobInfo::getId, jobInfo.getId());
        updateWrapper.set(XxlJobInfo::getTriggerLastTime, jobInfo.getTriggerLastTime());
        updateWrapper.set(XxlJobInfo::getTriggerNextTime, jobInfo.getTriggerNextTime());
        updateWrapper.set(XxlJobInfo::getTriggerStatus, jobInfo.getTriggerStatus());
        this.update(updateWrapper);
    }

    public List<XxlJobInfoDTO> scheduleJobQuery(long l, int preReadCount) {
        LambdaUpdateWrapper<XxlJobInfo> updateWrapper = new LambdaUpdateWrapper<>();
        updateWrapper.eq(XxlJobInfo::getTriggerStatus, 1);
        updateWrapper.le(XxlJobInfo::getTriggerNextTime, l);
        updateWrapper.orderByAsc(XxlJobInfo::getId);
        updateWrapper.last("LIMIT " + preReadCount);
        return this.list(updateWrapper).stream().map(xxlJobInfoMapper::toDto).collect(java.util.stream.Collectors.toList());
    }

<%_ } _%>
