当前使用版本(必填,否则不予处理)

3.5.1

该问题是如何引起的?(确定最新版也有问题再提!!!)

使用了mybatis-plus的扩展插件 com.baomidou.mybatisplus.extension 使用savaBatch批量插入方法格式错误!末尾莫名其妙多了一个括号 insert into t_part_repair_item (id, instance_id, rma_code, actual_part_pn, part_sn, bad_part_sn, bad_part_pn, material_pn, vendor_pn, logic_store_id, logic_store_name, parts_type, maintenance_provider, good_part_sn, good_part_pn, scan_sn, idc_store_name, idc_rack_name, idc_pos_id, idc_parent_name, maintenance_begin_time, maintenance_end_time, rec_logistics_id, good_rec_time, bad_part_arrive_ime, fa_id, fa_uwork_instance_id, fa_server_asset_sn, fa_starter, fa_priority, doa_parts, is_urge, is_fa, is_offline, status, scene, is_deleted, created_time, event_desc, event_type, slot,business_id,part_pn) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?))

重现步骤(如果有就写完整)

报错信息

insert (batch index #1) failed. Cause: java.sql.BatchUpdateException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 28

Comment From: miemieYaho

请给出一个复现demo

Comment From: bolinli

已发现问题,是因为自己写的insert语句有问题,覆盖了父类的Insert方法,导致批量方法也有问题,不过可以看出来batch方法其实底层还是调的insert一条一条插入的。。。

Comment From: NipGeihou

我也遇到了这个问题,发现原来是MyBatisX生成的代码有问题,生成的Mapper.xml里的insert方法多了一个括号