<?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.TbPlussUserAssessMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussUserAssess">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="userId" jdbcType="INTEGER" property="userid" />
    <result column="roleCode" jdbcType="VARCHAR" property="rolecode" />
    <result column="directMercNum" jdbcType="INTEGER" property="directmercnum" />
    <result column="validMercNum" jdbcType="INTEGER" property="validmercnum" />
    <result column="expireTime" jdbcType="TIMESTAMP" property="expiretime" />
    <result column="isCheck" jdbcType="TINYINT" property="ischeck" />
    <result column="isWhite" jdbcType="TINYINT" property="iswhite" />
    <result column="reason" jdbcType="VARCHAR" property="reason" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
  </resultMap>
  <sql id="Base_Column_List">
    id, userId, roleCode, directMercNum, validMercNum, expireTime, isCheck, isWhite, 
    reason, remark, createTime
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_user_assess
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_user_assess
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserAssess">
    insert into tb_pluss_user_assess (id, userId, roleCode, 
      directMercNum, validMercNum, expireTime, 
      isCheck, isWhite, reason, 
      remark, createTime)
    values (#{id,jdbcType=INTEGER}, #{userid,jdbcType=INTEGER}, #{rolecode,jdbcType=VARCHAR}, 
      #{directmercnum,jdbcType=INTEGER}, #{validmercnum,jdbcType=INTEGER}, #{expiretime,jdbcType=TIMESTAMP}, 
      #{ischeck,jdbcType=TINYINT}, #{iswhite,jdbcType=TINYINT}, #{reason,jdbcType=VARCHAR}, 
      #{remark,jdbcType=VARCHAR}, #{createtime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserAssess">
    insert into tb_pluss_user_assess
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="userid != null">
        userId,
      </if>
      <if test="rolecode != null">
        roleCode,
      </if>
      <if test="directmercnum != null">
        directMercNum,
      </if>
      <if test="validmercnum != null">
        validMercNum,
      </if>
      <if test="expiretime != null">
        expireTime,
      </if>
      <if test="ischeck != null">
        isCheck,
      </if>
      <if test="iswhite != null">
        isWhite,
      </if>
      <if test="reason != null">
        reason,
      </if>
      <if test="remark != null">
        remark,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="userid != null">
        #{userid,jdbcType=INTEGER},
      </if>
      <if test="rolecode != null">
        #{rolecode,jdbcType=VARCHAR},
      </if>
      <if test="directmercnum != null">
        #{directmercnum,jdbcType=INTEGER},
      </if>
      <if test="validmercnum != null">
        #{validmercnum,jdbcType=INTEGER},
      </if>
      <if test="expiretime != null">
        #{expiretime,jdbcType=TIMESTAMP},
      </if>
      <if test="ischeck != null">
        #{ischeck,jdbcType=TINYINT},
      </if>
      <if test="iswhite != null">
        #{iswhite,jdbcType=TINYINT},
      </if>
      <if test="reason != null">
        #{reason,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussUserAssess">
    update tb_pluss_user_assess
    <set>
      <if test="userid != null">
        userId = #{userid,jdbcType=INTEGER},
      </if>
      <if test="rolecode != null">
        roleCode = #{rolecode,jdbcType=VARCHAR},
      </if>
      <if test="directmercnum != null">
        directMercNum = #{directmercnum,jdbcType=INTEGER},
      </if>
      <if test="validmercnum != null">
        validMercNum = #{validmercnum,jdbcType=INTEGER},
      </if>
      <if test="expiretime != null">
        expireTime = #{expiretime,jdbcType=TIMESTAMP},
      </if>
      <if test="ischeck != null">
        isCheck = #{ischeck,jdbcType=TINYINT},
      </if>
      <if test="iswhite != null">
        isWhite = #{iswhite,jdbcType=TINYINT},
      </if>
      <if test="reason != null">
        reason = #{reason,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </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.TbPlussUserAssess">
    update tb_pluss_user_assess
    set userId = #{userid,jdbcType=INTEGER},
      roleCode = #{rolecode,jdbcType=VARCHAR},
      directMercNum = #{directmercnum,jdbcType=INTEGER},
      validMercNum = #{validmercnum,jdbcType=INTEGER},
      expireTime = #{expiretime,jdbcType=TIMESTAMP},
      isCheck = #{ischeck,jdbcType=TINYINT},
      isWhite = #{iswhite,jdbcType=TINYINT},
      reason = #{reason,jdbcType=VARCHAR},
      remark = #{remark,jdbcType=VARCHAR},
      createTime = #{createtime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>