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