writer、processor、reader复杂太难用,使用mybatis太复杂,操作数据库太复杂,一不小心还会配置出错。

使用tasklet更加方便!

@Component
public class xxtasklet implements Tasklet {

    @Nullable
    @Transactional
    @Override
    public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
        Map<String, Object> jobParameters = chunkContext.getStepContext().getJobParameters();
        //这里写逻辑
    }
}