Sometimes we need mybatis get id after insert, available in two solutions
Option One:
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer"> SELECT LAST_INSERT_ID() </selectKey>
Option II:
<insert id="insert" parameterType="com.xxx" useGeneratedKeys="true" keyProperty="id">
Again, AFTER BEFORE must be uppercase
Reference Address: https://blog.csdn.net/hehuihh/article/details/82800739