<?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.TbPlussUserTypeMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussUserType">
    <id column="type_code" jdbcType="VARCHAR" property="typeCode" />
    <result column="type_name" jdbcType="VARCHAR" property="typeName" />
    <result column="current_fee" jdbcType="DECIMAL" property="currentFee" />
    <result column="low_fee" jdbcType="DECIMAL" property="lowFee" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  </resultMap>
  <sql id="Base_Column_List">
    type_code, type_name, current_fee, low_fee, create_time, update_time
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_user_type
    where type_code = #{typeCode,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from tb_pluss_user_type
    where type_code = #{typeCode,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserType">
    insert into tb_pluss_user_type (type_code, type_name, current_fee, 
      low_fee, create_time, update_time
      )
    values (#{typeCode,jdbcType=VARCHAR}, #{typeName,jdbcType=VARCHAR}, #{currentFee,jdbcType=DECIMAL}, 
      #{lowFee,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserType">
    insert into tb_pluss_user_type
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="typeCode != null">
        type_code,
      </if>
      <if test="typeName != null">
        type_name,
      </if>
      <if test="currentFee != null">
        current_fee,
      </if>
      <if test="lowFee != null">
        low_fee,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="typeCode != null">
        #{typeCode,jdbcType=VARCHAR},
      </if>
      <if test="typeName != null">
        #{typeName,jdbcType=VARCHAR},
      </if>
      <if test="currentFee != null">
        #{currentFee,jdbcType=DECIMAL},
      </if>
      <if test="lowFee != null">
        #{lowFee,jdbcType=DECIMAL},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserType">
    update tb_pluss_user_type
    <set>
      <if test="typeName != null">
        type_name = #{typeName,jdbcType=VARCHAR},
      </if>
      <if test="currentFee != null">
        current_fee = #{currentFee,jdbcType=DECIMAL},
      </if>
      <if test="lowFee != null">
        low_fee = #{lowFee,jdbcType=DECIMAL},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where type_code = #{typeCode,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserType">
    update tb_pluss_user_type
    set type_name = #{typeName,jdbcType=VARCHAR},
      current_fee = #{currentFee,jdbcType=DECIMAL},
      low_fee = #{lowFee,jdbcType=DECIMAL},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP}
    where type_code = #{typeCode,jdbcType=VARCHAR}
  </update>
</mapper>