<?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.LitemallGoodsMapper">
  <resultMap id="BaseResultMap" type="org.linlinjava.litemall.db.domain.LitemallGoods">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="goods_sn" jdbcType="VARCHAR" property="goodsSn" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="category_id" jdbcType="INTEGER" property="categoryId" />
    <result column="brand_id" jdbcType="INTEGER" property="brandId" />
    <result column="gallery" jdbcType="VARCHAR" property="gallery" typeHandler="org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler" />
    <result column="keywords" jdbcType="VARCHAR" property="keywords" />
    <result column="brief" jdbcType="VARCHAR" property="brief" />
    <result column="is_on_sale" jdbcType="BIT" property="isOnSale" />
    <result column="sort_order" jdbcType="SMALLINT" property="sortOrder" />
    <result column="pic_url" jdbcType="VARCHAR" property="picUrl" />
    <result column="share_url" jdbcType="VARCHAR" property="shareUrl" />
    <result column="is_new" jdbcType="BIT" property="isNew" />
    <result column="is_hot" jdbcType="BIT" property="isHot" />
    <result column="unit" jdbcType="VARCHAR" property="unit" />
    <result column="counter_price" jdbcType="DECIMAL" property="counterPrice" />
    <result column="retail_price" jdbcType="DECIMAL" property="retailPrice" />
    <result column="add_time" jdbcType="TIMESTAMP" property="addTime" />
    <result column="deleted" jdbcType="BIT" property="deleted" />
    <result column="version" jdbcType="INTEGER" property="version" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="org.linlinjava.litemall.db.domain.LitemallGoods">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <result column="detail" jdbcType="LONGVARCHAR" property="detail" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <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>
            <foreach collection="criteria.galleryCriteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler} and #{criterion.secondValue,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler}
                  </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.
    -->
    <where>
      <foreach close=")" collection="example.oredCriteria" item="criteria" open="and (" 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>
            <foreach collection="criteria.galleryCriteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler} and #{criterion.secondValue,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_With_Version_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    <where>
      version = #{version,jdbcType=INTEGER}
      <if test="example.oredCriteria.size() &gt; 0">
        <foreach close=")" collection="example.oredCriteria" item="criteria" open="and (" 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>
              <foreach collection="criteria.galleryCriteria" item="criterion">
                <choose>
                  <when test="criterion.noValue">
                    and ${criterion.condition}
                  </when>
                  <when test="criterion.singleValue">
                    and ${criterion.condition} #{criterion.value,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler}
                  </when>
                  <when test="criterion.betweenValue">
                    and ${criterion.condition} #{criterion.value,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler} and #{criterion.secondValue,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler}
                  </when>
                  <when test="criterion.listValue">
                    and ${criterion.condition}
                    <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                      #{listItem,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler}
                    </foreach>
                  </when>
                </choose>
              </foreach>
            </trim>
          </if>
        </foreach>
      </if>
    </where>
  </sql>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    id, goods_sn, `name`, category_id, brand_id, gallery, keywords, brief, is_on_sale, 
    sort_order, pic_url, share_url, is_new, is_hot, unit, counter_price, retail_price, 
    add_time, deleted, version
  </sql>
  <sql id="Blob_Column_List">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    detail
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="org.linlinjava.litemall.db.domain.LitemallGoodsExample" resultMap="ResultMapWithBLOBs">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from litemall_goods
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByExample" parameterType="org.linlinjava.litemall.db.domain.LitemallGoodsExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from litemall_goods
    <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="ResultMapWithBLOBs">
    <!--
      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>
    <choose>
      <when test="selective != null and selective.length &gt; 0">
        <foreach collection="selective" item="column" separator=",">
          ${column.escapedColumnName}
        </foreach>
      </when>
      <otherwise>
        id, goods_sn, `name`, category_id, brand_id, gallery, keywords, brief, is_on_sale, 
          sort_order, pic_url, share_url, is_new, is_hot, unit, counter_price, retail_price, 
          add_time, deleted, version, detail
      </otherwise>
    </choose>
    from litemall_goods
    <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="ResultMapWithBLOBs">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from litemall_goods
    where id = #{id,jdbcType=INTEGER}
  </select>
  <select id="selectByPrimaryKeyWithLogicalDelete" parameterType="map" resultMap="ResultMapWithBLOBs">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from litemall_goods
    where id = #{id,jdbcType=INTEGER}
      and deleted = 
    <choose>
      <when test="andLogicalDeleted">
        '1'
      </when>
      <otherwise>
        '0'
      </otherwise>
    </choose>
  </select>
  <select id="selectByPrimaryKeySelective" parameterType="map" resultMap="ResultMapWithBLOBs">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    select
    <choose>
      <when test="selective != null and selective.length &gt; 0">
        <foreach collection="selective" item="column" separator=",">
          ${column.escapedColumnName}
        </foreach>
      </when>
      <otherwise>
        id, goods_sn, `name`, category_id, brand_id, gallery, keywords, brief, is_on_sale, 
          sort_order, pic_url, share_url, is_new, is_hot, unit, counter_price, retail_price, 
          add_time, deleted, version, detail
      </otherwise>
    </choose>
    from litemall_goods
    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.
    -->
    delete from litemall_goods
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="org.linlinjava.litemall.db.domain.LitemallGoodsExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from litemall_goods
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="org.linlinjava.litemall.db.domain.LitemallGoods">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into litemall_goods (goods_sn, `name`, category_id, 
      brand_id, gallery, 
      keywords, brief, is_on_sale, 
      sort_order, pic_url, share_url, 
      is_new, is_hot, unit, counter_price, 
      retail_price, add_time, deleted, 
      version, detail)
    values (#{goodsSn,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{categoryId,jdbcType=INTEGER}, 
      #{brandId,jdbcType=INTEGER}, #{gallery,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler}, 
      #{keywords,jdbcType=VARCHAR}, #{brief,jdbcType=VARCHAR}, #{isOnSale,jdbcType=BIT}, 
      #{sortOrder,jdbcType=SMALLINT}, #{picUrl,jdbcType=VARCHAR}, #{shareUrl,jdbcType=VARCHAR}, 
      #{isNew,jdbcType=BIT}, #{isHot,jdbcType=BIT}, #{unit,jdbcType=VARCHAR}, #{counterPrice,jdbcType=DECIMAL}, 
      #{retailPrice,jdbcType=DECIMAL}, #{addTime,jdbcType=TIMESTAMP}, #{deleted,jdbcType=BIT}, 
      #{version,jdbcType=INTEGER}, #{detail,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="org.linlinjava.litemall.db.domain.LitemallGoods">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into litemall_goods
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="goodsSn != null">
        goods_sn,
      </if>
      <if test="name != null">
        `name`,
      </if>
      <if test="categoryId != null">
        category_id,
      </if>
      <if test="brandId != null">
        brand_id,
      </if>
      <if test="gallery != null">
        gallery,
      </if>
      <if test="keywords != null">
        keywords,
      </if>
      <if test="brief != null">
        brief,
      </if>
      <if test="isOnSale != null">
        is_on_sale,
      </if>
      <if test="sortOrder != null">
        sort_order,
      </if>
      <if test="picUrl != null">
        pic_url,
      </if>
      <if test="shareUrl != null">
        share_url,
      </if>
      <if test="isNew != null">
        is_new,
      </if>
      <if test="isHot != null">
        is_hot,
      </if>
      <if test="unit != null">
        unit,
      </if>
      <if test="counterPrice != null">
        counter_price,
      </if>
      <if test="retailPrice != null">
        retail_price,
      </if>
      <if test="addTime != null">
        add_time,
      </if>
      <if test="deleted != null">
        deleted,
      </if>
      <if test="version != null">
        version,
      </if>
      <if test="detail != null">
        detail,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="goodsSn != null">
        #{goodsSn,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="categoryId != null">
        #{categoryId,jdbcType=INTEGER},
      </if>
      <if test="brandId != null">
        #{brandId,jdbcType=INTEGER},
      </if>
      <if test="gallery != null">
        #{gallery,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler},
      </if>
      <if test="keywords != null">
        #{keywords,jdbcType=VARCHAR},
      </if>
      <if test="brief != null">
        #{brief,jdbcType=VARCHAR},
      </if>
      <if test="isOnSale != null">
        #{isOnSale,jdbcType=BIT},
      </if>
      <if test="sortOrder != null">
        #{sortOrder,jdbcType=SMALLINT},
      </if>
      <if test="picUrl != null">
        #{picUrl,jdbcType=VARCHAR},
      </if>
      <if test="shareUrl != null">
        #{shareUrl,jdbcType=VARCHAR},
      </if>
      <if test="isNew != null">
        #{isNew,jdbcType=BIT},
      </if>
      <if test="isHot != null">
        #{isHot,jdbcType=BIT},
      </if>
      <if test="unit != null">
        #{unit,jdbcType=VARCHAR},
      </if>
      <if test="counterPrice != null">
        #{counterPrice,jdbcType=DECIMAL},
      </if>
      <if test="retailPrice != null">
        #{retailPrice,jdbcType=DECIMAL},
      </if>
      <if test="addTime != null">
        #{addTime,jdbcType=TIMESTAMP},
      </if>
      <if test="deleted != null">
        #{deleted,jdbcType=BIT},
      </if>
      <if test="version != null">
        #{version,jdbcType=INTEGER},
      </if>
      <if test="detail != null">
        #{detail,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="org.linlinjava.litemall.db.domain.LitemallGoodsExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from litemall_goods
    <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.
    -->
    update litemall_goods
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.goodsSn != null">
        goods_sn = #{record.goodsSn,jdbcType=VARCHAR},
      </if>
      <if test="record.name != null">
        `name` = #{record.name,jdbcType=VARCHAR},
      </if>
      <if test="record.categoryId != null">
        category_id = #{record.categoryId,jdbcType=INTEGER},
      </if>
      <if test="record.brandId != null">
        brand_id = #{record.brandId,jdbcType=INTEGER},
      </if>
      <if test="record.gallery != null">
        gallery = #{record.gallery,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler},
      </if>
      <if test="record.keywords != null">
        keywords = #{record.keywords,jdbcType=VARCHAR},
      </if>
      <if test="record.brief != null">
        brief = #{record.brief,jdbcType=VARCHAR},
      </if>
      <if test="record.isOnSale != null">
        is_on_sale = #{record.isOnSale,jdbcType=BIT},
      </if>
      <if test="record.sortOrder != null">
        sort_order = #{record.sortOrder,jdbcType=SMALLINT},
      </if>
      <if test="record.picUrl != null">
        pic_url = #{record.picUrl,jdbcType=VARCHAR},
      </if>
      <if test="record.shareUrl != null">
        share_url = #{record.shareUrl,jdbcType=VARCHAR},
      </if>
      <if test="record.isNew != null">
        is_new = #{record.isNew,jdbcType=BIT},
      </if>
      <if test="record.isHot != null">
        is_hot = #{record.isHot,jdbcType=BIT},
      </if>
      <if test="record.unit != null">
        unit = #{record.unit,jdbcType=VARCHAR},
      </if>
      <if test="record.counterPrice != null">
        counter_price = #{record.counterPrice,jdbcType=DECIMAL},
      </if>
      <if test="record.retailPrice != null">
        retail_price = #{record.retailPrice,jdbcType=DECIMAL},
      </if>
      <if test="record.addTime != null">
        add_time = #{record.addTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.deleted != null">
        deleted = #{record.deleted,jdbcType=BIT},
      </if>
      <if test="record.version != null">
        version = #{record.version,jdbcType=INTEGER},
      </if>
      <if test="record.detail != null">
        detail = #{record.detail,jdbcType=LONGVARCHAR},
      </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.
    -->
    update litemall_goods
    set id = #{record.id,jdbcType=INTEGER},
      goods_sn = #{record.goodsSn,jdbcType=VARCHAR},
      `name` = #{record.name,jdbcType=VARCHAR},
      category_id = #{record.categoryId,jdbcType=INTEGER},
      brand_id = #{record.brandId,jdbcType=INTEGER},
      gallery = #{record.gallery,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler},
      keywords = #{record.keywords,jdbcType=VARCHAR},
      brief = #{record.brief,jdbcType=VARCHAR},
      is_on_sale = #{record.isOnSale,jdbcType=BIT},
      sort_order = #{record.sortOrder,jdbcType=SMALLINT},
      pic_url = #{record.picUrl,jdbcType=VARCHAR},
      share_url = #{record.shareUrl,jdbcType=VARCHAR},
      is_new = #{record.isNew,jdbcType=BIT},
      is_hot = #{record.isHot,jdbcType=BIT},
      unit = #{record.unit,jdbcType=VARCHAR},
      counter_price = #{record.counterPrice,jdbcType=DECIMAL},
      retail_price = #{record.retailPrice,jdbcType=DECIMAL},
      add_time = #{record.addTime,jdbcType=TIMESTAMP},
      deleted = #{record.deleted,jdbcType=BIT},
      version = #{record.version,jdbcType=INTEGER},
      detail = #{record.detail,jdbcType=LONGVARCHAR}
    <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.
    -->
    update litemall_goods
    set id = #{record.id,jdbcType=INTEGER},
      goods_sn = #{record.goodsSn,jdbcType=VARCHAR},
      `name` = #{record.name,jdbcType=VARCHAR},
      category_id = #{record.categoryId,jdbcType=INTEGER},
      brand_id = #{record.brandId,jdbcType=INTEGER},
      gallery = #{record.gallery,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler},
      keywords = #{record.keywords,jdbcType=VARCHAR},
      brief = #{record.brief,jdbcType=VARCHAR},
      is_on_sale = #{record.isOnSale,jdbcType=BIT},
      sort_order = #{record.sortOrder,jdbcType=SMALLINT},
      pic_url = #{record.picUrl,jdbcType=VARCHAR},
      share_url = #{record.shareUrl,jdbcType=VARCHAR},
      is_new = #{record.isNew,jdbcType=BIT},
      is_hot = #{record.isHot,jdbcType=BIT},
      unit = #{record.unit,jdbcType=VARCHAR},
      counter_price = #{record.counterPrice,jdbcType=DECIMAL},
      retail_price = #{record.retailPrice,jdbcType=DECIMAL},
      add_time = #{record.addTime,jdbcType=TIMESTAMP},
      deleted = #{record.deleted,jdbcType=BIT},
      version = #{record.version,jdbcType=INTEGER}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="org.linlinjava.litemall.db.domain.LitemallGoods">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update litemall_goods
    <set>
      <if test="goodsSn != null">
        goods_sn = #{goodsSn,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        `name` = #{name,jdbcType=VARCHAR},
      </if>
      <if test="categoryId != null">
        category_id = #{categoryId,jdbcType=INTEGER},
      </if>
      <if test="brandId != null">
        brand_id = #{brandId,jdbcType=INTEGER},
      </if>
      <if test="gallery != null">
        gallery = #{gallery,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler},
      </if>
      <if test="keywords != null">
        keywords = #{keywords,jdbcType=VARCHAR},
      </if>
      <if test="brief != null">
        brief = #{brief,jdbcType=VARCHAR},
      </if>
      <if test="isOnSale != null">
        is_on_sale = #{isOnSale,jdbcType=BIT},
      </if>
      <if test="sortOrder != null">
        sort_order = #{sortOrder,jdbcType=SMALLINT},
      </if>
      <if test="picUrl != null">
        pic_url = #{picUrl,jdbcType=VARCHAR},
      </if>
      <if test="shareUrl != null">
        share_url = #{shareUrl,jdbcType=VARCHAR},
      </if>
      <if test="isNew != null">
        is_new = #{isNew,jdbcType=BIT},
      </if>
      <if test="isHot != null">
        is_hot = #{isHot,jdbcType=BIT},
      </if>
      <if test="unit != null">
        unit = #{unit,jdbcType=VARCHAR},
      </if>
      <if test="counterPrice != null">
        counter_price = #{counterPrice,jdbcType=DECIMAL},
      </if>
      <if test="retailPrice != null">
        retail_price = #{retailPrice,jdbcType=DECIMAL},
      </if>
      <if test="addTime != null">
        add_time = #{addTime,jdbcType=TIMESTAMP},
      </if>
      <if test="deleted != null">
        deleted = #{deleted,jdbcType=BIT},
      </if>
      <if test="version != null">
        version = #{version,jdbcType=INTEGER},
      </if>
      <if test="detail != null">
        detail = #{detail,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="org.linlinjava.litemall.db.domain.LitemallGoods">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update litemall_goods
    set goods_sn = #{goodsSn,jdbcType=VARCHAR},
      `name` = #{name,jdbcType=VARCHAR},
      category_id = #{categoryId,jdbcType=INTEGER},
      brand_id = #{brandId,jdbcType=INTEGER},
      gallery = #{gallery,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler},
      keywords = #{keywords,jdbcType=VARCHAR},
      brief = #{brief,jdbcType=VARCHAR},
      is_on_sale = #{isOnSale,jdbcType=BIT},
      sort_order = #{sortOrder,jdbcType=SMALLINT},
      pic_url = #{picUrl,jdbcType=VARCHAR},
      share_url = #{shareUrl,jdbcType=VARCHAR},
      is_new = #{isNew,jdbcType=BIT},
      is_hot = #{isHot,jdbcType=BIT},
      unit = #{unit,jdbcType=VARCHAR},
      counter_price = #{counterPrice,jdbcType=DECIMAL},
      retail_price = #{retailPrice,jdbcType=DECIMAL},
      add_time = #{addTime,jdbcType=TIMESTAMP},
      deleted = #{deleted,jdbcType=BIT},
      version = #{version,jdbcType=INTEGER},
      detail = #{detail,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="org.linlinjava.litemall.db.domain.LitemallGoods">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update litemall_goods
    set goods_sn = #{goodsSn,jdbcType=VARCHAR},
      `name` = #{name,jdbcType=VARCHAR},
      category_id = #{categoryId,jdbcType=INTEGER},
      brand_id = #{brandId,jdbcType=INTEGER},
      gallery = #{gallery,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler},
      keywords = #{keywords,jdbcType=VARCHAR},
      brief = #{brief,jdbcType=VARCHAR},
      is_on_sale = #{isOnSale,jdbcType=BIT},
      sort_order = #{sortOrder,jdbcType=SMALLINT},
      pic_url = #{picUrl,jdbcType=VARCHAR},
      share_url = #{shareUrl,jdbcType=VARCHAR},
      is_new = #{isNew,jdbcType=BIT},
      is_hot = #{isHot,jdbcType=BIT},
      unit = #{unit,jdbcType=VARCHAR},
      counter_price = #{counterPrice,jdbcType=DECIMAL},
      retail_price = #{retailPrice,jdbcType=DECIMAL},
      add_time = #{addTime,jdbcType=TIMESTAMP},
      deleted = #{deleted,jdbcType=BIT},
      version = #{version,jdbcType=INTEGER}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <select id="selectOneByExample" parameterType="org.linlinjava.litemall.db.domain.LitemallGoodsExample" 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_goods
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    limit 1
  </select>
  <select id="selectOneByExampleWithBLOBs" parameterType="org.linlinjava.litemall.db.domain.LitemallGoodsExample" resultMap="ResultMapWithBLOBs">
    <!--
      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" />
    ,
    <include refid="Blob_Column_List" />
    from litemall_goods
    <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="ResultMapWithBLOBs">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    select
    <choose>
      <when test="selective != null and selective.length &gt; 0">
        <foreach collection="selective" item="column" separator=",">
          ${column.escapedColumnName}
        </foreach>
      </when>
      <otherwise>
        id, goods_sn, `name`, category_id, brand_id, gallery, keywords, brief, is_on_sale, 
          sort_order, pic_url, share_url, is_new, is_hot, unit, counter_price, retail_price, 
          add_time, deleted, version, detail
      </otherwise>
    </choose>
    from litemall_goods
    <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>
  <update id="logicalDeleteByExample" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    update litemall_goods set deleted = 1
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="logicalDeleteByPrimaryKey" parameterType="java.lang.Integer">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    update litemall_goods set deleted = 1
    where id = #{id,jdbcType=INTEGER}
  </update>
  <delete id="deleteWithVersionByPrimaryKey" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    delete from litemall_goods
    where version = #{version,jdbcType=INTEGER}
      and id = #{key,jdbcType=INTEGER}
  </delete>
  <delete id="deleteWithVersionByExample" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    delete from litemall_goods
    <if test="_parameter != null">
      <include refid="Update_By_Example_With_Version_Where_Clause" />
    </if>
  </delete>
  <update id="updateWithVersionByExample" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    update litemall_goods
    set version = version + 1,
    id = #{record.id,jdbcType=INTEGER}, 
    goods_sn = #{record.goodsSn,jdbcType=VARCHAR}, 
    `name` = #{record.name,jdbcType=VARCHAR}, 
    category_id = #{record.categoryId,jdbcType=INTEGER}, 
    brand_id = #{record.brandId,jdbcType=INTEGER}, 
    gallery = #{record.gallery,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler}, 
    keywords = #{record.keywords,jdbcType=VARCHAR}, 
    brief = #{record.brief,jdbcType=VARCHAR}, 
    is_on_sale = #{record.isOnSale,jdbcType=BIT}, 
    sort_order = #{record.sortOrder,jdbcType=SMALLINT}, 
    pic_url = #{record.picUrl,jdbcType=VARCHAR}, 
    share_url = #{record.shareUrl,jdbcType=VARCHAR}, 
    is_new = #{record.isNew,jdbcType=BIT}, 
    is_hot = #{record.isHot,jdbcType=BIT}, 
    unit = #{record.unit,jdbcType=VARCHAR}, 
    counter_price = #{record.counterPrice,jdbcType=DECIMAL}, 
    retail_price = #{record.retailPrice,jdbcType=DECIMAL}, 
    add_time = #{record.addTime,jdbcType=TIMESTAMP}, 
    deleted = #{record.deleted,jdbcType=BIT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_With_Version_Where_Clause" />
    </if>
  </update>
  <update id="updateWithVersionByExampleSelective" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    update litemall_goods
    <set>
      <trim suffixOverrides=",">
        version = version + 1,
        <if test="record.id != null">
          id = #{record.id,jdbcType=INTEGER},
        </if>
        <if test="record.goodsSn != null">
          goods_sn = #{record.goodsSn,jdbcType=VARCHAR},
        </if>
        <if test="record.name != null">
          `name` = #{record.name,jdbcType=VARCHAR},
        </if>
        <if test="record.categoryId != null">
          category_id = #{record.categoryId,jdbcType=INTEGER},
        </if>
        <if test="record.brandId != null">
          brand_id = #{record.brandId,jdbcType=INTEGER},
        </if>
        <if test="record.gallery != null">
          gallery = #{record.gallery,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler},
        </if>
        <if test="record.keywords != null">
          keywords = #{record.keywords,jdbcType=VARCHAR},
        </if>
        <if test="record.brief != null">
          brief = #{record.brief,jdbcType=VARCHAR},
        </if>
        <if test="record.isOnSale != null">
          is_on_sale = #{record.isOnSale,jdbcType=BIT},
        </if>
        <if test="record.sortOrder != null">
          sort_order = #{record.sortOrder,jdbcType=SMALLINT},
        </if>
        <if test="record.picUrl != null">
          pic_url = #{record.picUrl,jdbcType=VARCHAR},
        </if>
        <if test="record.shareUrl != null">
          share_url = #{record.shareUrl,jdbcType=VARCHAR},
        </if>
        <if test="record.isNew != null">
          is_new = #{record.isNew,jdbcType=BIT},
        </if>
        <if test="record.isHot != null">
          is_hot = #{record.isHot,jdbcType=BIT},
        </if>
        <if test="record.unit != null">
          unit = #{record.unit,jdbcType=VARCHAR},
        </if>
        <if test="record.counterPrice != null">
          counter_price = #{record.counterPrice,jdbcType=DECIMAL},
        </if>
        <if test="record.retailPrice != null">
          retail_price = #{record.retailPrice,jdbcType=DECIMAL},
        </if>
        <if test="record.addTime != null">
          add_time = #{record.addTime,jdbcType=TIMESTAMP},
        </if>
        <if test="record.deleted != null">
          deleted = #{record.deleted,jdbcType=BIT},
        </if>
        <if test="record.detail != null">
          detail = #{record.detail,jdbcType=LONGVARCHAR},
        </if>
      </trim>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_With_Version_Where_Clause" />
    </if>
  </update>
  <update id="updateWithVersionByExampleWithBLOBs" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    update litemall_goods
    set version = version + 1,
    id = #{record.id,jdbcType=INTEGER}, 
    goods_sn = #{record.goodsSn,jdbcType=VARCHAR}, 
    `name` = #{record.name,jdbcType=VARCHAR}, 
    category_id = #{record.categoryId,jdbcType=INTEGER}, 
    brand_id = #{record.brandId,jdbcType=INTEGER}, 
    gallery = #{record.gallery,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler}, 
    keywords = #{record.keywords,jdbcType=VARCHAR}, 
    brief = #{record.brief,jdbcType=VARCHAR}, 
    is_on_sale = #{record.isOnSale,jdbcType=BIT}, 
    sort_order = #{record.sortOrder,jdbcType=SMALLINT}, 
    pic_url = #{record.picUrl,jdbcType=VARCHAR}, 
    share_url = #{record.shareUrl,jdbcType=VARCHAR}, 
    is_new = #{record.isNew,jdbcType=BIT}, 
    is_hot = #{record.isHot,jdbcType=BIT}, 
    unit = #{record.unit,jdbcType=VARCHAR}, 
    counter_price = #{record.counterPrice,jdbcType=DECIMAL}, 
    retail_price = #{record.retailPrice,jdbcType=DECIMAL}, 
    add_time = #{record.addTime,jdbcType=TIMESTAMP}, 
    deleted = #{record.deleted,jdbcType=BIT}, 
    detail = #{record.detail,jdbcType=LONGVARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_With_Version_Where_Clause" />
    </if>
  </update>
  <update id="updateWithVersionByPrimaryKey" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    update litemall_goods
    set version = version + 1,
    goods_sn = #{record.goodsSn,jdbcType=VARCHAR}, 
    `name` = #{record.name,jdbcType=VARCHAR}, 
    category_id = #{record.categoryId,jdbcType=INTEGER}, 
    brand_id = #{record.brandId,jdbcType=INTEGER}, 
    gallery = #{record.gallery,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler}, 
    keywords = #{record.keywords,jdbcType=VARCHAR}, 
    brief = #{record.brief,jdbcType=VARCHAR}, 
    is_on_sale = #{record.isOnSale,jdbcType=BIT}, 
    sort_order = #{record.sortOrder,jdbcType=SMALLINT}, 
    pic_url = #{record.picUrl,jdbcType=VARCHAR}, 
    share_url = #{record.shareUrl,jdbcType=VARCHAR}, 
    is_new = #{record.isNew,jdbcType=BIT}, 
    is_hot = #{record.isHot,jdbcType=BIT}, 
    unit = #{record.unit,jdbcType=VARCHAR}, 
    counter_price = #{record.counterPrice,jdbcType=DECIMAL}, 
    retail_price = #{record.retailPrice,jdbcType=DECIMAL}, 
    add_time = #{record.addTime,jdbcType=TIMESTAMP}, 
    deleted = #{record.deleted,jdbcType=BIT}
    where version = #{version,jdbcType=INTEGER}
      and id = #{record.id,jdbcType=INTEGER}
  </update>
  <update id="updateWithVersionByPrimaryKeySelective" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    update litemall_goods
    <set>
      <trim suffixOverrides=",">
        version = version + 1,
        <if test="record.goodsSn != null">
          goods_sn = #{record.goodsSn,jdbcType=VARCHAR},
        </if>
        <if test="record.name != null">
          `name` = #{record.name,jdbcType=VARCHAR},
        </if>
        <if test="record.categoryId != null">
          category_id = #{record.categoryId,jdbcType=INTEGER},
        </if>
        <if test="record.brandId != null">
          brand_id = #{record.brandId,jdbcType=INTEGER},
        </if>
        <if test="record.gallery != null">
          gallery = #{record.gallery,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler},
        </if>
        <if test="record.keywords != null">
          keywords = #{record.keywords,jdbcType=VARCHAR},
        </if>
        <if test="record.brief != null">
          brief = #{record.brief,jdbcType=VARCHAR},
        </if>
        <if test="record.isOnSale != null">
          is_on_sale = #{record.isOnSale,jdbcType=BIT},
        </if>
        <if test="record.sortOrder != null">
          sort_order = #{record.sortOrder,jdbcType=SMALLINT},
        </if>
        <if test="record.picUrl != null">
          pic_url = #{record.picUrl,jdbcType=VARCHAR},
        </if>
        <if test="record.shareUrl != null">
          share_url = #{record.shareUrl,jdbcType=VARCHAR},
        </if>
        <if test="record.isNew != null">
          is_new = #{record.isNew,jdbcType=BIT},
        </if>
        <if test="record.isHot != null">
          is_hot = #{record.isHot,jdbcType=BIT},
        </if>
        <if test="record.unit != null">
          unit = #{record.unit,jdbcType=VARCHAR},
        </if>
        <if test="record.counterPrice != null">
          counter_price = #{record.counterPrice,jdbcType=DECIMAL},
        </if>
        <if test="record.retailPrice != null">
          retail_price = #{record.retailPrice,jdbcType=DECIMAL},
        </if>
        <if test="record.addTime != null">
          add_time = #{record.addTime,jdbcType=TIMESTAMP},
        </if>
        <if test="record.deleted != null">
          deleted = #{record.deleted,jdbcType=BIT},
        </if>
        <if test="record.detail != null">
          detail = #{record.detail,jdbcType=LONGVARCHAR},
        </if>
      </trim>
    </set>
    where version = #{version,jdbcType=INTEGER}
      and id = #{record.id,jdbcType=INTEGER}
  </update>
  <update id="updateWithVersionByPrimaryKeyWithBLOBs" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      @project https://github.com/itfsw/mybatis-generator-plugin
    -->
    update litemall_goods
    set version = version + 1,
    goods_sn = #{record.goodsSn,jdbcType=VARCHAR}, 
    `name` = #{record.name,jdbcType=VARCHAR}, 
    category_id = #{record.categoryId,jdbcType=INTEGER}, 
    brand_id = #{record.brandId,jdbcType=INTEGER}, 
    gallery = #{record.gallery,jdbcType=VARCHAR,typeHandler=org.linlinjava.litemall.db.mybatis.JsonStringArrayTypeHandler}, 
    keywords = #{record.keywords,jdbcType=VARCHAR}, 
    brief = #{record.brief,jdbcType=VARCHAR}, 
    is_on_sale = #{record.isOnSale,jdbcType=BIT}, 
    sort_order = #{record.sortOrder,jdbcType=SMALLINT}, 
    pic_url = #{record.picUrl,jdbcType=VARCHAR}, 
    share_url = #{record.shareUrl,jdbcType=VARCHAR}, 
    is_new = #{record.isNew,jdbcType=BIT}, 
    is_hot = #{record.isHot,jdbcType=BIT}, 
    unit = #{record.unit,jdbcType=VARCHAR}, 
    counter_price = #{record.counterPrice,jdbcType=DECIMAL}, 
    retail_price = #{record.retailPrice,jdbcType=DECIMAL}, 
    add_time = #{record.addTime,jdbcType=TIMESTAMP}, 
    deleted = #{record.deleted,jdbcType=BIT}, 
    detail = #{record.detail,jdbcType=LONGVARCHAR}
    where version = #{version,jdbcType=INTEGER}
      and id = #{record.id,jdbcType=INTEGER}
  </update>
</mapper>