mybatis 获取新增数据的主键

<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>
posted @ 2018-01-11 19:54  newXin  阅读(1493)  评论(0编辑  收藏  举报