INSERT INTO xx ……
<selectKey keyProperty="id" resultClass="long"> SELECT LAST_INSERT_ID(); </selectKey>