<?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.AdMapper">
  <resultMap id="BaseResultMap" type="life.majiang.community.model.Ad">
    <!--
      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="INTEGER" property="id" />
    <result column="TITLE" jdbcType="VARCHAR" property="title" />
    <result column="URL" jdbcType="VARCHAR" property="url" />
    <result column="IMAGE" jdbcType="VARCHAR" property="image" />
    <result column="GMT_START" jdbcType="BIGINT" property="gmtStart" />
    <result column="GMT_END" jdbcType="BIGINT" property="gmtEnd" />
    <result column="GMT_CREATE" jdbcType="BIGINT" property="gmtCreate" />
    <result column="GMT_MODIFIED" jdbcType="BIGINT" property="gmtModified" />
    <result column="STATUS" jdbcType="INTEGER" property="status" />
    <result column="POS" jdbcType="VARCHAR" property="pos" />
  </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, URL, IMAGE, GMT_START, GMT_END, GMT_CREATE, GMT_MODIFIED, STATUS, POS
  </sql>
  <select id="selectByExample" parameterType="life.majiang.community.model.AdExample" 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 AD
    <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.Integer" 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 AD
    where ID = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    <!--
      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 AD
    where ID = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="life.majiang.community.model.AdExample">
    <!--
      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 AD
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="life.majiang.community.model.Ad">
    <!--
      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 AD (ID, TITLE, URL, 
      IMAGE, GMT_START, GMT_END, 
      GMT_CREATE, GMT_MODIFIED, STATUS, 
      POS)
    values (#{id,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, 
      #{image,jdbcType=VARCHAR}, #{gmtStart,jdbcType=BIGINT}, #{gmtEnd,jdbcType=BIGINT}, 
      #{gmtCreate,jdbcType=BIGINT}, #{gmtModified,jdbcType=BIGINT}, #{status,jdbcType=INTEGER}, 
      #{pos,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="life.majiang.community.model.Ad">
    <!--
      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 AD
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        ID,
      </if>
      <if test="title != null">
        TITLE,
      </if>
      <if test="url != null">
        URL,
      </if>
      <if test="image != null">
        IMAGE,
      </if>
      <if test="gmtStart != null">
        GMT_START,
      </if>
      <if test="gmtEnd != null">
        GMT_END,
      </if>
      <if test="gmtCreate != null">
        GMT_CREATE,
      </if>
      <if test="gmtModified != null">
        GMT_MODIFIED,
      </if>
      <if test="status != null">
        STATUS,
      </if>
      <if test="pos != null">
        POS,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="title != null">
        #{title,jdbcType=VARCHAR},
      </if>
      <if test="url != null">
        #{url,jdbcType=VARCHAR},
      </if>
      <if test="image != null">
        #{image,jdbcType=VARCHAR},
      </if>
      <if test="gmtStart != null">
        #{gmtStart,jdbcType=BIGINT},
      </if>
      <if test="gmtEnd != null">
        #{gmtEnd,jdbcType=BIGINT},
      </if>
      <if test="gmtCreate != null">
        #{gmtCreate,jdbcType=BIGINT},
      </if>
      <if test="gmtModified != null">
        #{gmtModified,jdbcType=BIGINT},
      </if>
      <if test="status != null">
        #{status,jdbcType=INTEGER},
      </if>
      <if test="pos != null">
        #{pos,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="life.majiang.community.model.AdExample" 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 AD
    <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 AD
    <set>
      <if test="record.id != null">
        ID = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.title != null">
        TITLE = #{record.title,jdbcType=VARCHAR},
      </if>
      <if test="record.url != null">
        URL = #{record.url,jdbcType=VARCHAR},
      </if>
      <if test="record.image != null">
        IMAGE = #{record.image,jdbcType=VARCHAR},
      </if>
      <if test="record.gmtStart != null">
        GMT_START = #{record.gmtStart,jdbcType=BIGINT},
      </if>
      <if test="record.gmtEnd != null">
        GMT_END = #{record.gmtEnd,jdbcType=BIGINT},
      </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.status != null">
        STATUS = #{record.status,jdbcType=INTEGER},
      </if>
      <if test="record.pos != null">
        POS = #{record.pos,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 AD
    set ID = #{record.id,jdbcType=INTEGER},
      TITLE = #{record.title,jdbcType=VARCHAR},
      URL = #{record.url,jdbcType=VARCHAR},
      IMAGE = #{record.image,jdbcType=VARCHAR},
      GMT_START = #{record.gmtStart,jdbcType=BIGINT},
      GMT_END = #{record.gmtEnd,jdbcType=BIGINT},
      GMT_CREATE = #{record.gmtCreate,jdbcType=BIGINT},
      GMT_MODIFIED = #{record.gmtModified,jdbcType=BIGINT},
      STATUS = #{record.status,jdbcType=INTEGER},
      POS = #{record.pos,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="life.majiang.community.model.Ad">
    <!--
      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 AD
    <set>
      <if test="title != null">
        TITLE = #{title,jdbcType=VARCHAR},
      </if>
      <if test="url != null">
        URL = #{url,jdbcType=VARCHAR},
      </if>
      <if test="image != null">
        IMAGE = #{image,jdbcType=VARCHAR},
      </if>
      <if test="gmtStart != null">
        GMT_START = #{gmtStart,jdbcType=BIGINT},
      </if>
      <if test="gmtEnd != null">
        GMT_END = #{gmtEnd,jdbcType=BIGINT},
      </if>
      <if test="gmtCreate != null">
        GMT_CREATE = #{gmtCreate,jdbcType=BIGINT},
      </if>
      <if test="gmtModified != null">
        GMT_MODIFIED = #{gmtModified,jdbcType=BIGINT},
      </if>
      <if test="status != null">
        STATUS = #{status,jdbcType=INTEGER},
      </if>
      <if test="pos != null">
        POS = #{pos,jdbcType=VARCHAR},
      </if>
    </set>
    where ID = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="life.majiang.community.model.Ad">
    <!--
      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 AD
    set TITLE = #{title,jdbcType=VARCHAR},
      URL = #{url,jdbcType=VARCHAR},
      IMAGE = #{image,jdbcType=VARCHAR},
      GMT_START = #{gmtStart,jdbcType=BIGINT},
      GMT_END = #{gmtEnd,jdbcType=BIGINT},
      GMT_CREATE = #{gmtCreate,jdbcType=BIGINT},
      GMT_MODIFIED = #{gmtModified,jdbcType=BIGINT},
      STATUS = #{status,jdbcType=INTEGER},
      POS = #{pos,jdbcType=VARCHAR}
    where ID = #{id,jdbcType=INTEGER}
  </update>
  <select id="selectByExampleWithRowbounds" parameterType="life.majiang.community.model.AdExample" 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 AD
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
</mapper>