<?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.tzld.piaoquan.api.dao.mapper.GzhAutoreplyBehaviorUvTotalMapper">
  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.api.model.po.GzhAutoreplyBehaviorUvTotal">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="dt" jdbcType="VARCHAR" property="dt" />
    <result column="channel" jdbcType="VARCHAR" property="channel" />
    <result column="gh_id" jdbcType="VARCHAR" property="ghId" />
    <result column="uv" jdbcType="INTEGER" property="uv" />
    <result column="first_level" jdbcType="INTEGER" property="firstLevel" />
    <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
  </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, dt, channel, gh_id, uv, first_level, create_timestamp
  </sql>
  <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.GzhAutoreplyBehaviorUvTotalExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from gzh_autoreply_behavior_uv_total
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    <if test="page != null">
      limit #{page.offset} , #{page.pageSize}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from gzh_autoreply_behavior_uv_total
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from gzh_autoreply_behavior_uv_total
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.api.model.po.GzhAutoreplyBehaviorUvTotalExample">
    delete from gzh_autoreply_behavior_uv_total
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.GzhAutoreplyBehaviorUvTotal">
    insert into gzh_autoreply_behavior_uv_total (id, dt, channel, 
      gh_id, uv, first_level, 
      create_timestamp)
    values (#{id,jdbcType=BIGINT}, #{dt,jdbcType=VARCHAR}, #{channel,jdbcType=VARCHAR}, 
      #{ghId,jdbcType=VARCHAR}, #{uv,jdbcType=INTEGER}, #{firstLevel,jdbcType=INTEGER}, 
      #{createTimestamp,jdbcType=BIGINT})
  </insert>
  <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.GzhAutoreplyBehaviorUvTotal">
    insert into gzh_autoreply_behavior_uv_total
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="dt != null">
        dt,
      </if>
      <if test="channel != null">
        channel,
      </if>
      <if test="ghId != null">
        gh_id,
      </if>
      <if test="uv != null">
        uv,
      </if>
      <if test="firstLevel != null">
        first_level,
      </if>
      <if test="createTimestamp != null">
        create_timestamp,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="dt != null">
        #{dt,jdbcType=VARCHAR},
      </if>
      <if test="channel != null">
        #{channel,jdbcType=VARCHAR},
      </if>
      <if test="ghId != null">
        #{ghId,jdbcType=VARCHAR},
      </if>
      <if test="uv != null">
        #{uv,jdbcType=INTEGER},
      </if>
      <if test="firstLevel != null">
        #{firstLevel,jdbcType=INTEGER},
      </if>
      <if test="createTimestamp != null">
        #{createTimestamp,jdbcType=BIGINT},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.tzld.piaoquan.api.model.po.GzhAutoreplyBehaviorUvTotalExample" resultType="java.lang.Long">
    select count(*) from gzh_autoreply_behavior_uv_total
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update gzh_autoreply_behavior_uv_total
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.dt != null">
        dt = #{record.dt,jdbcType=VARCHAR},
      </if>
      <if test="record.channel != null">
        channel = #{record.channel,jdbcType=VARCHAR},
      </if>
      <if test="record.ghId != null">
        gh_id = #{record.ghId,jdbcType=VARCHAR},
      </if>
      <if test="record.uv != null">
        uv = #{record.uv,jdbcType=INTEGER},
      </if>
      <if test="record.firstLevel != null">
        first_level = #{record.firstLevel,jdbcType=INTEGER},
      </if>
      <if test="record.createTimestamp != null">
        create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update gzh_autoreply_behavior_uv_total
    set id = #{record.id,jdbcType=BIGINT},
      dt = #{record.dt,jdbcType=VARCHAR},
      channel = #{record.channel,jdbcType=VARCHAR},
      gh_id = #{record.ghId,jdbcType=VARCHAR},
      uv = #{record.uv,jdbcType=INTEGER},
      first_level = #{record.firstLevel,jdbcType=INTEGER},
      create_timestamp = #{record.createTimestamp,jdbcType=BIGINT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.api.model.po.GzhAutoreplyBehaviorUvTotal">
    update gzh_autoreply_behavior_uv_total
    <set>
      <if test="dt != null">
        dt = #{dt,jdbcType=VARCHAR},
      </if>
      <if test="channel != null">
        channel = #{channel,jdbcType=VARCHAR},
      </if>
      <if test="ghId != null">
        gh_id = #{ghId,jdbcType=VARCHAR},
      </if>
      <if test="uv != null">
        uv = #{uv,jdbcType=INTEGER},
      </if>
      <if test="firstLevel != null">
        first_level = #{firstLevel,jdbcType=INTEGER},
      </if>
      <if test="createTimestamp != null">
        create_timestamp = #{createTimestamp,jdbcType=BIGINT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.GzhAutoreplyBehaviorUvTotal">
    update gzh_autoreply_behavior_uv_total
    set dt = #{dt,jdbcType=VARCHAR},
      channel = #{channel,jdbcType=VARCHAR},
      gh_id = #{ghId,jdbcType=VARCHAR},
      uv = #{uv,jdbcType=INTEGER},
      first_level = #{firstLevel,jdbcType=INTEGER},
      create_timestamp = #{createTimestamp,jdbcType=BIGINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>