<?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.TbPlussUserRoleMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussUserRole">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="roleName" jdbcType="VARCHAR" property="rolename" />
    <result column="roleCode" jdbcType="VARCHAR" property="rolecode" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
    <result column="validFlag" jdbcType="INTEGER" property="validflag" />
    <result column="validTransAmt" jdbcType="DECIMAL" property="validtransamt" />
    <result column="validTransNum" jdbcType="INTEGER" property="validtransnum" />
    <result column="minNum" jdbcType="INTEGER" property="minnum" />
    <result column="openTime" jdbcType="TIMESTAMP" property="opentime" />
    <result column="protectDayNum" jdbcType="INTEGER" property="protectdaynum" />
  </resultMap>
  <sql id="Base_Column_List">
    id, roleName, roleCode, createTime, validFlag, validTransAmt, validTransNum, minNum, 
    openTime, protectDayNum
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_user_role
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_user_role
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserRole">
    insert into tb_pluss_user_role (id, roleName, roleCode, 
      createTime, validFlag, validTransAmt, 
      validTransNum, minNum, openTime, 
      protectDayNum)
    values (#{id,jdbcType=INTEGER}, #{rolename,jdbcType=VARCHAR}, #{rolecode,jdbcType=VARCHAR}, 
      #{createtime,jdbcType=TIMESTAMP}, #{validflag,jdbcType=INTEGER}, #{validtransamt,jdbcType=DECIMAL}, 
      #{validtransnum,jdbcType=INTEGER}, #{minnum,jdbcType=INTEGER}, #{opentime,jdbcType=TIMESTAMP}, 
      #{protectdaynum,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserRole">
    insert into tb_pluss_user_role
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="rolename != null">
        roleName,
      </if>
      <if test="rolecode != null">
        roleCode,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
      <if test="validflag != null">
        validFlag,
      </if>
      <if test="validtransamt != null">
        validTransAmt,
      </if>
      <if test="validtransnum != null">
        validTransNum,
      </if>
      <if test="minnum != null">
        minNum,
      </if>
      <if test="opentime != null">
        openTime,
      </if>
      <if test="protectdaynum != null">
        protectDayNum,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="rolename != null">
        #{rolename,jdbcType=VARCHAR},
      </if>
      <if test="rolecode != null">
        #{rolecode,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="validflag != null">
        #{validflag,jdbcType=INTEGER},
      </if>
      <if test="validtransamt != null">
        #{validtransamt,jdbcType=DECIMAL},
      </if>
      <if test="validtransnum != null">
        #{validtransnum,jdbcType=INTEGER},
      </if>
      <if test="minnum != null">
        #{minnum,jdbcType=INTEGER},
      </if>
      <if test="opentime != null">
        #{opentime,jdbcType=TIMESTAMP},
      </if>
      <if test="protectdaynum != null">
        #{protectdaynum,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserRole">
    update tb_pluss_user_role
    <set>
      <if test="rolename != null">
        roleName = #{rolename,jdbcType=VARCHAR},
      </if>
      <if test="rolecode != null">
        roleCode = #{rolecode,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="validflag != null">
        validFlag = #{validflag,jdbcType=INTEGER},
      </if>
      <if test="validtransamt != null">
        validTransAmt = #{validtransamt,jdbcType=DECIMAL},
      </if>
      <if test="validtransnum != null">
        validTransNum = #{validtransnum,jdbcType=INTEGER},
      </if>
      <if test="minnum != null">
        minNum = #{minnum,jdbcType=INTEGER},
      </if>
      <if test="opentime != null">
        openTime = #{opentime,jdbcType=TIMESTAMP},
      </if>
      <if test="protectdaynum != null">
        protectDayNum = #{protectdaynum,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserRole">
    update tb_pluss_user_role
    set roleName = #{rolename,jdbcType=VARCHAR},
      roleCode = #{rolecode,jdbcType=VARCHAR},
      createTime = #{createtime,jdbcType=TIMESTAMP},
      validFlag = #{validflag,jdbcType=INTEGER},
      validTransAmt = #{validtransamt,jdbcType=DECIMAL},
      validTransNum = #{validtransnum,jdbcType=INTEGER},
      minNum = #{minnum,jdbcType=INTEGER},
      openTime = #{opentime,jdbcType=TIMESTAMP},
      protectDayNum = #{protectdaynum,jdbcType=INTEGER}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>