这里举例查询添加后的id值
<insert id="add">
<selectKey keyProperty="tid" order="AFTER" resultType="int">
select last_insert_id()
</selectKey>
insert into tree values(null,#{tree_name},${buy_num},${unit_price},${total_price},#{kid})
</insert>
这里举例查询添加后的id值
<insert id="add">
<selectKey keyProperty="tid" order="AFTER" resultType="int">
select last_insert_id()
</selectKey>
insert into tree values(null,#{tree_name},${buy_num},${unit_price},${total_price},#{kid})
</insert>