<?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.lightinit.hsdatashow.mapper.SecurekeyMapper" >
  <resultMap id="BaseResultMap" type="com.lightinit.hsdatashow.entity.Securekey" >
    <id column="SecureKeyID" property="securekeyid" jdbcType="BIGINT" />
    <result column="UserName" property="username" jdbcType="VARCHAR" />
    <result column="SecureKey" property="securekey" jdbcType="VARCHAR" />
    <result column="BindDateTime" property="binddatetime" jdbcType="TIMESTAMP" />
    <result column="CycleStep" property="cyclestep" jdbcType="INTEGER" />
    <result column="SecureKeyType" property="securekeytype" jdbcType="INTEGER" />
    <result column="SyncDateTime" property="syncdatetime" jdbcType="TIMESTAMP" />
    <result column="ExpiresDateTime" property="expiresdatetime" jdbcType="TIMESTAMP" />
  </resultMap>
  <sql id="Base_Column_List" >
    SecureKeyID, UserName, SecureKey, BindDateTime, CycleStep, SecureKeyType, SyncDateTime, 
    ExpiresDateTime
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
    select 
    <include refid="Base_Column_List" />
    from securekey
    where SecureKeyID = #{securekeyid,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    delete from securekey
    where SecureKeyID = #{securekeyid,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.lightinit.hsdatashow.entity.Securekey" >
    insert into securekey (SecureKeyID, UserName, SecureKey, 
      BindDateTime, CycleStep, SecureKeyType, 
      SyncDateTime, ExpiresDateTime)
    values (#{securekeyid,jdbcType=BIGINT}, #{username,jdbcType=VARCHAR}, #{securekey,jdbcType=VARCHAR}, 
      #{binddatetime,jdbcType=TIMESTAMP}, #{cyclestep,jdbcType=INTEGER}, #{securekeytype,jdbcType=INTEGER}, 
      #{syncdatetime,jdbcType=TIMESTAMP}, #{expiresdatetime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.lightinit.hsdatashow.entity.Securekey" >
    insert into securekey
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="securekeyid != null" >
        SecureKeyID,
      </if>
      <if test="username != null" >
        UserName,
      </if>
      <if test="securekey != null" >
        SecureKey,
      </if>
      <if test="binddatetime != null" >
        BindDateTime,
      </if>
      <if test="cyclestep != null" >
        CycleStep,
      </if>
      <if test="securekeytype != null" >
        SecureKeyType,
      </if>
      <if test="syncdatetime != null" >
        SyncDateTime,
      </if>
      <if test="expiresdatetime != null" >
        ExpiresDateTime,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="securekeyid != null" >
        #{securekeyid,jdbcType=BIGINT},
      </if>
      <if test="username != null" >
        #{username,jdbcType=VARCHAR},
      </if>
      <if test="securekey != null" >
        #{securekey,jdbcType=VARCHAR},
      </if>
      <if test="binddatetime != null" >
        #{binddatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="cyclestep != null" >
        #{cyclestep,jdbcType=INTEGER},
      </if>
      <if test="securekeytype != null" >
        #{securekeytype,jdbcType=INTEGER},
      </if>
      <if test="syncdatetime != null" >
        #{syncdatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="expiresdatetime != null" >
        #{expiresdatetime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.lightinit.hsdatashow.entity.Securekey" >
    update securekey
    <set >
      <if test="username != null" >
        UserName = #{username,jdbcType=VARCHAR},
      </if>
      <if test="securekey != null" >
        SecureKey = #{securekey,jdbcType=VARCHAR},
      </if>
      <if test="binddatetime != null" >
        BindDateTime = #{binddatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="cyclestep != null" >
        CycleStep = #{cyclestep,jdbcType=INTEGER},
      </if>
      <if test="securekeytype != null" >
        SecureKeyType = #{securekeytype,jdbcType=INTEGER},
      </if>
      <if test="syncdatetime != null" >
        SyncDateTime = #{syncdatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="expiresdatetime != null" >
        ExpiresDateTime = #{expiresdatetime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where SecureKeyID = #{securekeyid,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.lightinit.hsdatashow.entity.Securekey" >
    update securekey
    set UserName = #{username,jdbcType=VARCHAR},
      SecureKey = #{securekey,jdbcType=VARCHAR},
      BindDateTime = #{binddatetime,jdbcType=TIMESTAMP},
      CycleStep = #{cyclestep,jdbcType=INTEGER},
      SecureKeyType = #{securekeytype,jdbcType=INTEGER},
      SyncDateTime = #{syncdatetime,jdbcType=TIMESTAMP},
      ExpiresDateTime = #{expiresdatetime,jdbcType=TIMESTAMP}
    where SecureKeyID = #{securekeyid,jdbcType=BIGINT}
  </update>
  <select id="selectByExample" parameterType="com.lightinit.hsdatashow.entity.BaseExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from securekey
    <include refid="Common.Example_Where_Clause" />
  </select>
  <select id="countByExample" parameterType="com.lightinit.hsdatashow.entity.BaseExample" resultType="java.lang.Long">
    select count(*) from securekey
    <include refid="Common.Example_Where_Clause" />
  </select>
</mapper>