<?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.TbPlussUserIntegralMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussUserIntegral">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="userId" jdbcType="INTEGER" property="userid" />
    <result column="orderNumber" jdbcType="VARCHAR" property="ordernumber" />
    <result column="integral" jdbcType="DECIMAL" property="integral" />
    <result column="orderAmt" jdbcType="DECIMAL" property="orderamt" />
    <result column="type" jdbcType="VARCHAR" property="type" />
    <result column="source" jdbcType="VARCHAR" property="source" />
    <result column="status" jdbcType="INTEGER" property="status" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
  </resultMap>
  <sql id="Base_Column_List">
    id, userId, orderNumber, integral, orderAmt, type, source, status, remark, createTime
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_user_integral
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_user_integral
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserIntegral">
    insert into tb_pluss_user_integral (id, userId, orderNumber, 
      integral, orderAmt, type, 
      source, status, remark, 
      createTime)
    values (#{id,jdbcType=INTEGER}, #{userid,jdbcType=INTEGER}, #{ordernumber,jdbcType=VARCHAR}, 
      #{integral,jdbcType=DECIMAL}, #{orderamt,jdbcType=DECIMAL}, #{type,jdbcType=VARCHAR}, 
      #{source,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, 
      #{createtime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserIntegral">
    insert into tb_pluss_user_integral
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="userid != null">
        userId,
      </if>
      <if test="ordernumber != null">
        orderNumber,
      </if>
      <if test="integral != null">
        integral,
      </if>
      <if test="orderamt != null">
        orderAmt,
      </if>
      <if test="type != null">
        type,
      </if>
      <if test="source != null">
        source,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="remark != null">
        remark,
      </if>
      <if test="createtime != null">
        createTime,
      </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="ordernumber != null">
        #{ordernumber,jdbcType=VARCHAR},
      </if>
      <if test="integral != null">
        #{integral,jdbcType=DECIMAL},
      </if>
      <if test="orderamt != null">
        #{orderamt,jdbcType=DECIMAL},
      </if>
      <if test="type != null">
        #{type,jdbcType=VARCHAR},
      </if>
      <if test="source != null">
        #{source,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=INTEGER},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserIntegral">
    update tb_pluss_user_integral
    <set>
      <if test="userid != null">
        userId = #{userid,jdbcType=INTEGER},
      </if>
      <if test="ordernumber != null">
        orderNumber = #{ordernumber,jdbcType=VARCHAR},
      </if>
      <if test="integral != null">
        integral = #{integral,jdbcType=DECIMAL},
      </if>
      <if test="orderamt != null">
        orderAmt = #{orderamt,jdbcType=DECIMAL},
      </if>
      <if test="type != null">
        type = #{type,jdbcType=VARCHAR},
      </if>
      <if test="source != null">
        source = #{source,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=INTEGER},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserIntegral">
    update tb_pluss_user_integral
    set userId = #{userid,jdbcType=INTEGER},
      orderNumber = #{ordernumber,jdbcType=VARCHAR},
      integral = #{integral,jdbcType=DECIMAL},
      orderAmt = #{orderamt,jdbcType=DECIMAL},
      type = #{type,jdbcType=VARCHAR},
      source = #{source,jdbcType=VARCHAR},
      status = #{status,jdbcType=INTEGER},
      remark = #{remark,jdbcType=VARCHAR},
      createTime = #{createtime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>