<?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.TbPlussOpenAccountConfigMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussOpenAccountConfig">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="roleCode" jdbcType="VARCHAR" property="rolecode" />
    <result column="type" jdbcType="VARCHAR" property="type" />
    <result column="provinceCode" jdbcType="VARCHAR" property="provincecode" />
    <result column="cityCode" jdbcType="VARCHAR" property="citycode" />
    <result column="areaCode" jdbcType="VARCHAR" property="areacode" />
    <result column="provinceName" jdbcType="VARCHAR" property="provincename" />
    <result column="cityName" jdbcType="VARCHAR" property="cityname" />
    <result column="areaName" jdbcType="VARCHAR" property="areaname" />
    <result column="level" jdbcType="INTEGER" property="level" />
    <result column="rewardAmt" jdbcType="DECIMAL" property="rewardamt" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
  </resultMap>
  <sql id="Base_Column_List">
    id, roleCode, type, provinceCode, cityCode, areaCode, provinceName, cityName, areaName, 
    level, rewardAmt, createTime
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_open_account_config
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_open_account_config
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussOpenAccountConfig">
    insert into tb_pluss_open_account_config (id, roleCode, type, 
      provinceCode, cityCode, areaCode, 
      provinceName, cityName, areaName, 
      level, rewardAmt, createTime
      )
    values (#{id,jdbcType=INTEGER}, #{rolecode,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, 
      #{provincecode,jdbcType=VARCHAR}, #{citycode,jdbcType=VARCHAR}, #{areacode,jdbcType=VARCHAR}, 
      #{provincename,jdbcType=VARCHAR}, #{cityname,jdbcType=VARCHAR}, #{areaname,jdbcType=VARCHAR}, 
      #{level,jdbcType=INTEGER}, #{rewardamt,jdbcType=DECIMAL}, #{createtime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussOpenAccountConfig">
    insert into tb_pluss_open_account_config
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="rolecode != null">
        roleCode,
      </if>
      <if test="type != null">
        type,
      </if>
      <if test="provincecode != null">
        provinceCode,
      </if>
      <if test="citycode != null">
        cityCode,
      </if>
      <if test="areacode != null">
        areaCode,
      </if>
      <if test="provincename != null">
        provinceName,
      </if>
      <if test="cityname != null">
        cityName,
      </if>
      <if test="areaname != null">
        areaName,
      </if>
      <if test="level != null">
        level,
      </if>
      <if test="rewardamt != null">
        rewardAmt,
      </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="type != null">
        #{type,jdbcType=VARCHAR},
      </if>
      <if test="provincecode != null">
        #{provincecode,jdbcType=VARCHAR},
      </if>
      <if test="citycode != null">
        #{citycode,jdbcType=VARCHAR},
      </if>
      <if test="areacode != null">
        #{areacode,jdbcType=VARCHAR},
      </if>
      <if test="provincename != null">
        #{provincename,jdbcType=VARCHAR},
      </if>
      <if test="cityname != null">
        #{cityname,jdbcType=VARCHAR},
      </if>
      <if test="areaname != null">
        #{areaname,jdbcType=VARCHAR},
      </if>
      <if test="level != null">
        #{level,jdbcType=INTEGER},
      </if>
      <if test="rewardamt != null">
        #{rewardamt,jdbcType=DECIMAL},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussOpenAccountConfig">
    update tb_pluss_open_account_config
    <set>
      <if test="rolecode != null">
        roleCode = #{rolecode,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        type = #{type,jdbcType=VARCHAR},
      </if>
      <if test="provincecode != null">
        provinceCode = #{provincecode,jdbcType=VARCHAR},
      </if>
      <if test="citycode != null">
        cityCode = #{citycode,jdbcType=VARCHAR},
      </if>
      <if test="areacode != null">
        areaCode = #{areacode,jdbcType=VARCHAR},
      </if>
      <if test="provincename != null">
        provinceName = #{provincename,jdbcType=VARCHAR},
      </if>
      <if test="cityname != null">
        cityName = #{cityname,jdbcType=VARCHAR},
      </if>
      <if test="areaname != null">
        areaName = #{areaname,jdbcType=VARCHAR},
      </if>
      <if test="level != null">
        level = #{level,jdbcType=INTEGER},
      </if>
      <if test="rewardamt != null">
        rewardAmt = #{rewardamt,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.TbPlussOpenAccountConfig">
    update tb_pluss_open_account_config
    set roleCode = #{rolecode,jdbcType=VARCHAR},
      type = #{type,jdbcType=VARCHAR},
      provinceCode = #{provincecode,jdbcType=VARCHAR},
      cityCode = #{citycode,jdbcType=VARCHAR},
      areaCode = #{areacode,jdbcType=VARCHAR},
      provinceName = #{provincename,jdbcType=VARCHAR},
      cityName = #{cityname,jdbcType=VARCHAR},
      areaName = #{areaname,jdbcType=VARCHAR},
      level = #{level,jdbcType=INTEGER},
      rewardAmt = #{rewardamt,jdbcType=DECIMAL},
      createTime = #{createtime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>