<?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.ThirdPartWeComRoomUserMapper">
  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComRoomUser">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="third_room_id" jdbcType="VARCHAR" property="thirdRoomId" />
    <result column="unionid" jdbcType="VARCHAR" property="unionid" />
    <result column="sex" jdbcType="INTEGER" property="sex" />
    <result column="mobile" jdbcType="VARCHAR" property="mobile" />
    <result column="acctid" jdbcType="VARCHAR" property="acctid" />
    <result column="join_scene" jdbcType="INTEGER" property="joinScene" />
    <result column="avatar" jdbcType="VARCHAR" property="avatar" />
    <result column="english_name" jdbcType="VARCHAR" property="englishName" />
    <result column="realname" jdbcType="VARCHAR" property="realname" />
    <result column="room_notes" jdbcType="VARCHAR" property="roomNotes" />
    <result column="join_time" jdbcType="BIGINT" property="joinTime" />
    <result column="quit_time" jdbcType="BIGINT" property="quitTime" />
    <result column="nickname" jdbcType="VARCHAR" property="nickname" />
    <result column="room_nickname" jdbcType="VARCHAR" property="roomNickname" />
    <result column="position" jdbcType="VARCHAR" property="position" />
    <result column="uin" jdbcType="BIGINT" property="uin" />
    <result column="invite_user_id" jdbcType="BIGINT" property="inviteUserId" />
    <result column="corp_id" jdbcType="BIGINT" property="corpId" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  </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, third_room_id, unionid, sex, mobile, acctid, join_scene, avatar, english_name, 
    realname, room_notes, join_time, quit_time, nickname, room_nickname, `position`, 
    uin, invite_user_id, corp_id, create_time, update_time
  </sql>
  <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComRoomUserExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from third_part_we_com_room_user
    <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 third_part_we_com_room_user
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from third_part_we_com_room_user
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComRoomUserExample">
    delete from third_part_we_com_room_user
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComRoomUser">
    insert into third_part_we_com_room_user (id, third_room_id, unionid, 
      sex, mobile, acctid, 
      join_scene, avatar, english_name, 
      realname, room_notes, join_time, 
      quit_time, nickname, room_nickname, 
      `position`, uin, invite_user_id, 
      corp_id, create_time, update_time
      )
    values (#{id,jdbcType=BIGINT}, #{thirdRoomId,jdbcType=VARCHAR}, #{unionid,jdbcType=VARCHAR}, 
      #{sex,jdbcType=INTEGER}, #{mobile,jdbcType=VARCHAR}, #{acctid,jdbcType=VARCHAR}, 
      #{joinScene,jdbcType=INTEGER}, #{avatar,jdbcType=VARCHAR}, #{englishName,jdbcType=VARCHAR}, 
      #{realname,jdbcType=VARCHAR}, #{roomNotes,jdbcType=VARCHAR}, #{joinTime,jdbcType=BIGINT}, 
      #{quitTime,jdbcType=BIGINT}, #{nickname,jdbcType=VARCHAR}, #{roomNickname,jdbcType=VARCHAR}, 
      #{position,jdbcType=VARCHAR}, #{uin,jdbcType=BIGINT}, #{inviteUserId,jdbcType=BIGINT}, 
      #{corpId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComRoomUser">
    insert into third_part_we_com_room_user
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="thirdRoomId != null">
        third_room_id,
      </if>
      <if test="unionid != null">
        unionid,
      </if>
      <if test="sex != null">
        sex,
      </if>
      <if test="mobile != null">
        mobile,
      </if>
      <if test="acctid != null">
        acctid,
      </if>
      <if test="joinScene != null">
        join_scene,
      </if>
      <if test="avatar != null">
        avatar,
      </if>
      <if test="englishName != null">
        english_name,
      </if>
      <if test="realname != null">
        realname,
      </if>
      <if test="roomNotes != null">
        room_notes,
      </if>
      <if test="joinTime != null">
        join_time,
      </if>
      <if test="quitTime != null">
        quit_time,
      </if>
      <if test="nickname != null">
        nickname,
      </if>
      <if test="roomNickname != null">
        room_nickname,
      </if>
      <if test="position != null">
        `position`,
      </if>
      <if test="uin != null">
        uin,
      </if>
      <if test="inviteUserId != null">
        invite_user_id,
      </if>
      <if test="corpId != null">
        corp_id,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="thirdRoomId != null">
        #{thirdRoomId,jdbcType=VARCHAR},
      </if>
      <if test="unionid != null">
        #{unionid,jdbcType=VARCHAR},
      </if>
      <if test="sex != null">
        #{sex,jdbcType=INTEGER},
      </if>
      <if test="mobile != null">
        #{mobile,jdbcType=VARCHAR},
      </if>
      <if test="acctid != null">
        #{acctid,jdbcType=VARCHAR},
      </if>
      <if test="joinScene != null">
        #{joinScene,jdbcType=INTEGER},
      </if>
      <if test="avatar != null">
        #{avatar,jdbcType=VARCHAR},
      </if>
      <if test="englishName != null">
        #{englishName,jdbcType=VARCHAR},
      </if>
      <if test="realname != null">
        #{realname,jdbcType=VARCHAR},
      </if>
      <if test="roomNotes != null">
        #{roomNotes,jdbcType=VARCHAR},
      </if>
      <if test="joinTime != null">
        #{joinTime,jdbcType=BIGINT},
      </if>
      <if test="quitTime != null">
        #{quitTime,jdbcType=BIGINT},
      </if>
      <if test="nickname != null">
        #{nickname,jdbcType=VARCHAR},
      </if>
      <if test="roomNickname != null">
        #{roomNickname,jdbcType=VARCHAR},
      </if>
      <if test="position != null">
        #{position,jdbcType=VARCHAR},
      </if>
      <if test="uin != null">
        #{uin,jdbcType=BIGINT},
      </if>
      <if test="inviteUserId != null">
        #{inviteUserId,jdbcType=BIGINT},
      </if>
      <if test="corpId != null">
        #{corpId,jdbcType=BIGINT},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComRoomUserExample" resultType="java.lang.Long">
    select count(*) from third_part_we_com_room_user
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update third_part_we_com_room_user
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.thirdRoomId != null">
        third_room_id = #{record.thirdRoomId,jdbcType=VARCHAR},
      </if>
      <if test="record.unionid != null">
        unionid = #{record.unionid,jdbcType=VARCHAR},
      </if>
      <if test="record.sex != null">
        sex = #{record.sex,jdbcType=INTEGER},
      </if>
      <if test="record.mobile != null">
        mobile = #{record.mobile,jdbcType=VARCHAR},
      </if>
      <if test="record.acctid != null">
        acctid = #{record.acctid,jdbcType=VARCHAR},
      </if>
      <if test="record.joinScene != null">
        join_scene = #{record.joinScene,jdbcType=INTEGER},
      </if>
      <if test="record.avatar != null">
        avatar = #{record.avatar,jdbcType=VARCHAR},
      </if>
      <if test="record.englishName != null">
        english_name = #{record.englishName,jdbcType=VARCHAR},
      </if>
      <if test="record.realname != null">
        realname = #{record.realname,jdbcType=VARCHAR},
      </if>
      <if test="record.roomNotes != null">
        room_notes = #{record.roomNotes,jdbcType=VARCHAR},
      </if>
      <if test="record.joinTime != null">
        join_time = #{record.joinTime,jdbcType=BIGINT},
      </if>
      <if test="record.quitTime != null">
        quit_time = #{record.quitTime,jdbcType=BIGINT},
      </if>
      <if test="record.nickname != null">
        nickname = #{record.nickname,jdbcType=VARCHAR},
      </if>
      <if test="record.roomNickname != null">
        room_nickname = #{record.roomNickname,jdbcType=VARCHAR},
      </if>
      <if test="record.position != null">
        `position` = #{record.position,jdbcType=VARCHAR},
      </if>
      <if test="record.uin != null">
        uin = #{record.uin,jdbcType=BIGINT},
      </if>
      <if test="record.inviteUserId != null">
        invite_user_id = #{record.inviteUserId,jdbcType=BIGINT},
      </if>
      <if test="record.corpId != null">
        corp_id = #{record.corpId,jdbcType=BIGINT},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update third_part_we_com_room_user
    set id = #{record.id,jdbcType=BIGINT},
      third_room_id = #{record.thirdRoomId,jdbcType=VARCHAR},
      unionid = #{record.unionid,jdbcType=VARCHAR},
      sex = #{record.sex,jdbcType=INTEGER},
      mobile = #{record.mobile,jdbcType=VARCHAR},
      acctid = #{record.acctid,jdbcType=VARCHAR},
      join_scene = #{record.joinScene,jdbcType=INTEGER},
      avatar = #{record.avatar,jdbcType=VARCHAR},
      english_name = #{record.englishName,jdbcType=VARCHAR},
      realname = #{record.realname,jdbcType=VARCHAR},
      room_notes = #{record.roomNotes,jdbcType=VARCHAR},
      join_time = #{record.joinTime,jdbcType=BIGINT},
      quit_time = #{record.quitTime,jdbcType=BIGINT},
      nickname = #{record.nickname,jdbcType=VARCHAR},
      room_nickname = #{record.roomNickname,jdbcType=VARCHAR},
      `position` = #{record.position,jdbcType=VARCHAR},
      uin = #{record.uin,jdbcType=BIGINT},
      invite_user_id = #{record.inviteUserId,jdbcType=BIGINT},
      corp_id = #{record.corpId,jdbcType=BIGINT},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      update_time = #{record.updateTime,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.ThirdPartWeComRoomUser">
    update third_part_we_com_room_user
    <set>
      <if test="thirdRoomId != null">
        third_room_id = #{thirdRoomId,jdbcType=VARCHAR},
      </if>
      <if test="unionid != null">
        unionid = #{unionid,jdbcType=VARCHAR},
      </if>
      <if test="sex != null">
        sex = #{sex,jdbcType=INTEGER},
      </if>
      <if test="mobile != null">
        mobile = #{mobile,jdbcType=VARCHAR},
      </if>
      <if test="acctid != null">
        acctid = #{acctid,jdbcType=VARCHAR},
      </if>
      <if test="joinScene != null">
        join_scene = #{joinScene,jdbcType=INTEGER},
      </if>
      <if test="avatar != null">
        avatar = #{avatar,jdbcType=VARCHAR},
      </if>
      <if test="englishName != null">
        english_name = #{englishName,jdbcType=VARCHAR},
      </if>
      <if test="realname != null">
        realname = #{realname,jdbcType=VARCHAR},
      </if>
      <if test="roomNotes != null">
        room_notes = #{roomNotes,jdbcType=VARCHAR},
      </if>
      <if test="joinTime != null">
        join_time = #{joinTime,jdbcType=BIGINT},
      </if>
      <if test="quitTime != null">
        quit_time = #{quitTime,jdbcType=BIGINT},
      </if>
      <if test="nickname != null">
        nickname = #{nickname,jdbcType=VARCHAR},
      </if>
      <if test="roomNickname != null">
        room_nickname = #{roomNickname,jdbcType=VARCHAR},
      </if>
      <if test="position != null">
        `position` = #{position,jdbcType=VARCHAR},
      </if>
      <if test="uin != null">
        uin = #{uin,jdbcType=BIGINT},
      </if>
      <if test="inviteUserId != null">
        invite_user_id = #{inviteUserId,jdbcType=BIGINT},
      </if>
      <if test="corpId != null">
        corp_id = #{corpId,jdbcType=BIGINT},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.wecom.thirdpart.ThirdPartWeComRoomUser">
    update third_part_we_com_room_user
    set third_room_id = #{thirdRoomId,jdbcType=VARCHAR},
      unionid = #{unionid,jdbcType=VARCHAR},
      sex = #{sex,jdbcType=INTEGER},
      mobile = #{mobile,jdbcType=VARCHAR},
      acctid = #{acctid,jdbcType=VARCHAR},
      join_scene = #{joinScene,jdbcType=INTEGER},
      avatar = #{avatar,jdbcType=VARCHAR},
      english_name = #{englishName,jdbcType=VARCHAR},
      realname = #{realname,jdbcType=VARCHAR},
      room_notes = #{roomNotes,jdbcType=VARCHAR},
      join_time = #{joinTime,jdbcType=BIGINT},
      quit_time = #{quitTime,jdbcType=BIGINT},
      nickname = #{nickname,jdbcType=VARCHAR},
      room_nickname = #{roomNickname,jdbcType=VARCHAR},
      `position` = #{position,jdbcType=VARCHAR},
      uin = #{uin,jdbcType=BIGINT},
      invite_user_id = #{inviteUserId,jdbcType=BIGINT},
      corp_id = #{corpId,jdbcType=BIGINT},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>