2022年2月22日
mybatis-plus 批量的插入和更新
先看下基础结构



从以上可以看出,如果要实现批量的处理,需要试下baseService,只用mapper达不到效果 另外需要在jdbcurl串上增加这个参数,开启批量提交 rewriteBatchedStatements=true
对于service定义的例子 public interface ISysDictItemService extends IService<SysDictItem> { } @Service public class SysDictItemServiceImpl extends ServiceImpl<SysDictItemMapper, SysDictItem> implements ISysDictItemService { @Autowired private SysDictItemMapper sysDictItemMapper; } @Autowired private ISysDictItemService sysDictItemService;