<insert id="insertCustomer2" parameterType="Customer">
/* order="AFTER"表示在下面的插入语句执行之后在执行 */
<selectKey keyColumn="cust_id" order="AFTER" keyProperty="custId" resultType="Integer">
select last_insert_id()
</selectKey>
insert into `customer` (cust_name,cust_profession,cust_phone,email) values
(#{custName},#{custProfession},#{cusPhone},#{custEmail})
</insert>
<insert id="insertCustomer3" parameterType="Customer"
useGeneratedKeys="true" keyProperty="custId" keyColumn="cust_id">
insert into `customer` (cust_name,cust_profession,cust_phone,email)
values (#{custName},#{custProfession},#{custPhone},#{custEmail})
</insert>
原文链接:https://blog.csdn.net/shijiujiu33/java/article/details/88541110
原文:https://www.cnblogs.com/yibuyi-123/p/12943931.html