Mybatis插入返回主键id

在insert语句加上如下即可,如图

useGeneratedKeys="true" keyProperty="id"

之后直接取即可

如下图

猜你喜欢

转载自blog.csdn.net/EverLJS/article/details/83146257