<?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.TbPlussMerchantRateMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussMerchantRate">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="userId" jdbcType="INTEGER" property="userid" />
    <result column="rate" jdbcType="INTEGER" property="rate" />
    <result column="updateTime" jdbcType="TIMESTAMP" property="updatetime" />
    <result column="previousRate" jdbcType="INTEGER" property="previousrate" />
    <result column="isFixedRate" jdbcType="CHAR" property="isfixedrate" />
    <result column="startTime" jdbcType="TIMESTAMP" property="starttime" />
    <result column="endTime" jdbcType="TIMESTAMP" property="endtime" />
  </resultMap>
  <sql id="Base_Column_List">
    id, userId, rate, updateTime, previousRate, isFixedRate, startTime, endTime
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_merchant_rate
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_merchant_rate
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantRate">
    insert into tb_pluss_merchant_rate (id, userId, rate, 
      updateTime, previousRate, isFixedRate, 
      startTime, endTime)
    values (#{id,jdbcType=INTEGER}, #{userid,jdbcType=INTEGER}, #{rate,jdbcType=INTEGER}, 
      #{updatetime,jdbcType=TIMESTAMP}, #{previousrate,jdbcType=INTEGER}, #{isfixedrate,jdbcType=CHAR}, 
      #{starttime,jdbcType=TIMESTAMP}, #{endtime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantRate">
    insert into tb_pluss_merchant_rate
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="userid != null">
        userId,
      </if>
      <if test="rate != null">
        rate,
      </if>
      <if test="updatetime != null">
        updateTime,
      </if>
      <if test="previousrate != null">
        previousRate,
      </if>
      <if test="isfixedrate != null">
        isFixedRate,
      </if>
      <if test="starttime != null">
        startTime,
      </if>
      <if test="endtime != null">
        endTime,
      </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="rate != null">
        #{rate,jdbcType=INTEGER},
      </if>
      <if test="updatetime != null">
        #{updatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="previousrate != null">
        #{previousrate,jdbcType=INTEGER},
      </if>
      <if test="isfixedrate != null">
        #{isfixedrate,jdbcType=CHAR},
      </if>
      <if test="starttime != null">
        #{starttime,jdbcType=TIMESTAMP},
      </if>
      <if test="endtime != null">
        #{endtime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantRate">
    update tb_pluss_merchant_rate
    <set>
      <if test="userid != null">
        userId = #{userid,jdbcType=INTEGER},
      </if>
      <if test="rate != null">
        rate = #{rate,jdbcType=INTEGER},
      </if>
      <if test="updatetime != null">
        updateTime = #{updatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="previousrate != null">
        previousRate = #{previousrate,jdbcType=INTEGER},
      </if>
      <if test="isfixedrate != null">
        isFixedRate = #{isfixedrate,jdbcType=CHAR},
      </if>
      <if test="starttime != null">
        startTime = #{starttime,jdbcType=TIMESTAMP},
      </if>
      <if test="endtime != null">
        endTime = #{endtime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantRate">
    update tb_pluss_merchant_rate
    set userId = #{userid,jdbcType=INTEGER},
      rate = #{rate,jdbcType=INTEGER},
      updateTime = #{updatetime,jdbcType=TIMESTAMP},
      previousRate = #{previousrate,jdbcType=INTEGER},
      isFixedRate = #{isfixedrate,jdbcType=CHAR},
      startTime = #{starttime,jdbcType=TIMESTAMP},
      endTime = #{endtime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>