<?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.TbPlussPhoneValidateCodeMapper">
  <resultMap id="BaseResultMap" type="com.chaozhanggui.dao.system.entity.TbPlussPhoneValidateCode">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="phone" jdbcType="VARCHAR" property="phone" />
    <result column="code" jdbcType="VARCHAR" property="code" />
    <result column="sendDt" jdbcType="TIMESTAMP" property="senddt" />
    <result column="status" jdbcType="VARCHAR" property="status" />
    <result column="attempt" jdbcType="BIT" property="attempt" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
  </resultMap>
  <sql id="Base_Column_List">
    id, phone, code, sendDt, status, attempt, remark
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from tb_pluss_phone_validate_code
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tb_pluss_phone_validate_code
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussPhoneValidateCode">
    insert into tb_pluss_phone_validate_code (id, phone, code, 
      sendDt, status, attempt, 
      remark)
    values (#{id,jdbcType=INTEGER}, #{phone,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, 
      #{senddt,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR}, #{attempt,jdbcType=BIT}, 
      #{remark,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussPhoneValidateCode">
    insert into tb_pluss_phone_validate_code
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="phone != null">
        phone,
      </if>
      <if test="code != null">
        code,
      </if>
      <if test="senddt != null">
        sendDt,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="attempt != null">
        attempt,
      </if>
      <if test="remark != null">
        remark,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="phone != null">
        #{phone,jdbcType=VARCHAR},
      </if>
      <if test="code != null">
        #{code,jdbcType=VARCHAR},
      </if>
      <if test="senddt != null">
        #{senddt,jdbcType=TIMESTAMP},
      </if>
      <if test="status != null">
        #{status,jdbcType=VARCHAR},
      </if>
      <if test="attempt != null">
        #{attempt,jdbcType=BIT},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussPhoneValidateCode">
    update tb_pluss_phone_validate_code
    <set>
      <if test="phone != null">
        phone = #{phone,jdbcType=VARCHAR},
      </if>
      <if test="code != null">
        code = #{code,jdbcType=VARCHAR},
      </if>
      <if test="senddt != null">
        sendDt = #{senddt,jdbcType=TIMESTAMP},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=VARCHAR},
      </if>
      <if test="attempt != null">
        attempt = #{attempt,jdbcType=BIT},
      </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.TbPlussPhoneValidateCode">
    update tb_pluss_phone_validate_code
    set phone = #{phone,jdbcType=VARCHAR},
      code = #{code,jdbcType=VARCHAR},
      sendDt = #{senddt,jdbcType=TIMESTAMP},
      status = #{status,jdbcType=VARCHAR},
      attempt = #{attempt,jdbcType=BIT},
      remark = #{remark,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>