<?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.NotificationMapper">
  <resultMap id="BaseResultMap" type="life.majiang.community.model.Notification">
    <!--
      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="NOTIFIER" jdbcType="BIGINT" property="notifier" />
    <result column="RECEIVER" jdbcType="BIGINT" property="receiver" />
    <result column="OUTERID" jdbcType="BIGINT" property="outerid" />
    <result column="TYPE" jdbcType="INTEGER" property="type" />
    <result column="GMT_CREATE" jdbcType="BIGINT" property="gmtCreate" />
    <result column="STATUS" jdbcType="INTEGER" property="status" />
    <result column="NOTIFIER_NAME" jdbcType="VARCHAR" property="notifierName" />
    <result column="OUTER_TITLE" jdbcType="VARCHAR" property="outerTitle" />
  </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, NOTIFIER, RECEIVER, OUTERID, TYPE, GMT_CREATE, STATUS, NOTIFIER_NAME, OUTER_TITLE
  </sql>
  <select id="selectByExample" parameterType="life.majiang.community.model.NotificationExample" 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 NOTIFICATION
    <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 NOTIFICATION
    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 NOTIFICATION
    where ID = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="life.majiang.community.model.NotificationExample">
    <!--
      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 NOTIFICATION
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="life.majiang.community.model.Notification">
    <!--
      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 NOTIFICATION (ID, NOTIFIER, RECEIVER, 
      OUTERID, TYPE, GMT_CREATE, 
      STATUS, NOTIFIER_NAME, OUTER_TITLE
      )
    values (#{id,jdbcType=BIGINT}, #{notifier,jdbcType=BIGINT}, #{receiver,jdbcType=BIGINT}, 
      #{outerid,jdbcType=BIGINT}, #{type,jdbcType=INTEGER}, #{gmtCreate,jdbcType=BIGINT}, 
      #{status,jdbcType=INTEGER}, #{notifierName,jdbcType=VARCHAR}, #{outerTitle,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="life.majiang.community.model.Notification">
    <!--
      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 NOTIFICATION
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        ID,
      </if>
      <if test="notifier != null">
        NOTIFIER,
      </if>
      <if test="receiver != null">
        RECEIVER,
      </if>
      <if test="outerid != null">
        OUTERID,
      </if>
      <if test="type != null">
        TYPE,
      </if>
      <if test="gmtCreate != null">
        GMT_CREATE,
      </if>
      <if test="status != null">
        STATUS,
      </if>
      <if test="notifierName != null">
        NOTIFIER_NAME,
      </if>
      <if test="outerTitle != null">
        OUTER_TITLE,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="notifier != null">
        #{notifier,jdbcType=BIGINT},
      </if>
      <if test="receiver != null">
        #{receiver,jdbcType=BIGINT},
      </if>
      <if test="outerid != null">
        #{outerid,jdbcType=BIGINT},
      </if>
      <if test="type != null">
        #{type,jdbcType=INTEGER},
      </if>
      <if test="gmtCreate != null">
        #{gmtCreate,jdbcType=BIGINT},
      </if>
      <if test="status != null">
        #{status,jdbcType=INTEGER},
      </if>
      <if test="notifierName != null">
        #{notifierName,jdbcType=VARCHAR},
      </if>
      <if test="outerTitle != null">
        #{outerTitle,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="life.majiang.community.model.NotificationExample" 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 NOTIFICATION
    <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 NOTIFICATION
    <set>
      <if test="record.id != null">
        ID = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.notifier != null">
        NOTIFIER = #{record.notifier,jdbcType=BIGINT},
      </if>
      <if test="record.receiver != null">
        RECEIVER = #{record.receiver,jdbcType=BIGINT},
      </if>
      <if test="record.outerid != null">
        OUTERID = #{record.outerid,jdbcType=BIGINT},
      </if>
      <if test="record.type != null">
        TYPE = #{record.type,jdbcType=INTEGER},
      </if>
      <if test="record.gmtCreate != null">
        GMT_CREATE = #{record.gmtCreate,jdbcType=BIGINT},
      </if>
      <if test="record.status != null">
        STATUS = #{record.status,jdbcType=INTEGER},
      </if>
      <if test="record.notifierName != null">
        NOTIFIER_NAME = #{record.notifierName,jdbcType=VARCHAR},
      </if>
      <if test="record.outerTitle != null">
        OUTER_TITLE = #{record.outerTitle,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 NOTIFICATION
    set ID = #{record.id,jdbcType=BIGINT},
      NOTIFIER = #{record.notifier,jdbcType=BIGINT},
      RECEIVER = #{record.receiver,jdbcType=BIGINT},
      OUTERID = #{record.outerid,jdbcType=BIGINT},
      TYPE = #{record.type,jdbcType=INTEGER},
      GMT_CREATE = #{record.gmtCreate,jdbcType=BIGINT},
      STATUS = #{record.status,jdbcType=INTEGER},
      NOTIFIER_NAME = #{record.notifierName,jdbcType=VARCHAR},
      OUTER_TITLE = #{record.outerTitle,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="life.majiang.community.model.Notification">
    <!--
      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 NOTIFICATION
    <set>
      <if test="notifier != null">
        NOTIFIER = #{notifier,jdbcType=BIGINT},
      </if>
      <if test="receiver != null">
        RECEIVER = #{receiver,jdbcType=BIGINT},
      </if>
      <if test="outerid != null">
        OUTERID = #{outerid,jdbcType=BIGINT},
      </if>
      <if test="type != null">
        TYPE = #{type,jdbcType=INTEGER},
      </if>
      <if test="gmtCreate != null">
        GMT_CREATE = #{gmtCreate,jdbcType=BIGINT},
      </if>
      <if test="status != null">
        STATUS = #{status,jdbcType=INTEGER},
      </if>
      <if test="notifierName != null">
        NOTIFIER_NAME = #{notifierName,jdbcType=VARCHAR},
      </if>
      <if test="outerTitle != null">
        OUTER_TITLE = #{outerTitle,jdbcType=VARCHAR},
      </if>
    </set>
    where ID = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="life.majiang.community.model.Notification">
    <!--
      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 NOTIFICATION
    set NOTIFIER = #{notifier,jdbcType=BIGINT},
      RECEIVER = #{receiver,jdbcType=BIGINT},
      OUTERID = #{outerid,jdbcType=BIGINT},
      TYPE = #{type,jdbcType=INTEGER},
      GMT_CREATE = #{gmtCreate,jdbcType=BIGINT},
      STATUS = #{status,jdbcType=INTEGER},
      NOTIFIER_NAME = #{notifierName,jdbcType=VARCHAR},
      OUTER_TITLE = #{outerTitle,jdbcType=VARCHAR}
    where ID = #{id,jdbcType=BIGINT}
  </update>
  <select id="selectByExampleWithRowbounds" parameterType="life.majiang.community.model.NotificationExample" 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 NOTIFICATION
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
</mapper>