<?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.bootdo.data.dao.CaDetailMapper">
  <resultMap id="BaseResultMap" type="com.bootdo.data.domain.CaDetail">
    
    <!--@Table tf_ca_detail-->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="key_pair_private" jdbcType="LONGVARCHAR" property="keyPairPrivate" />
    <result column="key_pair_public" jdbcType="LONGVARCHAR" property="keyPairPublic" />
    <result column="request_content" jdbcType="LONGVARCHAR" property="requestContent" />
    <result column="response_content" jdbcType="LONGVARCHAR" property="responseContent" />
    <result column="crate_time" jdbcType="TIMESTAMP" property="crateTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
  </resultMap>
  <sql id="Example_Where_Clause">
    
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    
    id, key_pair_private, key_pair_public, request_content, response_content, crate_time, 
    update_time, remark
  </sql>
  <select id="selectByExample" parameterType="com.bootdo.data.domain.CaDetailExample" resultMap="BaseResultMap">
    
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from tf_ca_detail
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    
    select 
    <include refid="Base_Column_List" />
    from tf_ca_detail
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    
    delete from tf_ca_detail
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.bootdo.data.domain.CaDetailExample">
    
    delete from tf_ca_detail
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.bootdo.data.domain.CaDetail" >
    
    insert into tf_ca_detail (id, key_pair_private, key_pair_public, 
      request_content, response_content, 
      crate_time, update_time, remark
      )
    values (#{id,jdbcType=INTEGER}, #{keyPairPrivate,jdbcType=LONGVARCHAR}, #{keyPairPublic,jdbcType=LONGVARCHAR}, 
      #{requestContent,jdbcType=LONGVARCHAR}, #{responseContent,jdbcType=LONGVARCHAR}, 
      #{crateTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.bootdo.data.domain.CaDetail" keyColumn="id" keyProperty="id">
    
    insert into tf_ca_detail
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="keyPairPrivate != null">
        key_pair_private,
      </if>
      <if test="keyPairPublic != null">
        key_pair_public,
      </if>
      <if test="requestContent != null">
        request_content,
      </if>
      <if test="responseContent != null">
        response_content,
      </if>
      <if test="crateTime != null">
        crate_time,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="remark != null">
        remark,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="keyPairPrivate != null">
        #{keyPairPrivate,jdbcType=LONGVARCHAR},
      </if>
      <if test="keyPairPublic != null">
        #{keyPairPublic,jdbcType=LONGVARCHAR},
      </if>
      <if test="requestContent != null">
        #{requestContent,jdbcType=LONGVARCHAR},
      </if>
      <if test="responseContent != null">
        #{responseContent,jdbcType=LONGVARCHAR},
      </if>
      <if test="crateTime != null">
        #{crateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.bootdo.data.domain.CaDetailExample" resultType="java.lang.Long">
    
    select count(*) from tf_ca_detail
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    
    update tf_ca_detail
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.keyPairPrivate != null">
        key_pair_private = #{record.keyPairPrivate,jdbcType=LONGVARCHAR},
      </if>
      <if test="record.keyPairPublic != null">
        key_pair_public = #{record.keyPairPublic,jdbcType=LONGVARCHAR},
      </if>
      <if test="record.requestContent != null">
        request_content = #{record.requestContent,jdbcType=LONGVARCHAR},
      </if>
      <if test="record.responseContent != null">
        response_content = #{record.responseContent,jdbcType=LONGVARCHAR},
      </if>
      <if test="record.crateTime != null">
        crate_time = #{record.crateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.remark != null">
        remark = #{record.remark,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    
    update tf_ca_detail
    set id = #{record.id,jdbcType=INTEGER},
      key_pair_private = #{record.keyPairPrivate,jdbcType=LONGVARCHAR},
      key_pair_public = #{record.keyPairPublic,jdbcType=LONGVARCHAR},
      request_content = #{record.requestContent,jdbcType=LONGVARCHAR},
      response_content = #{record.responseContent,jdbcType=LONGVARCHAR},
      crate_time = #{record.crateTime,jdbcType=TIMESTAMP},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      remark = #{record.remark,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.bootdo.data.domain.CaDetail">
    
    update tf_ca_detail
    <set>
      <if test="keyPairPrivate != null">
        key_pair_private = #{keyPairPrivate,jdbcType=LONGVARCHAR},
      </if>
      <if test="keyPairPublic != null">
        key_pair_public = #{keyPairPublic,jdbcType=LONGVARCHAR},
      </if>
      <if test="requestContent != null">
        request_content = #{requestContent,jdbcType=LONGVARCHAR},
      </if>
      <if test="responseContent != null">
        response_content = #{responseContent,jdbcType=LONGVARCHAR},
      </if>
      <if test="crateTime != null">
        crate_time = #{crateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.bootdo.data.domain.CaDetail">
    
    update tf_ca_detail
    set key_pair_private = #{keyPairPrivate,jdbcType=LONGVARCHAR},
      key_pair_public = #{keyPairPublic,jdbcType=LONGVARCHAR},
      request_content = #{requestContent,jdbcType=LONGVARCHAR},
      response_content = #{responseContent,jdbcType=LONGVARCHAR},
      crate_time = #{crateTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      remark = #{remark,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>