<?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.contentplatform.ContentPlatformFwhDataStatMapper">
  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformFwhDataStat">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="date_str" jdbcType="VARCHAR" property="dateStr" />
    <result column="account_id" jdbcType="BIGINT" property="accountId" />
    <result column="fans_increase_count" jdbcType="INTEGER" property="fansIncreaseCount" />
    <result column="first_level_count" jdbcType="INTEGER" property="firstLevelCount" />
    <result column="score" jdbcType="DOUBLE" property="score" />
    <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, date_str, account_id, fans_increase_count, first_level_count, score, create_timestamp
  </sql>
  <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformFwhDataStatExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from content_platform_fwh_datastat
    <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 content_platform_fwh_datastat
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from content_platform_fwh_datastat
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformFwhDataStatExample">
    delete from content_platform_fwh_datastat
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformFwhDataStat">
    insert into content_platform_fwh_datastat (id, date_str, account_id, 
      fans_increase_count, first_level_count, score, 
      create_timestamp)
    values (#{id,jdbcType=BIGINT}, #{dateStr,jdbcType=VARCHAR}, #{accountId,jdbcType=BIGINT}, 
      #{fansIncreaseCount,jdbcType=INTEGER}, #{firstLevelCount,jdbcType=INTEGER}, #{score,jdbcType=DOUBLE}, 
      #{createTimestamp,jdbcType=BIGINT})
  </insert>
  <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformFwhDataStat">
    insert into content_platform_fwh_datastat
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="dateStr != null">
        date_str,
      </if>
      <if test="accountId != null">
        account_id,
      </if>
      <if test="fansIncreaseCount != null">
        fans_increase_count,
      </if>
      <if test="firstLevelCount != null">
        first_level_count,
      </if>
      <if test="score != null">
        score,
      </if>
      <if test="createTimestamp != null">
        create_timestamp,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="dateStr != null">
        #{dateStr,jdbcType=VARCHAR},
      </if>
      <if test="accountId != null">
        #{accountId,jdbcType=BIGINT},
      </if>
      <if test="fansIncreaseCount != null">
        #{fansIncreaseCount,jdbcType=INTEGER},
      </if>
      <if test="firstLevelCount != null">
        #{firstLevelCount,jdbcType=INTEGER},
      </if>
      <if test="score != null">
        #{score,jdbcType=DOUBLE},
      </if>
      <if test="createTimestamp != null">
        #{createTimestamp,jdbcType=BIGINT},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformFwhDataStatExample" resultType="java.lang.Long">
    select count(*) from content_platform_fwh_datastat
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update content_platform_fwh_datastat
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.dateStr != null">
        date_str = #{record.dateStr,jdbcType=VARCHAR},
      </if>
      <if test="record.accountId != null">
        account_id = #{record.accountId,jdbcType=BIGINT},
      </if>
      <if test="record.fansIncreaseCount != null">
        fans_increase_count = #{record.fansIncreaseCount,jdbcType=INTEGER},
      </if>
      <if test="record.firstLevelCount != null">
        first_level_count = #{record.firstLevelCount,jdbcType=INTEGER},
      </if>
      <if test="record.score != null">
        score = #{record.score,jdbcType=DOUBLE},
      </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 content_platform_fwh_datastat
    set id = #{record.id,jdbcType=BIGINT},
      date_str = #{record.dateStr,jdbcType=VARCHAR},
      account_id = #{record.accountId,jdbcType=BIGINT},
      fans_increase_count = #{record.fansIncreaseCount,jdbcType=INTEGER},
      first_level_count = #{record.firstLevelCount,jdbcType=INTEGER},
      score = #{record.score,jdbcType=DOUBLE},
      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.contentplatform.ContentPlatformFwhDataStat">
    update content_platform_fwh_datastat
    <set>
      <if test="dateStr != null">
        date_str = #{dateStr,jdbcType=VARCHAR},
      </if>
      <if test="accountId != null">
        account_id = #{accountId,jdbcType=BIGINT},
      </if>
      <if test="fansIncreaseCount != null">
        fans_increase_count = #{fansIncreaseCount,jdbcType=INTEGER},
      </if>
      <if test="firstLevelCount != null">
        first_level_count = #{firstLevelCount,jdbcType=INTEGER},
      </if>
      <if test="score != null">
        score = #{score,jdbcType=DOUBLE},
      </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.contentplatform.ContentPlatformFwhDataStat">
    update content_platform_fwh_datastat
    set date_str = #{dateStr,jdbcType=VARCHAR},
      account_id = #{accountId,jdbcType=BIGINT},
      fans_increase_count = #{fansIncreaseCount,jdbcType=INTEGER},
      first_level_count = #{firstLevelCount,jdbcType=INTEGER},
      score = #{score,jdbcType=DOUBLE},
      create_timestamp = #{createTimestamp,jdbcType=BIGINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>