您的位置:首页 > 其它

mybatis插入后主键返回

2017-01-14 15:35 204 查看
<insert id="insert" parameterType="com.wenwen.pojo.User" >
<selectKey keyProperty="id" resultType="long" order="AFTER">
SELECT LAST_INSERT_ID()
</selectKey>
insert into edu_user (ID, MOBILE, EMAIL)
values (#{id,jdbcType=BIGINT}, #{mobile,jdbcType=VARCHAR},
#{email,jdbcType=VARCHAR},
</insert>


用insertSelective也是一样配置
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  mybatis select