具体xml中sql是这样写,但是要注意SQ_USER.Nextval,SQ_USER是序列,你要替换下自己要进行操作的表的序列,不知道序列的话,可以sql查找下,select * from user_sequences查找全部序列,找到该表单序列名称,或者模糊查询表名select * from user_sequences where SEQUENCE_NAME LIKE '%USER%';,找到序列名称替换SQ_USER即可
<insert id="insertSelective" parameterType="com.xx.pojo.User">
<selectKey resultType="java.math.BigDecimal" order="BEFORE" keyProperty="id">
SELECT SQ_USER.Nextval from DUAL
</selectKey>
</insert>
https://blog.csdn.net/f1370335844/article/details/82460712