mybatis 返回插入数据的逐渐(MySQL)
程序员文章站
2022-05-29 16:47:12
...
配置文件书写如下
<insert id="insertUser" parameterType="com.xxxx.User">
<selectKey resultType="Integer" order="AFTER" keyProperty="user_id">
SELECT LAST_INSERT_ID()
</selectKey>
INSERT INTO `xxx`.`xxx`
....
</insert>
<insert id="insertUser" parameterType="com.xxxx.User">
<selectKey resultType="Integer" order="AFTER" keyProperty="user_id">
SELECT LAST_INSERT_ID()
</selectKey>
INSERT INTO `xxx`.`xxx`
....
</insert>