<?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.wecom.thirdpart.ThirdPartWeComMsgMapper">
  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComMsg">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="uuid" jdbcType="VARCHAR" property="uuid" />
    <result column="send_userid" jdbcType="BIGINT" property="sendUserid" />
    <result column="send_type" jdbcType="INTEGER" property="sendType" />
    <result column="content" jdbcType="VARCHAR" property="content" />
    <result column="staff_id" jdbcType="BIGINT" property="staffId" />
    <result column="video_id" jdbcType="BIGINT" property="videoId" />
    <result column="appName" jdbcType="VARCHAR" property="appname" />
    <result column="title" jdbcType="VARCHAR" property="title" />
    <result column="weappIconUrl" jdbcType="VARCHAR" property="weappiconurl" />
    <result column="pagepath" jdbcType="VARCHAR" property="pagepath" />
    <result column="root_source_id" jdbcType="VARCHAR" property="rootSourceId" />
    <result column="username" jdbcType="VARCHAR" property="username" />
    <result column="appid" jdbcType="VARCHAR" property="appid" />
    <result column="cdnkey" jdbcType="VARCHAR" property="cdnkey" />
    <result column="md5" jdbcType="VARCHAR" property="md5" />
    <result column="aeskey" jdbcType="VARCHAR" property="aeskey" />
    <result column="fileSize" jdbcType="INTEGER" property="filesize" />
    <result column="isRoom" jdbcType="BIT" property="isroom" />
    <result column="status" jdbcType="INTEGER" property="status" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComMsg">
    <result column="desc" jdbcType="LONGVARCHAR" property="desc" />
  </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, uuid, send_userid, send_type, content, staff_id, video_id, appName, title, weappIconUrl, 
    pagepath, root_source_id, username, appid, cdnkey, md5, aeskey, fileSize, isRoom, 
    `status`, create_time
  </sql>
  <sql id="Blob_Column_List">
    `desc`
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComMsgExample" resultMap="ResultMapWithBLOBs">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from third_part_we_com_msg
    <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="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComMsgExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from third_part_we_com_msg
    <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="ResultMapWithBLOBs">
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from third_part_we_com_msg
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from third_part_we_com_msg
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComMsgExample">
    delete from third_part_we_com_msg
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComMsg">
    insert into third_part_we_com_msg (id, uuid, send_userid, 
      send_type, content, staff_id, 
      video_id, appName, title, 
      weappIconUrl, pagepath, root_source_id, 
      username, appid, cdnkey, 
      md5, aeskey, fileSize, 
      isRoom, `status`, create_time, 
      `desc`)
    values (#{id,jdbcType=BIGINT}, #{uuid,jdbcType=VARCHAR}, #{sendUserid,jdbcType=BIGINT}, 
      #{sendType,jdbcType=INTEGER}, #{content,jdbcType=VARCHAR}, #{staffId,jdbcType=BIGINT}, 
      #{videoId,jdbcType=BIGINT}, #{appname,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, 
      #{weappiconurl,jdbcType=VARCHAR}, #{pagepath,jdbcType=VARCHAR}, #{rootSourceId,jdbcType=VARCHAR}, 
      #{username,jdbcType=VARCHAR}, #{appid,jdbcType=VARCHAR}, #{cdnkey,jdbcType=VARCHAR}, 
      #{md5,jdbcType=VARCHAR}, #{aeskey,jdbcType=VARCHAR}, #{filesize,jdbcType=INTEGER}, 
      #{isroom,jdbcType=BIT}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
      #{desc,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComMsg">
    insert into third_part_we_com_msg
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="uuid != null">
        uuid,
      </if>
      <if test="sendUserid != null">
        send_userid,
      </if>
      <if test="sendType != null">
        send_type,
      </if>
      <if test="content != null">
        content,
      </if>
      <if test="staffId != null">
        staff_id,
      </if>
      <if test="videoId != null">
        video_id,
      </if>
      <if test="appname != null">
        appName,
      </if>
      <if test="title != null">
        title,
      </if>
      <if test="weappiconurl != null">
        weappIconUrl,
      </if>
      <if test="pagepath != null">
        pagepath,
      </if>
      <if test="rootSourceId != null">
        root_source_id,
      </if>
      <if test="username != null">
        username,
      </if>
      <if test="appid != null">
        appid,
      </if>
      <if test="cdnkey != null">
        cdnkey,
      </if>
      <if test="md5 != null">
        md5,
      </if>
      <if test="aeskey != null">
        aeskey,
      </if>
      <if test="filesize != null">
        fileSize,
      </if>
      <if test="isroom != null">
        isRoom,
      </if>
      <if test="status != null">
        `status`,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="desc != null">
        `desc`,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="uuid != null">
        #{uuid,jdbcType=VARCHAR},
      </if>
      <if test="sendUserid != null">
        #{sendUserid,jdbcType=BIGINT},
      </if>
      <if test="sendType != null">
        #{sendType,jdbcType=INTEGER},
      </if>
      <if test="content != null">
        #{content,jdbcType=VARCHAR},
      </if>
      <if test="staffId != null">
        #{staffId,jdbcType=BIGINT},
      </if>
      <if test="videoId != null">
        #{videoId,jdbcType=BIGINT},
      </if>
      <if test="appname != null">
        #{appname,jdbcType=VARCHAR},
      </if>
      <if test="title != null">
        #{title,jdbcType=VARCHAR},
      </if>
      <if test="weappiconurl != null">
        #{weappiconurl,jdbcType=VARCHAR},
      </if>
      <if test="pagepath != null">
        #{pagepath,jdbcType=VARCHAR},
      </if>
      <if test="rootSourceId != null">
        #{rootSourceId,jdbcType=VARCHAR},
      </if>
      <if test="username != null">
        #{username,jdbcType=VARCHAR},
      </if>
      <if test="appid != null">
        #{appid,jdbcType=VARCHAR},
      </if>
      <if test="cdnkey != null">
        #{cdnkey,jdbcType=VARCHAR},
      </if>
      <if test="md5 != null">
        #{md5,jdbcType=VARCHAR},
      </if>
      <if test="aeskey != null">
        #{aeskey,jdbcType=VARCHAR},
      </if>
      <if test="filesize != null">
        #{filesize,jdbcType=INTEGER},
      </if>
      <if test="isroom != null">
        #{isroom,jdbcType=BIT},
      </if>
      <if test="status != null">
        #{status,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="desc != null">
        #{desc,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComMsgExample" resultType="java.lang.Long">
    select count(*) from third_part_we_com_msg
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update third_part_we_com_msg
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.uuid != null">
        uuid = #{record.uuid,jdbcType=VARCHAR},
      </if>
      <if test="record.sendUserid != null">
        send_userid = #{record.sendUserid,jdbcType=BIGINT},
      </if>
      <if test="record.sendType != null">
        send_type = #{record.sendType,jdbcType=INTEGER},
      </if>
      <if test="record.content != null">
        content = #{record.content,jdbcType=VARCHAR},
      </if>
      <if test="record.staffId != null">
        staff_id = #{record.staffId,jdbcType=BIGINT},
      </if>
      <if test="record.videoId != null">
        video_id = #{record.videoId,jdbcType=BIGINT},
      </if>
      <if test="record.appname != null">
        appName = #{record.appname,jdbcType=VARCHAR},
      </if>
      <if test="record.title != null">
        title = #{record.title,jdbcType=VARCHAR},
      </if>
      <if test="record.weappiconurl != null">
        weappIconUrl = #{record.weappiconurl,jdbcType=VARCHAR},
      </if>
      <if test="record.pagepath != null">
        pagepath = #{record.pagepath,jdbcType=VARCHAR},
      </if>
      <if test="record.rootSourceId != null">
        root_source_id = #{record.rootSourceId,jdbcType=VARCHAR},
      </if>
      <if test="record.username != null">
        username = #{record.username,jdbcType=VARCHAR},
      </if>
      <if test="record.appid != null">
        appid = #{record.appid,jdbcType=VARCHAR},
      </if>
      <if test="record.cdnkey != null">
        cdnkey = #{record.cdnkey,jdbcType=VARCHAR},
      </if>
      <if test="record.md5 != null">
        md5 = #{record.md5,jdbcType=VARCHAR},
      </if>
      <if test="record.aeskey != null">
        aeskey = #{record.aeskey,jdbcType=VARCHAR},
      </if>
      <if test="record.filesize != null">
        fileSize = #{record.filesize,jdbcType=INTEGER},
      </if>
      <if test="record.isroom != null">
        isRoom = #{record.isroom,jdbcType=BIT},
      </if>
      <if test="record.status != null">
        `status` = #{record.status,jdbcType=INTEGER},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.desc != null">
        `desc` = #{record.desc,jdbcType=LONGVARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExampleWithBLOBs" parameterType="map">
    update third_part_we_com_msg
    set id = #{record.id,jdbcType=BIGINT},
      uuid = #{record.uuid,jdbcType=VARCHAR},
      send_userid = #{record.sendUserid,jdbcType=BIGINT},
      send_type = #{record.sendType,jdbcType=INTEGER},
      content = #{record.content,jdbcType=VARCHAR},
      staff_id = #{record.staffId,jdbcType=BIGINT},
      video_id = #{record.videoId,jdbcType=BIGINT},
      appName = #{record.appname,jdbcType=VARCHAR},
      title = #{record.title,jdbcType=VARCHAR},
      weappIconUrl = #{record.weappiconurl,jdbcType=VARCHAR},
      pagepath = #{record.pagepath,jdbcType=VARCHAR},
      root_source_id = #{record.rootSourceId,jdbcType=VARCHAR},
      username = #{record.username,jdbcType=VARCHAR},
      appid = #{record.appid,jdbcType=VARCHAR},
      cdnkey = #{record.cdnkey,jdbcType=VARCHAR},
      md5 = #{record.md5,jdbcType=VARCHAR},
      aeskey = #{record.aeskey,jdbcType=VARCHAR},
      fileSize = #{record.filesize,jdbcType=INTEGER},
      isRoom = #{record.isroom,jdbcType=BIT},
      `status` = #{record.status,jdbcType=INTEGER},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      `desc` = #{record.desc,jdbcType=LONGVARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update third_part_we_com_msg
    set id = #{record.id,jdbcType=BIGINT},
      uuid = #{record.uuid,jdbcType=VARCHAR},
      send_userid = #{record.sendUserid,jdbcType=BIGINT},
      send_type = #{record.sendType,jdbcType=INTEGER},
      content = #{record.content,jdbcType=VARCHAR},
      staff_id = #{record.staffId,jdbcType=BIGINT},
      video_id = #{record.videoId,jdbcType=BIGINT},
      appName = #{record.appname,jdbcType=VARCHAR},
      title = #{record.title,jdbcType=VARCHAR},
      weappIconUrl = #{record.weappiconurl,jdbcType=VARCHAR},
      pagepath = #{record.pagepath,jdbcType=VARCHAR},
      root_source_id = #{record.rootSourceId,jdbcType=VARCHAR},
      username = #{record.username,jdbcType=VARCHAR},
      appid = #{record.appid,jdbcType=VARCHAR},
      cdnkey = #{record.cdnkey,jdbcType=VARCHAR},
      md5 = #{record.md5,jdbcType=VARCHAR},
      aeskey = #{record.aeskey,jdbcType=VARCHAR},
      fileSize = #{record.filesize,jdbcType=INTEGER},
      isRoom = #{record.isroom,jdbcType=BIT},
      `status` = #{record.status,jdbcType=INTEGER},
      create_time = #{record.createTime,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComMsg">
    update third_part_we_com_msg
    <set>
      <if test="uuid != null">
        uuid = #{uuid,jdbcType=VARCHAR},
      </if>
      <if test="sendUserid != null">
        send_userid = #{sendUserid,jdbcType=BIGINT},
      </if>
      <if test="sendType != null">
        send_type = #{sendType,jdbcType=INTEGER},
      </if>
      <if test="content != null">
        content = #{content,jdbcType=VARCHAR},
      </if>
      <if test="staffId != null">
        staff_id = #{staffId,jdbcType=BIGINT},
      </if>
      <if test="videoId != null">
        video_id = #{videoId,jdbcType=BIGINT},
      </if>
      <if test="appname != null">
        appName = #{appname,jdbcType=VARCHAR},
      </if>
      <if test="title != null">
        title = #{title,jdbcType=VARCHAR},
      </if>
      <if test="weappiconurl != null">
        weappIconUrl = #{weappiconurl,jdbcType=VARCHAR},
      </if>
      <if test="pagepath != null">
        pagepath = #{pagepath,jdbcType=VARCHAR},
      </if>
      <if test="rootSourceId != null">
        root_source_id = #{rootSourceId,jdbcType=VARCHAR},
      </if>
      <if test="username != null">
        username = #{username,jdbcType=VARCHAR},
      </if>
      <if test="appid != null">
        appid = #{appid,jdbcType=VARCHAR},
      </if>
      <if test="cdnkey != null">
        cdnkey = #{cdnkey,jdbcType=VARCHAR},
      </if>
      <if test="md5 != null">
        md5 = #{md5,jdbcType=VARCHAR},
      </if>
      <if test="aeskey != null">
        aeskey = #{aeskey,jdbcType=VARCHAR},
      </if>
      <if test="filesize != null">
        fileSize = #{filesize,jdbcType=INTEGER},
      </if>
      <if test="isroom != null">
        isRoom = #{isroom,jdbcType=BIT},
      </if>
      <if test="status != null">
        `status` = #{status,jdbcType=INTEGER},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="desc != null">
        `desc` = #{desc,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComMsg">
    update third_part_we_com_msg
    set uuid = #{uuid,jdbcType=VARCHAR},
      send_userid = #{sendUserid,jdbcType=BIGINT},
      send_type = #{sendType,jdbcType=INTEGER},
      content = #{content,jdbcType=VARCHAR},
      staff_id = #{staffId,jdbcType=BIGINT},
      video_id = #{videoId,jdbcType=BIGINT},
      appName = #{appname,jdbcType=VARCHAR},
      title = #{title,jdbcType=VARCHAR},
      weappIconUrl = #{weappiconurl,jdbcType=VARCHAR},
      pagepath = #{pagepath,jdbcType=VARCHAR},
      root_source_id = #{rootSourceId,jdbcType=VARCHAR},
      username = #{username,jdbcType=VARCHAR},
      appid = #{appid,jdbcType=VARCHAR},
      cdnkey = #{cdnkey,jdbcType=VARCHAR},
      md5 = #{md5,jdbcType=VARCHAR},
      aeskey = #{aeskey,jdbcType=VARCHAR},
      fileSize = #{filesize,jdbcType=INTEGER},
      isRoom = #{isroom,jdbcType=BIT},
      `status` = #{status,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      `desc` = #{desc,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComMsg">
    update third_part_we_com_msg
    set uuid = #{uuid,jdbcType=VARCHAR},
      send_userid = #{sendUserid,jdbcType=BIGINT},
      send_type = #{sendType,jdbcType=INTEGER},
      content = #{content,jdbcType=VARCHAR},
      staff_id = #{staffId,jdbcType=BIGINT},
      video_id = #{videoId,jdbcType=BIGINT},
      appName = #{appname,jdbcType=VARCHAR},
      title = #{title,jdbcType=VARCHAR},
      weappIconUrl = #{weappiconurl,jdbcType=VARCHAR},
      pagepath = #{pagepath,jdbcType=VARCHAR},
      root_source_id = #{rootSourceId,jdbcType=VARCHAR},
      username = #{username,jdbcType=VARCHAR},
      appid = #{appid,jdbcType=VARCHAR},
      cdnkey = #{cdnkey,jdbcType=VARCHAR},
      md5 = #{md5,jdbcType=VARCHAR},
      aeskey = #{aeskey,jdbcType=VARCHAR},
      fileSize = #{filesize,jdbcType=INTEGER},
      isRoom = #{isroom,jdbcType=BIT},
      `status` = #{status,jdbcType=INTEGER},
      create_time = #{createTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>