<?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="life.majiang.community.mapper.UserMapper">
  <resultMap id="BaseResultMap" type="life.majiang.community.model.User">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Sep 05 06:46:42 CST 2019.
    -->
    <id column="ID" jdbcType="BIGINT" property="id" />
    <result column="ACCOUNT_ID" jdbcType="VARCHAR" property="accountId" />
    <result column="NAME" jdbcType="VARCHAR" property="name" />
    <result column="TOKEN" jdbcType="VARCHAR" property="token" />
    <result column="GMT_CREATE" jdbcType="BIGINT" property="gmtCreate" />
    <result column="GMT_MODIFIED" jdbcType="BIGINT" property="gmtModified" />
    <result column="BIO" jdbcType="VARCHAR" property="bio" />
    <result column="AVATAR_URL" jdbcType="VARCHAR" property="avatarUrl" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Sep 05 06:46:42 CST 2019.
    -->
    <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">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Sep 05 06:46:42 CST 2019.
    -->
    <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">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Sep 05 06:46:42 CST 2019.
    -->
    ID, ACCOUNT_ID, NAME, TOKEN, GMT_CREATE, GMT_MODIFIED, BIO, AVATAR_URL
  </sql>
  <select id="selectByExample" parameterType="life.majiang.community.model.UserExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Sep 05 06:46:42 CST 2019.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from USER
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Sep 05 06:46:42 CST 2019.
    -->
    select 
    <include refid="Base_Column_List" />
    from USER
    where ID = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Sep 05 06:46:42 CST 2019.
    -->
    delete from USER
    where ID = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="life.majiang.community.model.UserExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Sep 05 06:46:42 CST 2019.
    -->
    delete from USER
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="life.majiang.community.model.User">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Sep 05 06:46:42 CST 2019.
    -->
    insert into USER (ID, ACCOUNT_ID, NAME, 
      TOKEN, GMT_CREATE, GMT_MODIFIED, 
      BIO, AVATAR_URL)
    values (#{id,jdbcType=BIGINT}, #{accountId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, 
      #{token,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=BIGINT}, #{gmtModified,jdbcType=BIGINT}, 
      #{bio,jdbcType=VARCHAR}, #{avatarUrl,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="life.majiang.community.model.User">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Sep 05 06:46:42 CST 2019.
    -->
    insert into USER
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        ID,
      </if>
      <if test="accountId != null">
        ACCOUNT_ID,
      </if>
      <if test="name != null">
        NAME,
      </if>
      <if test="token != null">
        TOKEN,
      </if>
      <if test="gmtCreate != null">
        GMT_CREATE,
      </if>
      <if test="gmtModified != null">
        GMT_MODIFIED,
      </if>
      <if test="bio != null">
        BIO,
      </if>
      <if test="avatarUrl != null">
        AVATAR_URL,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="accountId != null">
        #{accountId,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="token != null">
        #{token,jdbcType=VARCHAR},
      </if>
      <if test="gmtCreate != null">
        #{gmtCreate,jdbcType=BIGINT},
      </if>
      <if test="gmtModified != null">
        #{gmtModified,jdbcType=BIGINT},
      </if>
      <if test="bio != null">
        #{bio,jdbcType=VARCHAR},
      </if>
      <if test="avatarUrl != null">
        #{avatarUrl,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="life.majiang.community.model.UserExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Sep 05 06:46:42 CST 2019.
    -->
    select count(*) from USER
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Sep 05 06:46:42 CST 2019.
    -->
    update USER
    <set>
      <if test="record.id != null">
        ID = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.accountId != null">
        ACCOUNT_ID = #{record.accountId,jdbcType=VARCHAR},
      </if>
      <if test="record.name != null">
        NAME = #{record.name,jdbcType=VARCHAR},
      </if>
      <if test="record.token != null">
        TOKEN = #{record.token,jdbcType=VARCHAR},
      </if>
      <if test="record.gmtCreate != null">
        GMT_CREATE = #{record.gmtCreate,jdbcType=BIGINT},
      </if>
      <if test="record.gmtModified != null">
        GMT_MODIFIED = #{record.gmtModified,jdbcType=BIGINT},
      </if>
      <if test="record.bio != null">
        BIO = #{record.bio,jdbcType=VARCHAR},
      </if>
      <if test="record.avatarUrl != null">
        AVATAR_URL = #{record.avatarUrl,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Sep 05 06:46:42 CST 2019.
    -->
    update USER
    set ID = #{record.id,jdbcType=BIGINT},
      ACCOUNT_ID = #{record.accountId,jdbcType=VARCHAR},
      NAME = #{record.name,jdbcType=VARCHAR},
      TOKEN = #{record.token,jdbcType=VARCHAR},
      GMT_CREATE = #{record.gmtCreate,jdbcType=BIGINT},
      GMT_MODIFIED = #{record.gmtModified,jdbcType=BIGINT},
      BIO = #{record.bio,jdbcType=VARCHAR},
      AVATAR_URL = #{record.avatarUrl,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="life.majiang.community.model.User">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Sep 05 06:46:42 CST 2019.
    -->
    update USER
    <set>
      <if test="accountId != null">
        ACCOUNT_ID = #{accountId,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        NAME = #{name,jdbcType=VARCHAR},
      </if>
      <if test="token != null">
        TOKEN = #{token,jdbcType=VARCHAR},
      </if>
      <if test="gmtCreate != null">
        GMT_CREATE = #{gmtCreate,jdbcType=BIGINT},
      </if>
      <if test="gmtModified != null">
        GMT_MODIFIED = #{gmtModified,jdbcType=BIGINT},
      </if>
      <if test="bio != null">
        BIO = #{bio,jdbcType=VARCHAR},
      </if>
      <if test="avatarUrl != null">
        AVATAR_URL = #{avatarUrl,jdbcType=VARCHAR},
      </if>
    </set>
    where ID = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="life.majiang.community.model.User">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Sep 05 06:46:42 CST 2019.
    -->
    update USER
    set ACCOUNT_ID = #{accountId,jdbcType=VARCHAR},
      NAME = #{name,jdbcType=VARCHAR},
      TOKEN = #{token,jdbcType=VARCHAR},
      GMT_CREATE = #{gmtCreate,jdbcType=BIGINT},
      GMT_MODIFIED = #{gmtModified,jdbcType=BIGINT},
      BIO = #{bio,jdbcType=VARCHAR},
      AVATAR_URL = #{avatarUrl,jdbcType=VARCHAR}
    where ID = #{id,jdbcType=BIGINT}
  </update>
  <select id="selectByExampleWithRowbounds" parameterType="life.majiang.community.model.UserExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Thu Sep 05 06:46:42 CST 2019.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from USER
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
</mapper>