<?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.ContentPlatformPqAccountRelMapper">
  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformPqAccountRel">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="account_id" jdbcType="BIGINT" property="accountId" />
    <result column="pq_uid" jdbcType="BIGINT" property="pqUid" />
    <result column="pq_name" jdbcType="VARCHAR" property="pqName" />
    <result column="pq_tel_num" jdbcType="VARCHAR" property="pqTelNum" />
    <result column="status" jdbcType="INTEGER" property="status" />
    <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
    <result column="update_timestamp" jdbcType="BIGINT" property="updateTimestamp" />
  </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, account_id, pq_uid, pq_name, pq_tel_num, `status`, create_timestamp, update_timestamp
  </sql>
  <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformPqAccountRelExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from content_platform_pq_account_rel
    <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_pq_account_rel
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from content_platform_pq_account_rel
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformPqAccountRelExample">
    delete from content_platform_pq_account_rel
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformPqAccountRel"
          useGeneratedKeys="true" keyProperty="id">
    insert into content_platform_pq_account_rel (id, account_id, pq_uid, 
      pq_name, pq_tel_num, `status`, 
      create_timestamp, update_timestamp)
    values (#{id,jdbcType=BIGINT}, #{accountId,jdbcType=BIGINT}, #{pqUid,jdbcType=BIGINT}, 
      #{pqName,jdbcType=VARCHAR}, #{pqTelNum,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
      #{createTimestamp,jdbcType=BIGINT}, #{updateTimestamp,jdbcType=BIGINT})
  </insert>
  <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformPqAccountRel"
          useGeneratedKeys="true" keyProperty="id">
    insert into content_platform_pq_account_rel
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="accountId != null">
        account_id,
      </if>
      <if test="pqUid != null">
        pq_uid,
      </if>
      <if test="pqName != null">
        pq_name,
      </if>
      <if test="pqTelNum != null">
        pq_tel_num,
      </if>
      <if test="status != null">
        `status`,
      </if>
      <if test="createTimestamp != null">
        create_timestamp,
      </if>
      <if test="updateTimestamp != null">
        update_timestamp,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="accountId != null">
        #{accountId,jdbcType=BIGINT},
      </if>
      <if test="pqUid != null">
        #{pqUid,jdbcType=BIGINT},
      </if>
      <if test="pqName != null">
        #{pqName,jdbcType=VARCHAR},
      </if>
      <if test="pqTelNum != null">
        #{pqTelNum,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=INTEGER},
      </if>
      <if test="createTimestamp != null">
        #{createTimestamp,jdbcType=BIGINT},
      </if>
      <if test="updateTimestamp != null">
        #{updateTimestamp,jdbcType=BIGINT},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformPqAccountRelExample" resultType="java.lang.Long">
    select count(*) from content_platform_pq_account_rel
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update content_platform_pq_account_rel
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.accountId != null">
        account_id = #{record.accountId,jdbcType=BIGINT},
      </if>
      <if test="record.pqUid != null">
        pq_uid = #{record.pqUid,jdbcType=BIGINT},
      </if>
      <if test="record.pqName != null">
        pq_name = #{record.pqName,jdbcType=VARCHAR},
      </if>
      <if test="record.pqTelNum != null">
        pq_tel_num = #{record.pqTelNum,jdbcType=VARCHAR},
      </if>
      <if test="record.status != null">
        `status` = #{record.status,jdbcType=INTEGER},
      </if>
      <if test="record.createTimestamp != null">
        create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
      </if>
      <if test="record.updateTimestamp != null">
        update_timestamp = #{record.updateTimestamp,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_pq_account_rel
    set id = #{record.id,jdbcType=BIGINT},
      account_id = #{record.accountId,jdbcType=BIGINT},
      pq_uid = #{record.pqUid,jdbcType=BIGINT},
      pq_name = #{record.pqName,jdbcType=VARCHAR},
      pq_tel_num = #{record.pqTelNum,jdbcType=VARCHAR},
      `status` = #{record.status,jdbcType=INTEGER},
      create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
      update_timestamp = #{record.updateTimestamp,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.ContentPlatformPqAccountRel">
    update content_platform_pq_account_rel
    <set>
      <if test="accountId != null">
        account_id = #{accountId,jdbcType=BIGINT},
      </if>
      <if test="pqUid != null">
        pq_uid = #{pqUid,jdbcType=BIGINT},
      </if>
      <if test="pqName != null">
        pq_name = #{pqName,jdbcType=VARCHAR},
      </if>
      <if test="pqTelNum != null">
        pq_tel_num = #{pqTelNum,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        `status` = #{status,jdbcType=INTEGER},
      </if>
      <if test="createTimestamp != null">
        create_timestamp = #{createTimestamp,jdbcType=BIGINT},
      </if>
      <if test="updateTimestamp != null">
        update_timestamp = #{updateTimestamp,jdbcType=BIGINT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformPqAccountRel">
    update content_platform_pq_account_rel
    set account_id = #{accountId,jdbcType=BIGINT},
      pq_uid = #{pqUid,jdbcType=BIGINT},
      pq_name = #{pqName,jdbcType=VARCHAR},
      pq_tel_num = #{pqTelNum,jdbcType=VARCHAR},
      `status` = #{status,jdbcType=INTEGER},
      create_timestamp = #{createTimestamp,jdbcType=BIGINT},
      update_timestamp = #{updateTimestamp,jdbcType=BIGINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>