<?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.TbPlussAccessChannelMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussAccessChannel">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="code" jdbcType="VARCHAR" property="code" />
    <result column="orgId" jdbcType="VARCHAR" property="orgid" />
    <result column="minRate" jdbcType="DECIMAL" property="minrate" />
    <result column="maxRate" jdbcType="VARCHAR" property="maxrate" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
  </resultMap>
  <sql id="Base_Column_List">
    id, name, code, orgId, minRate, maxRate, createTime, remark
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_access_channel
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_access_channel
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussAccessChannel">
    insert into tb_pluss_access_channel (id, name, code, 
      orgId, minRate, maxRate, 
      createTime, remark)
    values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, 
      #{orgid,jdbcType=VARCHAR}, #{minrate,jdbcType=DECIMAL}, #{maxrate,jdbcType=VARCHAR}, 
      #{createtime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussAccessChannel">
    insert into tb_pluss_access_channel
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="name != null">
        name,
      </if>
      <if test="code != null">
        code,
      </if>
      <if test="orgid != null">
        orgId,
      </if>
      <if test="minrate != null">
        minRate,
      </if>
      <if test="maxrate != null">
        maxRate,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
      <if test="remark != null">
        remark,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="code != null">
        #{code,jdbcType=VARCHAR},
      </if>
      <if test="orgid != null">
        #{orgid,jdbcType=VARCHAR},
      </if>
      <if test="minrate != null">
        #{minrate,jdbcType=DECIMAL},
      </if>
      <if test="maxrate != null">
        #{maxrate,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussAccessChannel">
    update tb_pluss_access_channel
    <set>
      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="code != null">
        code = #{code,jdbcType=VARCHAR},
      </if>
      <if test="orgid != null">
        orgId = #{orgid,jdbcType=VARCHAR},
      </if>
      <if test="minrate != null">
        minRate = #{minrate,jdbcType=DECIMAL},
      </if>
      <if test="maxrate != null">
        maxRate = #{maxrate,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussAccessChannel">
    update tb_pluss_access_channel
    set name = #{name,jdbcType=VARCHAR},
      code = #{code,jdbcType=VARCHAR},
      orgId = #{orgid,jdbcType=VARCHAR},
      minRate = #{minrate,jdbcType=DECIMAL},
      maxRate = #{maxrate,jdbcType=VARCHAR},
      createTime = #{createtime,jdbcType=TIMESTAMP},
      remark = #{remark,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>