Closed S0Louis closed 3 months ago
就这几个文字,我也不是华佗啊。
mapper.xml重写了insert方法,saveorupdate处理逻辑中会调用指定mapper.insert方法,可能执行到了你mapper.xml的sql
但仍有一事不明,为什么本地做测试时saveOrUpdateBatch 内部优化使用自身insert逻辑,而部署到test环境后,偶尔会出现加载在mapperXX.xml中重写的insert方法;
@nieqiurong 感谢回复,当时时间紧急,描述缺失细节,大概问题是这样的: UserMaper接口和xml中重写了BaseMapper insert 这个方法,批量处理时,调用的是ServiceImpl的saveOrUpdateBatch方法,但在近期新增字段并未维护insert方法,然后saveOrUpdateBatch在test环境偶现生成的insert SQL中缺失新增字段; 本地尝试未曾复现,还在排查其具体原因
这个排查看下.
把你重写的删了
@miemieYaho 嗯嗯,删除后确实是可以解决这个问题
请详细描述需要增加的功能 项目启动运行了一段时间,今天实体中新增一个字段,部署生产之后发现生成的SQL中,并未包含该新字段,本地测试时又完全正常