<?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.TbPlussRiskBlacklistMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussRiskBlacklist">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="idcardNo" jdbcType="VARCHAR" property="idcardno" />
    <result column="certName" jdbcType="VARCHAR" property="certname" />
    <result column="userId" jdbcType="INTEGER" property="userid" />
    <result column="causeUserId" jdbcType="INTEGER" property="causeuserid" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="channel" jdbcType="INTEGER" property="channel" />
    <result column="payWay" jdbcType="VARCHAR" property="payway" />
    <result column="status" jdbcType="VARCHAR" property="status" />
    <result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
    <result column="updateTime" jdbcType="TIMESTAMP" property="updatetime" />
  </resultMap>
  <sql id="Base_Column_List">
    id, idcardNo, certName, userId, causeUserId, remark, channel, payWay, status, createTime, 
    updateTime
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_risk_blacklist
    where id = #{id,jdbcType=INTEGER}
  </select>
    <select id="selectCount" resultType="java.lang.Integer">
      select count(idcardNo)
      FROM tb_pluss_risk_blacklist
      WHERE idcardNo = #{idCardNo}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_risk_blacklist
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussRiskBlacklist">
    insert into tb_pluss_risk_blacklist (id, idcardNo, certName, 
      userId, causeUserId, remark, 
      channel, payWay, status, 
      createTime, updateTime)
    values (#{id,jdbcType=INTEGER}, #{idcardno,jdbcType=VARCHAR}, #{certname,jdbcType=VARCHAR}, 
      #{userid,jdbcType=INTEGER}, #{causeuserid,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, 
      #{channel,jdbcType=INTEGER}, #{payway,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, 
      #{createtime,jdbcType=TIMESTAMP}, #{updatetime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussRiskBlacklist">
    insert into tb_pluss_risk_blacklist
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="idcardno != null">
        idcardNo,
      </if>
      <if test="certname != null">
        certName,
      </if>
      <if test="userid != null">
        userId,
      </if>
      <if test="causeuserid != null">
        causeUserId,
      </if>
      <if test="remark != null">
        remark,
      </if>
      <if test="channel != null">
        channel,
      </if>
      <if test="payway != null">
        payWay,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
      <if test="updatetime != null">
        updateTime,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="idcardno != null">
        #{idcardno,jdbcType=VARCHAR},
      </if>
      <if test="certname != null">
        #{certname,jdbcType=VARCHAR},
      </if>
      <if test="userid != null">
        #{userid,jdbcType=INTEGER},
      </if>
      <if test="causeuserid != null">
        #{causeuserid,jdbcType=INTEGER},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="channel != null">
        #{channel,jdbcType=INTEGER},
      </if>
      <if test="payway != null">
        #{payway,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=VARCHAR},
      </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.TbPlussRiskBlacklist">
    update tb_pluss_risk_blacklist
    <set>
      <if test="idcardno != null">
        idcardNo = #{idcardno,jdbcType=VARCHAR},
      </if>
      <if test="certname != null">
        certName = #{certname,jdbcType=VARCHAR},
      </if>
      <if test="userid != null">
        userId = #{userid,jdbcType=INTEGER},
      </if>
      <if test="causeuserid != null">
        causeUserId = #{causeuserid,jdbcType=INTEGER},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="channel != null">
        channel = #{channel,jdbcType=INTEGER},
      </if>
      <if test="payway != null">
        payWay = #{payway,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=VARCHAR},
      </if>
      <if test="createtime != null">
        createTime = #{createtime,jdbcType=TIMESTAMP},
      </if>
      <if test="updatetime != null">
        updateTime = #{updatetime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chaozhanggui.dao.system.entity.TbPlussRiskBlacklist">
    update tb_pluss_risk_blacklist
    set idcardNo = #{idcardno,jdbcType=VARCHAR},
      certName = #{certname,jdbcType=VARCHAR},
      userId = #{userid,jdbcType=INTEGER},
      causeUserId = #{causeuserid,jdbcType=INTEGER},
      remark = #{remark,jdbcType=VARCHAR},
      channel = #{channel,jdbcType=INTEGER},
      payWay = #{payway,jdbcType=VARCHAR},
      status = #{status,jdbcType=VARCHAR},
      createTime = #{createtime,jdbcType=TIMESTAMP},
      updateTime = #{updatetime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>