在jdbc 配置url添加可批量 rewriteBatchedStatements=true
jdbc:mysql://localhost:3306/myimg?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&useSSL=false&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true&serverTimezone=UTC
添加配置
添加mapper
继承
实现,读取文件放到list 里面, 分页批量插入,速度快50万条数据不到1分钟,写一个请求,直接访问一下就好了,然后看日志打印,杠杠的快