<?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.chaozhanggui.dao.system.dao.TbPlussOpenAccountRecordMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussOpenAccountRecord">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="userId" jdbcType="INTEGER" property="userid" />
    <result column="merchantName" jdbcType="VARCHAR" property="merchantname" />
    <result column="orderNumber" jdbcType="VARCHAR" property="ordernumber" />
    <result column="orderAmt" jdbcType="DECIMAL" property="orderamt" />
    <result column="goodCode" jdbcType="VARCHAR" property="goodcode" />
    <result column="goodName" jdbcType="VARCHAR" property="goodname" />
    <result column="type" jdbcType="VARCHAR" property="type" />
    <result column="rewardAmt" jdbcType="DECIMAL" property="rewardamt" />
    <result column="status" jdbcType="VARCHAR" property="status" />
    <result column="rewardUserId" jdbcType="INTEGER" property="rewarduserid" />
    <result column="areaCode" jdbcType="VARCHAR" property="areacode" />
    <result column="areaName" jdbcType="VARCHAR" property="areaname" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
    <result column="createDate" jdbcType="DATE" property="createdate" />
    <result column="roleCode" jdbcType="VARCHAR" property="rolecode" />
  </resultMap>
  <sql id="Base_Column_List">
    id, userId, merchantName, orderNumber, orderAmt, goodCode, goodName, type, rewardAmt, 
    status, rewardUserId, areaCode, areaName, createTime, createDate, roleCode
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_open_account_record
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_open_account_record
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussOpenAccountRecord">
    insert into tb_pluss_open_account_record (id, userId, merchantName, 
      orderNumber, orderAmt, goodCode, 
      goodName, type, rewardAmt, 
      status, rewardUserId, areaCode, 
      areaName, createTime, createDate, 
      roleCode)
    values (#{id,jdbcType=INTEGER}, #{userid,jdbcType=INTEGER}, #{merchantname,jdbcType=VARCHAR}, 
      #{ordernumber,jdbcType=VARCHAR}, #{orderamt,jdbcType=DECIMAL}, #{goodcode,jdbcType=VARCHAR}, 
      #{goodname,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{rewardamt,jdbcType=DECIMAL}, 
      #{status,jdbcType=VARCHAR}, #{rewarduserid,jdbcType=INTEGER}, #{areacode,jdbcType=VARCHAR}, 
      #{areaname,jdbcType=VARCHAR}, #{createtime,jdbcType=TIMESTAMP}, #{createdate,jdbcType=DATE}, 
      #{rolecode,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussOpenAccountRecord">
    insert into tb_pluss_open_account_record
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="userid != null">
        userId,
      </if>
      <if test="merchantname != null">
        merchantName,
      </if>
      <if test="ordernumber != null">
        orderNumber,
      </if>
      <if test="orderamt != null">
        orderAmt,
      </if>
      <if test="goodcode != null">
        goodCode,
      </if>
      <if test="goodname != null">
        goodName,
      </if>
      <if test="type != null">
        type,
      </if>
      <if test="rewardamt != null">
        rewardAmt,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="rewarduserid != null">
        rewardUserId,
      </if>
      <if test="areacode != null">
        areaCode,
      </if>
      <if test="areaname != null">
        areaName,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
      <if test="createdate != null">
        createDate,
      </if>
      <if test="rolecode != null">
        roleCode,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="userid != null">
        #{userid,jdbcType=INTEGER},
      </if>
      <if test="merchantname != null">
        #{merchantname,jdbcType=VARCHAR},
      </if>
      <if test="ordernumber != null">
        #{ordernumber,jdbcType=VARCHAR},
      </if>
      <if test="orderamt != null">
        #{orderamt,jdbcType=DECIMAL},
      </if>
      <if test="goodcode != null">
        #{goodcode,jdbcType=VARCHAR},
      </if>
      <if test="goodname != null">
        #{goodname,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        #{type,jdbcType=VARCHAR},
      </if>
      <if test="rewardamt != null">
        #{rewardamt,jdbcType=DECIMAL},
      </if>
      <if test="status != null">
        #{status,jdbcType=VARCHAR},
      </if>
      <if test="rewarduserid != null">
        #{rewarduserid,jdbcType=INTEGER},
      </if>
      <if test="areacode != null">
        #{areacode,jdbcType=VARCHAR},
      </if>
      <if test="areaname != null">
        #{areaname,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="createdate != null">
        #{createdate,jdbcType=DATE},
      </if>
      <if test="rolecode != null">
        #{rolecode,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussOpenAccountRecord">
    update tb_pluss_open_account_record
    <set>
      <if test="userid != null">
        userId = #{userid,jdbcType=INTEGER},
      </if>
      <if test="merchantname != null">
        merchantName = #{merchantname,jdbcType=VARCHAR},
      </if>
      <if test="ordernumber != null">
        orderNumber = #{ordernumber,jdbcType=VARCHAR},
      </if>
      <if test="orderamt != null">
        orderAmt = #{orderamt,jdbcType=DECIMAL},
      </if>
      <if test="goodcode != null">
        goodCode = #{goodcode,jdbcType=VARCHAR},
      </if>
      <if test="goodname != null">
        goodName = #{goodname,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        type = #{type,jdbcType=VARCHAR},
      </if>
      <if test="rewardamt != null">
        rewardAmt = #{rewardamt,jdbcType=DECIMAL},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=VARCHAR},
      </if>
      <if test="rewarduserid != null">
        rewardUserId = #{rewarduserid,jdbcType=INTEGER},
      </if>
      <if test="areacode != null">
        areaCode = #{areacode,jdbcType=VARCHAR},
      </if>
      <if test="areaname != null">
        areaName = #{areaname,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="createdate != null">
        createDate = #{createdate,jdbcType=DATE},
      </if>
      <if test="rolecode != null">
        roleCode = #{rolecode,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussOpenAccountRecord">
    update tb_pluss_open_account_record
    set userId = #{userid,jdbcType=INTEGER},
      merchantName = #{merchantname,jdbcType=VARCHAR},
      orderNumber = #{ordernumber,jdbcType=VARCHAR},
      orderAmt = #{orderamt,jdbcType=DECIMAL},
      goodCode = #{goodcode,jdbcType=VARCHAR},
      goodName = #{goodname,jdbcType=VARCHAR},
      type = #{type,jdbcType=VARCHAR},
      rewardAmt = #{rewardamt,jdbcType=DECIMAL},
      status = #{status,jdbcType=VARCHAR},
      rewardUserId = #{rewarduserid,jdbcType=INTEGER},
      areaCode = #{areacode,jdbcType=VARCHAR},
      areaName = #{areaname,jdbcType=VARCHAR},
      createTime = #{createtime,jdbcType=TIMESTAMP},
      createDate = #{createdate,jdbcType=DATE},
      roleCode = #{rolecode,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>