<?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="org.linlinjava.litemall.db.dao.LitemallBrandMapper">
  <resultMap id="BaseResultMap" type="org.linlinjava.litemall.db.domain.LitemallBrand">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Mar 20 00:11:33 CST 2018.
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="list_pic_url" jdbcType="VARCHAR" property="listPicUrl" />
    <result column="simple_desc" jdbcType="VARCHAR" property="simpleDesc" />
    <result column="pic_url" jdbcType="VARCHAR" property="picUrl" />
    <result column="sort_order" jdbcType="TINYINT" property="sortOrder" />
    <result column="is_show" jdbcType="BIT" property="isShow" />
    <result column="floor_price" jdbcType="DECIMAL" property="floorPrice" />
    <result column="app_list_pic_url" jdbcType="VARCHAR" property="appListPicUrl" />
    <result column="is_new" jdbcType="BIT" property="isNew" />
    <result column="new_pic_url" jdbcType="VARCHAR" property="newPicUrl" />
    <result column="new_sort_order" jdbcType="TINYINT" property="newSortOrder" />
  </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 Tue Mar 20 00:11:33 CST 2018.
    -->
    <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 Tue Mar 20 00:11:33 CST 2018.
    -->
    <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 Tue Mar 20 00:11:33 CST 2018.
    -->
    id, `name`, list_pic_url, simple_desc, pic_url, sort_order, is_show, floor_price, 
    app_list_pic_url, is_new, new_pic_url, new_sort_order
  </sql>
  <select id="selectByExample" parameterType="org.linlinjava.litemall.db.domain.LitemallBrandExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Mar 20 00:11:33 CST 2018.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from litemall_brand
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByExampleSelective" parameterType="map" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    select
    <if test="example.distinct">
      distinct
    </if>
    <foreach collection="selective" item="column" separator=",">
      ${column.value}
    </foreach>
    from litemall_brand
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
    <if test="example.orderByClause != null">
      order by ${example.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 Tue Mar 20 00:11:33 CST 2018.
    -->
    select 
    <include refid="Base_Column_List" />
    from litemall_brand
    where id = #{id,jdbcType=INTEGER}
  </select>
  <select id="selectByPrimaryKeySelective" parameterType="map" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    select
    <foreach collection="selective" item="column" separator=",">
      ${column.value}
    </foreach>
    from litemall_brand
    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 Tue Mar 20 00:11:33 CST 2018.
    -->
    delete from litemall_brand
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="org.linlinjava.litemall.db.domain.LitemallBrandExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Mar 20 00:11:33 CST 2018.
    -->
    delete from litemall_brand
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="org.linlinjava.litemall.db.domain.LitemallBrand">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Mar 20 00:11:33 CST 2018.
    -->
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into litemall_brand (`name`, list_pic_url, simple_desc, 
      pic_url, sort_order, is_show, 
      floor_price, app_list_pic_url, is_new, 
      new_pic_url, new_sort_order)
    values (#{name,jdbcType=VARCHAR}, #{listPicUrl,jdbcType=VARCHAR}, #{simpleDesc,jdbcType=VARCHAR}, 
      #{picUrl,jdbcType=VARCHAR}, #{sortOrder,jdbcType=TINYINT}, #{isShow,jdbcType=BIT}, 
      #{floorPrice,jdbcType=DECIMAL}, #{appListPicUrl,jdbcType=VARCHAR}, #{isNew,jdbcType=BIT}, 
      #{newPicUrl,jdbcType=VARCHAR}, #{newSortOrder,jdbcType=TINYINT})
  </insert>
  <insert id="insertSelective" parameterType="org.linlinjava.litemall.db.domain.LitemallBrand">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Mar 20 00:11:33 CST 2018.
    -->
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into litemall_brand
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="name != null">
        `name`,
      </if>
      <if test="listPicUrl != null">
        list_pic_url,
      </if>
      <if test="simpleDesc != null">
        simple_desc,
      </if>
      <if test="picUrl != null">
        pic_url,
      </if>
      <if test="sortOrder != null">
        sort_order,
      </if>
      <if test="isShow != null">
        is_show,
      </if>
      <if test="floorPrice != null">
        floor_price,
      </if>
      <if test="appListPicUrl != null">
        app_list_pic_url,
      </if>
      <if test="isNew != null">
        is_new,
      </if>
      <if test="newPicUrl != null">
        new_pic_url,
      </if>
      <if test="newSortOrder != null">
        new_sort_order,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="listPicUrl != null">
        #{listPicUrl,jdbcType=VARCHAR},
      </if>
      <if test="simpleDesc != null">
        #{simpleDesc,jdbcType=VARCHAR},
      </if>
      <if test="picUrl != null">
        #{picUrl,jdbcType=VARCHAR},
      </if>
      <if test="sortOrder != null">
        #{sortOrder,jdbcType=TINYINT},
      </if>
      <if test="isShow != null">
        #{isShow,jdbcType=BIT},
      </if>
      <if test="floorPrice != null">
        #{floorPrice,jdbcType=DECIMAL},
      </if>
      <if test="appListPicUrl != null">
        #{appListPicUrl,jdbcType=VARCHAR},
      </if>
      <if test="isNew != null">
        #{isNew,jdbcType=BIT},
      </if>
      <if test="newPicUrl != null">
        #{newPicUrl,jdbcType=VARCHAR},
      </if>
      <if test="newSortOrder != null">
        #{newSortOrder,jdbcType=TINYINT},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="org.linlinjava.litemall.db.domain.LitemallBrandExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Mar 20 00:11:33 CST 2018.
    -->
    select count(*) from litemall_brand
    <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 Tue Mar 20 00:11:33 CST 2018.
    -->
    update litemall_brand
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.name != null">
        `name` = #{record.name,jdbcType=VARCHAR},
      </if>
      <if test="record.listPicUrl != null">
        list_pic_url = #{record.listPicUrl,jdbcType=VARCHAR},
      </if>
      <if test="record.simpleDesc != null">
        simple_desc = #{record.simpleDesc,jdbcType=VARCHAR},
      </if>
      <if test="record.picUrl != null">
        pic_url = #{record.picUrl,jdbcType=VARCHAR},
      </if>
      <if test="record.sortOrder != null">
        sort_order = #{record.sortOrder,jdbcType=TINYINT},
      </if>
      <if test="record.isShow != null">
        is_show = #{record.isShow,jdbcType=BIT},
      </if>
      <if test="record.floorPrice != null">
        floor_price = #{record.floorPrice,jdbcType=DECIMAL},
      </if>
      <if test="record.appListPicUrl != null">
        app_list_pic_url = #{record.appListPicUrl,jdbcType=VARCHAR},
      </if>
      <if test="record.isNew != null">
        is_new = #{record.isNew,jdbcType=BIT},
      </if>
      <if test="record.newPicUrl != null">
        new_pic_url = #{record.newPicUrl,jdbcType=VARCHAR},
      </if>
      <if test="record.newSortOrder != null">
        new_sort_order = #{record.newSortOrder,jdbcType=TINYINT},
      </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 Tue Mar 20 00:11:33 CST 2018.
    -->
    update litemall_brand
    set id = #{record.id,jdbcType=INTEGER},
      `name` = #{record.name,jdbcType=VARCHAR},
      list_pic_url = #{record.listPicUrl,jdbcType=VARCHAR},
      simple_desc = #{record.simpleDesc,jdbcType=VARCHAR},
      pic_url = #{record.picUrl,jdbcType=VARCHAR},
      sort_order = #{record.sortOrder,jdbcType=TINYINT},
      is_show = #{record.isShow,jdbcType=BIT},
      floor_price = #{record.floorPrice,jdbcType=DECIMAL},
      app_list_pic_url = #{record.appListPicUrl,jdbcType=VARCHAR},
      is_new = #{record.isNew,jdbcType=BIT},
      new_pic_url = #{record.newPicUrl,jdbcType=VARCHAR},
      new_sort_order = #{record.newSortOrder,jdbcType=TINYINT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="org.linlinjava.litemall.db.domain.LitemallBrand">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Mar 20 00:11:33 CST 2018.
    -->
    update litemall_brand
    <set>
      <if test="name != null">
        `name` = #{name,jdbcType=VARCHAR},
      </if>
      <if test="listPicUrl != null">
        list_pic_url = #{listPicUrl,jdbcType=VARCHAR},
      </if>
      <if test="simpleDesc != null">
        simple_desc = #{simpleDesc,jdbcType=VARCHAR},
      </if>
      <if test="picUrl != null">
        pic_url = #{picUrl,jdbcType=VARCHAR},
      </if>
      <if test="sortOrder != null">
        sort_order = #{sortOrder,jdbcType=TINYINT},
      </if>
      <if test="isShow != null">
        is_show = #{isShow,jdbcType=BIT},
      </if>
      <if test="floorPrice != null">
        floor_price = #{floorPrice,jdbcType=DECIMAL},
      </if>
      <if test="appListPicUrl != null">
        app_list_pic_url = #{appListPicUrl,jdbcType=VARCHAR},
      </if>
      <if test="isNew != null">
        is_new = #{isNew,jdbcType=BIT},
      </if>
      <if test="newPicUrl != null">
        new_pic_url = #{newPicUrl,jdbcType=VARCHAR},
      </if>
      <if test="newSortOrder != null">
        new_sort_order = #{newSortOrder,jdbcType=TINYINT},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="org.linlinjava.litemall.db.domain.LitemallBrand">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Mar 20 00:11:33 CST 2018.
    -->
    update litemall_brand
    set `name` = #{name,jdbcType=VARCHAR},
      list_pic_url = #{listPicUrl,jdbcType=VARCHAR},
      simple_desc = #{simpleDesc,jdbcType=VARCHAR},
      pic_url = #{picUrl,jdbcType=VARCHAR},
      sort_order = #{sortOrder,jdbcType=TINYINT},
      is_show = #{isShow,jdbcType=BIT},
      floor_price = #{floorPrice,jdbcType=DECIMAL},
      app_list_pic_url = #{appListPicUrl,jdbcType=VARCHAR},
      is_new = #{isNew,jdbcType=BIT},
      new_pic_url = #{newPicUrl,jdbcType=VARCHAR},
      new_sort_order = #{newSortOrder,jdbcType=TINYINT}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <select id="selectOneByExample" parameterType="org.linlinjava.litemall.db.domain.LitemallBrandExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    select
    <include refid="Base_Column_List" />
    from litemall_brand
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    limit 1
  </select>
  <select id="selectOneByExampleSelective" parameterType="map" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    select
    <foreach collection="selective" item="column" separator=",">
      ${column.value}
    </foreach>
    from litemall_brand
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
    <if test="example.orderByClause != null">
      order by ${example.orderByClause}
    </if>
    limit 1
  </select>
</mapper>