<?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.QuestionMapper">
  <resultMap id="BaseResultMap" type="life.majiang.community.model.Question">
    <!--
      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="TITLE" jdbcType="VARCHAR" property="title" />
    <result column="GMT_CREATE" jdbcType="BIGINT" property="gmtCreate" />
    <result column="GMT_MODIFIED" jdbcType="BIGINT" property="gmtModified" />
    <result column="CREATOR" jdbcType="BIGINT" property="creator" />
    <result column="COMMENT_COUNT" jdbcType="INTEGER" property="commentCount" />
    <result column="VIEW_COUNT" jdbcType="INTEGER" property="viewCount" />
    <result column="LIKE_COUNT" jdbcType="INTEGER" property="likeCount" />
    <result column="TAG" jdbcType="VARCHAR" property="tag" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="life.majiang.community.model.Question">
    <!--
      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.
    -->
    <result column="DESCRIPTION" jdbcType="CLOB" property="description" />
  </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, TITLE, GMT_CREATE, GMT_MODIFIED, CREATOR, COMMENT_COUNT, VIEW_COUNT, LIKE_COUNT, 
    TAG
  </sql>
  <sql id="Blob_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.
    -->
    DESCRIPTION
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="life.majiang.community.model.QuestionExample" resultMap="ResultMapWithBLOBs">
    <!--
      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" />
    ,
    <include refid="Blob_Column_List" />
    from QUESTION
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByExample" parameterType="life.majiang.community.model.QuestionExample" 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 QUESTION
    <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="ResultMapWithBLOBs">
    <!--
      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" />
    ,
    <include refid="Blob_Column_List" />
    from QUESTION
    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 QUESTION
    where ID = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="life.majiang.community.model.QuestionExample">
    <!--
      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 QUESTION
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="life.majiang.community.model.Question">
    <!--
      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 QUESTION (ID, TITLE, GMT_CREATE, 
      GMT_MODIFIED, CREATOR, COMMENT_COUNT, 
      VIEW_COUNT, LIKE_COUNT, TAG, 
      DESCRIPTION)
    values (#{id,jdbcType=BIGINT}, #{title,jdbcType=VARCHAR}, #{gmtCreate,jdbcType=BIGINT}, 
      #{gmtModified,jdbcType=BIGINT}, #{creator,jdbcType=BIGINT}, #{commentCount,jdbcType=INTEGER}, 
      #{viewCount,jdbcType=INTEGER}, #{likeCount,jdbcType=INTEGER}, #{tag,jdbcType=VARCHAR}, 
      #{description,jdbcType=CLOB})
  </insert>
  <insert id="insertSelective" parameterType="life.majiang.community.model.Question">
    <!--
      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 QUESTION
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        ID,
      </if>
      <if test="title != null">
        TITLE,
      </if>
      <if test="gmtCreate != null">
        GMT_CREATE,
      </if>
      <if test="gmtModified != null">
        GMT_MODIFIED,
      </if>
      <if test="creator != null">
        CREATOR,
      </if>
      <if test="commentCount != null">
        COMMENT_COUNT,
      </if>
      <if test="viewCount != null">
        VIEW_COUNT,
      </if>
      <if test="likeCount != null">
        LIKE_COUNT,
      </if>
      <if test="tag != null">
        TAG,
      </if>
      <if test="description != null">
        DESCRIPTION,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="title != null">
        #{title,jdbcType=VARCHAR},
      </if>
      <if test="gmtCreate != null">
        #{gmtCreate,jdbcType=BIGINT},
      </if>
      <if test="gmtModified != null">
        #{gmtModified,jdbcType=BIGINT},
      </if>
      <if test="creator != null">
        #{creator,jdbcType=BIGINT},
      </if>
      <if test="commentCount != null">
        #{commentCount,jdbcType=INTEGER},
      </if>
      <if test="viewCount != null">
        #{viewCount,jdbcType=INTEGER},
      </if>
      <if test="likeCount != null">
        #{likeCount,jdbcType=INTEGER},
      </if>
      <if test="tag != null">
        #{tag,jdbcType=VARCHAR},
      </if>
      <if test="description != null">
        #{description,jdbcType=CLOB},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="life.majiang.community.model.QuestionExample" 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 QUESTION
    <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 QUESTION
    <set>
      <if test="record.id != null">
        ID = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.title != null">
        TITLE = #{record.title,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.creator != null">
        CREATOR = #{record.creator,jdbcType=BIGINT},
      </if>
      <if test="record.commentCount != null">
        COMMENT_COUNT = #{record.commentCount,jdbcType=INTEGER},
      </if>
      <if test="record.viewCount != null">
        VIEW_COUNT = #{record.viewCount,jdbcType=INTEGER},
      </if>
      <if test="record.likeCount != null">
        LIKE_COUNT = #{record.likeCount,jdbcType=INTEGER},
      </if>
      <if test="record.tag != null">
        TAG = #{record.tag,jdbcType=VARCHAR},
      </if>
      <if test="record.description != null">
        DESCRIPTION = #{record.description,jdbcType=CLOB},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExampleWithBLOBs" 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 QUESTION
    set ID = #{record.id,jdbcType=BIGINT},
      TITLE = #{record.title,jdbcType=VARCHAR},
      GMT_CREATE = #{record.gmtCreate,jdbcType=BIGINT},
      GMT_MODIFIED = #{record.gmtModified,jdbcType=BIGINT},
      CREATOR = #{record.creator,jdbcType=BIGINT},
      COMMENT_COUNT = #{record.commentCount,jdbcType=INTEGER},
      VIEW_COUNT = #{record.viewCount,jdbcType=INTEGER},
      LIKE_COUNT = #{record.likeCount,jdbcType=INTEGER},
      TAG = #{record.tag,jdbcType=VARCHAR},
      DESCRIPTION = #{record.description,jdbcType=CLOB}
    <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 QUESTION
    set ID = #{record.id,jdbcType=BIGINT},
      TITLE = #{record.title,jdbcType=VARCHAR},
      GMT_CREATE = #{record.gmtCreate,jdbcType=BIGINT},
      GMT_MODIFIED = #{record.gmtModified,jdbcType=BIGINT},
      CREATOR = #{record.creator,jdbcType=BIGINT},
      COMMENT_COUNT = #{record.commentCount,jdbcType=INTEGER},
      VIEW_COUNT = #{record.viewCount,jdbcType=INTEGER},
      LIKE_COUNT = #{record.likeCount,jdbcType=INTEGER},
      TAG = #{record.tag,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="life.majiang.community.model.Question">
    <!--
      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 QUESTION
    <set>
      <if test="title != null">
        TITLE = #{title,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="creator != null">
        CREATOR = #{creator,jdbcType=BIGINT},
      </if>
      <if test="commentCount != null">
        COMMENT_COUNT = #{commentCount,jdbcType=INTEGER},
      </if>
      <if test="viewCount != null">
        VIEW_COUNT = #{viewCount,jdbcType=INTEGER},
      </if>
      <if test="likeCount != null">
        LIKE_COUNT = #{likeCount,jdbcType=INTEGER},
      </if>
      <if test="tag != null">
        TAG = #{tag,jdbcType=VARCHAR},
      </if>
      <if test="description != null">
        DESCRIPTION = #{description,jdbcType=CLOB},
      </if>
    </set>
    where ID = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="life.majiang.community.model.Question">
    <!--
      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 QUESTION
    set TITLE = #{title,jdbcType=VARCHAR},
      GMT_CREATE = #{gmtCreate,jdbcType=BIGINT},
      GMT_MODIFIED = #{gmtModified,jdbcType=BIGINT},
      CREATOR = #{creator,jdbcType=BIGINT},
      COMMENT_COUNT = #{commentCount,jdbcType=INTEGER},
      VIEW_COUNT = #{viewCount,jdbcType=INTEGER},
      LIKE_COUNT = #{likeCount,jdbcType=INTEGER},
      TAG = #{tag,jdbcType=VARCHAR},
      DESCRIPTION = #{description,jdbcType=CLOB}
    where ID = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="life.majiang.community.model.Question">
    <!--
      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 QUESTION
    set TITLE = #{title,jdbcType=VARCHAR},
      GMT_CREATE = #{gmtCreate,jdbcType=BIGINT},
      GMT_MODIFIED = #{gmtModified,jdbcType=BIGINT},
      CREATOR = #{creator,jdbcType=BIGINT},
      COMMENT_COUNT = #{commentCount,jdbcType=INTEGER},
      VIEW_COUNT = #{viewCount,jdbcType=INTEGER},
      LIKE_COUNT = #{likeCount,jdbcType=INTEGER},
      TAG = #{tag,jdbcType=VARCHAR}
    where ID = #{id,jdbcType=BIGINT}
  </update>
  <select id="selectByExampleWithBLOBsWithRowbounds" parameterType="life.majiang.community.model.QuestionExample" resultMap="ResultMapWithBLOBs">
    <!--
      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" />
    ,
    <include refid="Blob_Column_List" />
    from QUESTION
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByExampleWithRowbounds" parameterType="life.majiang.community.model.QuestionExample" 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 QUESTION
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
</mapper>