<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.buy507.mall.mapper.DmsMemberTransferRecordMapper">
  <resultMap id="BaseResultMap" type="com.buy507.mall.model.DmsMemberTransferRecord">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="member_id" jdbcType="BIGINT" property="memberId" />
    <result column="member_nickname" jdbcType="VARCHAR" property="memberNickname" />
    <result column="receiver_id" jdbcType="BIGINT" property="receiverId" />
    <result column="receiver_nickname" jdbcType="VARCHAR" property="receiverNickname" />
    <result column="receiver_phone" jdbcType="VARCHAR" property="receiverPhone" />
    <result column="value" jdbcType="DECIMAL" property="value" />
    <result column="note" jdbcType="VARCHAR" property="note" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  </resultMap>
  
  <insert id="insert" parameterType="com.buy507.mall.model.DmsMemberTransferRecord">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into dms_member_transfer_record (member_id, member_nickname, receiver_id, receiver_nickname, receiver_phone, value, note, create_time)
    values (#{memberId,jdbcType=BIGINT},
    		#{memberNickname,jdbcType=VARCHAR},
    		#{receiverId,jdbcType=INTEGER},
    		#{receiverNickname,jdbcType=VARCHAR},
    		#{receiverPhone,jdbcType=VARCHAR},
    		#{value,jdbcType=DECIMAL},
    		#{note,jdbcType=VARCHAR},
    		#{createTime,jdbcType=TIMESTAMP})
  </insert>
  
</mapper>