<?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.zheng.ucenter.dao.mapper.UcenterUserLogMapper">
  <resultMap id="BaseResultMap" type="com.zheng.ucenter.dao.model.UcenterUserLog">
    <id column="user_log_id" jdbcType="INTEGER" property="userLogId" />
    <result column="user_id" jdbcType="INTEGER" property="userId" />
    <result column="ip" jdbcType="VARCHAR" property="ip" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.zheng.ucenter.dao.model.UcenterUserLog">
    <result column="content" jdbcType="VARBINARY" property="content" />
    <result column="agent" jdbcType="VARBINARY" property="agent" />
  </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">
    user_log_id, user_id, ip, create_time
  </sql>
  <sql id="Blob_Column_List">
    content, agent
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="com.zheng.ucenter.dao.model.UcenterUserLogExample" resultMap="ResultMapWithBLOBs">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from ucenter_user_log
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByExample" parameterType="com.zheng.ucenter.dao.model.UcenterUserLogExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from ucenter_user_log
    <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="ResultMapWithBLOBs">
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from ucenter_user_log
    where user_log_id = #{userLogId,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from ucenter_user_log
    where user_log_id = #{userLogId,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.zheng.ucenter.dao.model.UcenterUserLogExample">
    delete from ucenter_user_log
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zheng.ucenter.dao.model.UcenterUserLog">
    insert into ucenter_user_log (user_log_id, user_id, ip, 
      create_time, content, agent
      )
    values (#{userLogId,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{ip,jdbcType=VARCHAR}, 
      #{createTime,jdbcType=TIMESTAMP}, #{content,jdbcType=VARBINARY}, #{agent,jdbcType=VARBINARY}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.zheng.ucenter.dao.model.UcenterUserLog">
    insert into ucenter_user_log
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="userLogId != null">
        user_log_id,
      </if>
      <if test="userId != null">
        user_id,
      </if>
      <if test="ip != null">
        ip,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="content != null">
        content,
      </if>
      <if test="agent != null">
        agent,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="userLogId != null">
        #{userLogId,jdbcType=INTEGER},
      </if>
      <if test="userId != null">
        #{userId,jdbcType=INTEGER},
      </if>
      <if test="ip != null">
        #{ip,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="content != null">
        #{content,jdbcType=VARBINARY},
      </if>
      <if test="agent != null">
        #{agent,jdbcType=VARBINARY},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zheng.ucenter.dao.model.UcenterUserLogExample" resultType="java.lang.Long">
    select count(*) from ucenter_user_log
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update ucenter_user_log
    <set>
      <if test="record.userLogId != null">
        user_log_id = #{record.userLogId,jdbcType=INTEGER},
      </if>
      <if test="record.userId != null">
        user_id = #{record.userId,jdbcType=INTEGER},
      </if>
      <if test="record.ip != null">
        ip = #{record.ip,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.content != null">
        content = #{record.content,jdbcType=VARBINARY},
      </if>
      <if test="record.agent != null">
        agent = #{record.agent,jdbcType=VARBINARY},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExampleWithBLOBs" parameterType="map">
    update ucenter_user_log
    set user_log_id = #{record.userLogId,jdbcType=INTEGER},
      user_id = #{record.userId,jdbcType=INTEGER},
      ip = #{record.ip,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      content = #{record.content,jdbcType=VARBINARY},
      agent = #{record.agent,jdbcType=VARBINARY}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update ucenter_user_log
    set user_log_id = #{record.userLogId,jdbcType=INTEGER},
      user_id = #{record.userId,jdbcType=INTEGER},
      ip = #{record.ip,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zheng.ucenter.dao.model.UcenterUserLog">
    update ucenter_user_log
    <set>
      <if test="userId != null">
        user_id = #{userId,jdbcType=INTEGER},
      </if>
      <if test="ip != null">
        ip = #{ip,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="content != null">
        content = #{content,jdbcType=VARBINARY},
      </if>
      <if test="agent != null">
        agent = #{agent,jdbcType=VARBINARY},
      </if>
    </set>
    where user_log_id = #{userLogId,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.zheng.ucenter.dao.model.UcenterUserLog">
    update ucenter_user_log
    set user_id = #{userId,jdbcType=INTEGER},
      ip = #{ip,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      content = #{content,jdbcType=VARBINARY},
      agent = #{agent,jdbcType=VARBINARY}
    where user_log_id = #{userLogId,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zheng.ucenter.dao.model.UcenterUserLog">
    update ucenter_user_log
    set user_id = #{userId,jdbcType=INTEGER},
      ip = #{ip,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP}
    where user_log_id = #{userLogId,jdbcType=INTEGER}
  </update>
  <cache type="org.mybatis.caches.ehcache.LoggingEhcache" />
</mapper>