映射文件
<insert id="insertUserBaiscInfo" parameterType="hashmap">
<selectKey resultType="String" order="AFTER" keyProperty="id">
SELECT LAST_INSERT_ID() AS id
</selectKey>
INSERT INTO
u_userinfo
(
memberid,
nickname,
sex,
userpicurl
)
VALUES
(
#{memberid},
#{nickname},
#{sex},
#{userpicurl}
)
</insert>
调用:
log.info("获得id="+map.get("memberid"));
memberid是该表的主键