<?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.TbPlussUserLevelMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussUserLevel">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="roleCode" jdbcType="VARCHAR" property="rolecode" />
    <result column="levelName" jdbcType="VARCHAR" property="levelname" />
    <result column="levelCode" jdbcType="VARCHAR" property="levelcode" />
    <result column="rate" jdbcType="DECIMAL" property="rate" />
    <result column="quota" jdbcType="DECIMAL" property="quota" />
    <result column="directRate" jdbcType="DECIMAL" property="directrate" />
    <result column="indirectRate" jdbcType="DECIMAL" property="indirectrate" />
    <result column="t2Scale" jdbcType="DECIMAL" property="t2scale" />
    <result column="t3Scale" jdbcType="DECIMAL" property="t3scale" />
    <result column="dividScale" jdbcType="DECIMAL" property="dividscale" />
    <result column="areaScale" jdbcType="DECIMAL" property="areascale" />
    <result column="jftRate" jdbcType="DECIMAL" property="jftrate" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
  </resultMap>
  <sql id="Base_Column_List">
    id, roleCode, levelName, levelCode, rate, quota, directRate, indirectRate, t2Scale, 
    t3Scale, dividScale, areaScale, jftRate, createTime
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_user_level
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_user_level
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserLevel">
    insert into tb_pluss_user_level (id, roleCode, levelName, 
      levelCode, rate, quota, 
      directRate, indirectRate, t2Scale, 
      t3Scale, dividScale, areaScale, 
      jftRate, createTime)
    values (#{id,jdbcType=INTEGER}, #{rolecode,jdbcType=VARCHAR}, #{levelname,jdbcType=VARCHAR}, 
      #{levelcode,jdbcType=VARCHAR}, #{rate,jdbcType=DECIMAL}, #{quota,jdbcType=DECIMAL}, 
      #{directrate,jdbcType=DECIMAL}, #{indirectrate,jdbcType=DECIMAL}, #{t2scale,jdbcType=DECIMAL}, 
      #{t3scale,jdbcType=DECIMAL}, #{dividscale,jdbcType=DECIMAL}, #{areascale,jdbcType=DECIMAL}, 
      #{jftrate,jdbcType=DECIMAL}, #{createtime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserLevel">
    insert into tb_pluss_user_level
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="rolecode != null">
        roleCode,
      </if>
      <if test="levelname != null">
        levelName,
      </if>
      <if test="levelcode != null">
        levelCode,
      </if>
      <if test="rate != null">
        rate,
      </if>
      <if test="quota != null">
        quota,
      </if>
      <if test="directrate != null">
        directRate,
      </if>
      <if test="indirectrate != null">
        indirectRate,
      </if>
      <if test="t2scale != null">
        t2Scale,
      </if>
      <if test="t3scale != null">
        t3Scale,
      </if>
      <if test="dividscale != null">
        dividScale,
      </if>
      <if test="areascale != null">
        areaScale,
      </if>
      <if test="jftrate != null">
        jftRate,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="rolecode != null">
        #{rolecode,jdbcType=VARCHAR},
      </if>
      <if test="levelname != null">
        #{levelname,jdbcType=VARCHAR},
      </if>
      <if test="levelcode != null">
        #{levelcode,jdbcType=VARCHAR},
      </if>
      <if test="rate != null">
        #{rate,jdbcType=DECIMAL},
      </if>
      <if test="quota != null">
        #{quota,jdbcType=DECIMAL},
      </if>
      <if test="directrate != null">
        #{directrate,jdbcType=DECIMAL},
      </if>
      <if test="indirectrate != null">
        #{indirectrate,jdbcType=DECIMAL},
      </if>
      <if test="t2scale != null">
        #{t2scale,jdbcType=DECIMAL},
      </if>
      <if test="t3scale != null">
        #{t3scale,jdbcType=DECIMAL},
      </if>
      <if test="dividscale != null">
        #{dividscale,jdbcType=DECIMAL},
      </if>
      <if test="areascale != null">
        #{areascale,jdbcType=DECIMAL},
      </if>
      <if test="jftrate != null">
        #{jftrate,jdbcType=DECIMAL},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserLevel">
    update tb_pluss_user_level
    <set>
      <if test="rolecode != null">
        roleCode = #{rolecode,jdbcType=VARCHAR},
      </if>
      <if test="levelname != null">
        levelName = #{levelname,jdbcType=VARCHAR},
      </if>
      <if test="levelcode != null">
        levelCode = #{levelcode,jdbcType=VARCHAR},
      </if>
      <if test="rate != null">
        rate = #{rate,jdbcType=DECIMAL},
      </if>
      <if test="quota != null">
        quota = #{quota,jdbcType=DECIMAL},
      </if>
      <if test="directrate != null">
        directRate = #{directrate,jdbcType=DECIMAL},
      </if>
      <if test="indirectrate != null">
        indirectRate = #{indirectrate,jdbcType=DECIMAL},
      </if>
      <if test="t2scale != null">
        t2Scale = #{t2scale,jdbcType=DECIMAL},
      </if>
      <if test="t3scale != null">
        t3Scale = #{t3scale,jdbcType=DECIMAL},
      </if>
      <if test="dividscale != null">
        dividScale = #{dividscale,jdbcType=DECIMAL},
      </if>
      <if test="areascale != null">
        areaScale = #{areascale,jdbcType=DECIMAL},
      </if>
      <if test="jftrate != null">
        jftRate = #{jftrate,jdbcType=DECIMAL},
      </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.TbPlussUserLevel">
    update tb_pluss_user_level
    set roleCode = #{rolecode,jdbcType=VARCHAR},
      levelName = #{levelname,jdbcType=VARCHAR},
      levelCode = #{levelcode,jdbcType=VARCHAR},
      rate = #{rate,jdbcType=DECIMAL},
      quota = #{quota,jdbcType=DECIMAL},
      directRate = #{directrate,jdbcType=DECIMAL},
      indirectRate = #{indirectrate,jdbcType=DECIMAL},
      t2Scale = #{t2scale,jdbcType=DECIMAL},
      t3Scale = #{t3scale,jdbcType=DECIMAL},
      dividScale = #{dividscale,jdbcType=DECIMAL},
      areaScale = #{areascale,jdbcType=DECIMAL},
      jftRate = #{jftrate,jdbcType=DECIMAL},
      createTime = #{createtime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>