<insert id="insert" parameterType="com.mmall.pojo.Shipping" useGeneratedKeys="true" keyColumn="id">
insert into mmall_shipping (id, user_id, receiver_name,
receiver_phone, receiver_mobile, receiver_province,
receiver_city, receiver_district, receiver_address,
receiver_zip, create_time, update_time
)
values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{receiverName,jdbcType=VARCHAR},
#{receiverPhone,jdbcType=VARCHAR}, #{receiverMobile,jdbcType=VARCHAR}, #{receiverProvince,jdbcType=VARCHAR},
#{receiverCity,jdbcType=VARCHAR}, #{receiverDistrict,jdbcType=VARCHAR}, #{receiverAddress,jdbcType=VARCHAR},
#{receiverZip,jdbcType=VARCHAR}, now(), now()
)
</insert>
mybatis 获取新增数据的主键
Posted 李梵
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mybatis 获取新增数据的主键相关的知识,希望对你有一定的参考价值。
以上是关于mybatis 获取新增数据的主键的主要内容,如果未能解决你的问题,请参考以下文章
Mybatis里Mapper映射sql文件里insert的主键返回selectKey使用