<?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="com.slodon.b2b2c.dao.write.goods.GoodsWriteMapper">
  <resultMap id="resultMap" type="com.slodon.b2b2c.goods.pojo.Goods">
    <id column="goods_id" property="goodsId" />
    <result column="goods_name" property="goodsName" />
    <result column="goods_brief" property="goodsBrief" />
    <result column="keyword" property="keyword" />
    <result column="brand_id" property="brandId" />
    <result column="brand_name" property="brandName" />
    <result column="category_id1" property="categoryId1" />
    <result column="category_id2" property="categoryId2" />
    <result column="category_id3" property="categoryId3" />
    <result column="category_path" property="categoryPath" />
    <result column="market_price" property="marketPrice" />
    <result column="goods_price" property="goodsPrice" />
    <result column="promotion_price" property="promotionPrice" />
    <result column="promotion_type" property="promotionType" />
    <result column="goods_stock" property="goodsStock" />
    <result column="virtual_sales" property="virtualSales" />
    <result column="actual_sales" property="actualSales" />
    <result column="is_spec" property="isSpec" />
    <result column="main_spec_id" property="mainSpecId" />
    <result column="is_self" property="isSelf" />
    <result column="state" property="state" />
    <result column="is_recommend" property="isRecommend" />
    <result column="online_time" property="onlineTime" />
    <result column="store_id" property="storeId" />
    <result column="store_name" property="storeName" />
    <result column="store_is_recommend" property="storeIsRecommend" />
    <result column="store_state" property="storeState" />
    <result column="comment_number" property="commentNumber" />
    <result column="is_virtual_goods" property="isVirtualGoods" />
    <result column="main_image" property="mainImage" />
    <result column="goods_video" property="goodsVideo" />
    <result column="bar_code" property="barCode" />
    <result column="service_label_ids" property="serviceLabelIds" />
    <result column="is_offline" property="isOffline" />
    <result column="is_delete" property="isDelete" />
    <result column="is_lock" property="isLock" />
    <result column="default_product_id" property="defaultProductId" />
    <result column="is_VAT_invoice" property="isVatInvoice" />
    <result column="create_time" property="createTime" />
    <result column="update_time" property="updateTime" />
  </resultMap>
  <!--除主键外的所有字段，用于插入操作-->
  <sql id="columns">
    <trim suffixOverrides=",">
      <if test="goodsId != null">
        `goods_id`,
      </if>
      <if test="goodsName != null">
        `goods_name`,
      </if>
      <if test="goodsBrief != null">
        `goods_brief`,
      </if>
      <if test="keyword != null">
        `keyword`,
      </if>
      <if test="brandId != null">
        `brand_id`,
      </if>
      <if test="brandName != null">
        `brand_name`,
      </if>
      <if test="categoryId1 != null">
        `category_id1`,
      </if>
      <if test="categoryId2 != null">
        `category_id2`,
      </if>
      <if test="categoryId3 != null">
        `category_id3`,
      </if>
      <if test="categoryPath != null">
        `category_path`,
      </if>
      <if test="marketPrice != null">
        `market_price`,
      </if>
      <if test="goodsPrice != null">
        `goods_price`,
      </if>
      <if test="promotionPrice != null">
        `promotion_price`,
      </if>
      <if test="promotionType != null">
        `promotion_type`,
      </if>
      <if test="goodsStock != null">
        `goods_stock`,
      </if>
      <if test="virtualSales != null">
        `virtual_sales`,
      </if>
      <if test="actualSales != null">
        `actual_sales`,
      </if>
      <if test="isSpec != null">
        `is_spec`,
      </if>
      <if test="mainSpecId != null">
        `main_spec_id`,
      </if>
      <if test="isSelf != null">
        `is_self`,
      </if>
      <if test="state != null">
        `state`,
      </if>
      <if test="isRecommend != null">
        `is_recommend`,
      </if>
      <if test="onlineTime != null">
        `online_time`,
      </if>
      <if test="storeId != null">
        `store_id`,
      </if>
      <if test="storeName != null">
        `store_name`,
      </if>
      <if test="storeIsRecommend != null">
        `store_is_recommend`,
      </if>
      <if test="storeState != null">
        `store_state`,
      </if>
      <if test="commentNumber != null">
        `comment_number`,
      </if>
      <if test="isVirtualGoods != null">
        `is_virtual_goods`,
      </if>
      <if test="mainImage != null">
        `main_image`,
      </if>
      <if test="goodsVideo != null">
        `goods_video`,
      </if>
      <if test="barCode != null">
        `bar_code`,
      </if>
      <if test="serviceLabelIds != null">
        `service_label_ids`,
      </if>
      <if test="isOffline != null">
        `is_offline`,
      </if>
      <if test="isDelete != null">
        `is_delete`,
      </if>
      <if test="isLock != null">
        `is_lock`,
      </if>
      <if test="defaultProductId != null">
        `default_product_id`,
      </if>
      <if test="isVatInvoice != null">
        `is_VAT_invoice`,
      </if>
      <if test="createTime != null">
        `create_time`,
      </if>
      <if test="updateTime != null">
        `update_time`,
      </if>
    </trim>
  </sql>
  <!--按照主键值进行操作-->
  <sql id="pkWhere">
    WHERE `goods_id` = #{primaryKey}
  </sql>
  <!--操作条件-->
  <sql id="whereCondition">
    <if test="example != null">
      <trim prefix="WHERE" prefixOverrides="AND|OR">
        <if test="example.goodsIdNotEquals != null">
          AND `goods_id` != #{example.goodsIdNotEquals}
        </if>
        <if test="example.goodsIdIn != null">
          AND `goods_id` in (${example.goodsIdIn})
        </if>
        <if test="example.goodsName != null">
          AND `goods_name` = #{example.goodsName}
        </if>
        <if test="example.goodsNameLike != null">
          AND `goods_name` like concat('%',#{example.goodsNameLike},'%')
        </if>
        <if test="example.goodsBrief != null">
          AND `goods_brief` = #{example.goodsBrief}
        </if>
        <if test="example.keyword != null">
          AND `keyword` = #{example.keyword}
        </if>
        <if test="example.keywordLike != null">
          AND `keyword` like concat('%',#{example.keywordLike},'%')
        </if>
        <if test="example.brandId != null">
          AND `brand_id` = #{example.brandId}
        </if>
        <if test="example.brandName != null">
          AND `brand_name` = #{example.brandName}
        </if>
        <if test="example.brandNameLike != null">
          AND `brand_name` like concat('%',#{example.brandNameLike},'%')
        </if>
        <if test="example.categoryId1 != null">
          AND `category_id1` = #{example.categoryId1}
        </if>
        <if test="example.categoryId2 != null">
          AND `category_id2` = #{example.categoryId2}
        </if>
        <if test="example.categoryId3 != null">
          AND `category_id3` = #{example.categoryId3}
        </if>
        <if test="example.categoryPath != null">
          AND `category_path` = #{example.categoryPath}
        </if>
        <if test="example.marketPrice != null">
          AND `market_price` = #{example.marketPrice}
        </if>
        <if test="example.goodsPrice != null">
          AND `goods_price` = #{example.goodsPrice}
        </if>
        <if test="example.promotionPrice != null">
          AND `promotion_price` = #{example.promotionPrice}
        </if>
        <if test="example.promotionType != null">
          AND `promotion_type` = #{example.promotionType}
        </if>
        <if test="example.goodsStock != null">
          AND `goods_stock` = #{example.goodsStock}
        </if>
        <if test="example.virtualSales != null">
          AND `virtual_sales` = #{example.virtualSales}
        </if>
        <if test="example.actualSales != null">
          AND `actual_sales` = #{example.actualSales}
        </if>
        <if test="example.isSpec != null">
          AND `is_spec` = #{example.isSpec}
        </if>
        <if test="example.mainSpecId != null">
          AND `main_spec_id` = #{example.mainSpecId}
        </if>
        <if test="example.isSelf != null">
          AND `is_self` = #{example.isSelf}
        </if>
        <if test="example.state != null">
          AND `state` = #{example.state}
        </if>
        <if test="example.stateIn != null">
          AND `state` in (${example.stateIn})
        </if>
        <if test="example.stateNotIn != null">
          AND `state` not in (${example.stateNotIn})
        </if>
        <if test="example.stateNotEquals != null">
          AND `state` != #{example.stateNotEquals}
        </if>
        <if test="example.isRecommend != null">
          AND `is_recommend` = #{example.isRecommend}
        </if>
        <if test="example.onlineTimeAfter != null">
          AND `online_time` <![CDATA[ >= ]]> #{example.onlineTimeAfter}
        </if>
        <if test="example.onlineTimeBefore != null">
          AND `online_time` <![CDATA[ <= ]]> #{example.onlineTimeBefore}
        </if>
        <if test="example.storeId != null">
          AND `store_id` = #{example.storeId}
        </if>
        <if test="example.storeName != null">
          AND `store_name` = #{example.storeName}
        </if>
        <if test="example.storeNameLike != null">
          AND `store_name` like concat('%',#{example.storeNameLike},'%')
        </if>
        <if test="example.storeIsRecommend != null">
          AND `store_is_recommend` = #{example.storeIsRecommend}
        </if>
        <if test="example.storeState != null">
          AND `store_state` = #{example.storeState}
        </if>
        <if test="example.storeStateIn != null">
          AND `store_state` in (${example.storeStateIn})
        </if>
        <if test="example.storeStateNotIn != null">
          AND `store_state` not in (${example.storeStateNotIn})
        </if>
        <if test="example.storeStateNotEquals != null">
          AND `store_state` != #{example.storeStateNotEquals}
        </if>
        <if test="example.commentNumber != null">
          AND `comment_number` = #{example.commentNumber}
        </if>
        <if test="example.isVirtualGoods != null">
          AND `is_virtual_goods` = #{example.isVirtualGoods}
        </if>
        <if test="example.mainImage != null">
          AND `main_image` = #{example.mainImage}
        </if>
        <if test="example.goodsVideo != null">
          AND `goods_video` = #{example.goodsVideo}
        </if>
        <if test="example.barCode != null">
          AND `bar_code` = #{example.barCode}
        </if>
        <if test="example.serviceLabelIds != null">
          AND `service_label_ids` = #{example.serviceLabelIds}
        </if>
        <if test="example.isOffline != null">
          AND `is_offline` = #{example.isOffline}
        </if>
        <if test="example.isDelete != null">
          AND `is_delete` = #{example.isDelete}
        </if>
        <if test="example.isLock != null">
          AND `is_lock` = #{example.isLock}
        </if>
        <if test="example.defaultProductId != null">
          AND `default_product_id` = #{example.defaultProductId}
        </if>
        <if test="example.isVatInvoice != null">
          AND `is_VAT_invoice` = #{example.isVatInvoice}
        </if>
        <if test="example.createTimeAfter != null">
          AND `create_time` <![CDATA[ >= ]]> #{example.createTimeAfter}
        </if>
        <if test="example.createTimeBefore != null">
          AND `create_time` <![CDATA[ <= ]]> #{example.createTimeBefore}
        </if>
        <if test="example.updateTimeAfter != null">
          AND `update_time` <![CDATA[ >= ]]> #{example.updateTimeAfter}
        </if>
        <if test="example.updateTimeBefore != null">
          AND `update_time` <![CDATA[ <= ]]> #{example.updateTimeBefore}
        </if>
      </trim>
    </if>
  </sql>
  <!--排序条件-->
  <sql id="orderBy">
    ORDER BY `goods_id` DESC
  </sql>
  <sql id="orderByOther">
    order by ${example.orderBy}
  </sql>
  <!--分组条件-->
  <sql id="groupBy">
    group by ${example.groupBy}
  </sql>
  <!--分页条件-->
  <sql id="limit">
    <if test="size != null and size &gt; 0">
      limit #{startRow},#{size}
    </if>
  </sql>
  <!--查询符合条件的记录数-->
  <select id="countByExample" parameterType="com.slodon.b2b2c.goods.example.GoodsExample" resultType="java.lang.Integer">
    SELECT
      COUNT(*)
    FROM `goods`
    <include refid="whereCondition" />
  </select>
  <!--根据主键查询记录-->
  <select id="getByPrimaryKey" resultMap="resultMap">
    SELECT
      *
    FROM `goods`
    <include refid="pkWhere" />
  </select>
  <!--查询符合条件的记录(所有字段)-->
  <select id="listByExample" resultMap="resultMap">
    SELECT
      *
    FROM `goods`
    <include refid="whereCondition" />
    <if test="example.groupBy != null">
      <include refid="groupBy" />
    </if>
    <choose>
      <when test="example.orderBy != null">
        <include refid="orderByOther" />
      </when>
      <otherwise>
        <include refid="orderBy" />
      </otherwise>
    </choose>
  </select>
  <!--分页查询符合条件的记录(所有字段)-->
  <select id="listPageByExample" resultMap="resultMap">
    SELECT
      *
    FROM `goods`
    <include refid="whereCondition" />
    <if test="example.groupBy != null">
      <include refid="groupBy" />
    </if>
    <choose>
      <when test="example.orderBy != null">
        <include refid="orderByOther" />
      </when>
      <otherwise>
        <include refid="orderBy" />
      </otherwise>
    </choose>
    <include refid="limit" />
  </select>
  <!--查询符合条件的记录(指定字段)-->
  <select id="listFieldsByExample" resultMap="resultMap">
    SELECT
      ${fields}
    FROM `goods`
    <include refid="whereCondition" />
    <if test="example.groupBy != null">
      <include refid="groupBy" />
    </if>
    <choose>
      <when test="example.orderBy != null">
        <include refid="orderByOther" />
      </when>
      <otherwise>
        <include refid="orderBy" />
      </otherwise>
    </choose>
  </select>
  <!--分页查询符合条件的记录(指定字段)-->
  <select id="listFieldsPageByExample" resultMap="resultMap">
    SELECT
      ${fields}
    FROM `goods`
    <include refid="whereCondition" />
    <if test="example.groupBy != null">
      <include refid="groupBy" />
    </if>
    <choose>
      <when test="example.orderBy != null">
        <include refid="orderByOther" />
      </when>
      <otherwise>
        <include refid="orderBy" />
      </otherwise>
    </choose>
    <include refid="limit" />
  </select>
  <!--根据条件删除记录，可多条删除-->
  <delete id="deleteByExample">
    DELETE FROM `goods`
    <include refid="whereCondition" />
  </delete>
  <!--根据主键删除记录-->
  <delete id="deleteByPrimaryKey">
    DELETE FROM `goods`
    <include refid="pkWhere" />
  </delete>
  <!--插入一条记录-->
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.slodon.b2b2c.goods.pojo.Goods" useGeneratedKeys="true">
    INSERT INTO `goods`(
    <include refid="columns" />
    )
    VALUES(
    <trim suffixOverrides=",">
      <if test="goodsId != null">
        #{goodsId},
      </if>
      <if test="goodsName != null">
        #{goodsName},
      </if>
      <if test="goodsBrief != null">
        #{goodsBrief},
      </if>
      <if test="keyword != null">
        #{keyword},
      </if>
      <if test="brandId != null">
        #{brandId},
      </if>
      <if test="brandName != null">
        #{brandName},
      </if>
      <if test="categoryId1 != null">
        #{categoryId1},
      </if>
      <if test="categoryId2 != null">
        #{categoryId2},
      </if>
      <if test="categoryId3 != null">
        #{categoryId3},
      </if>
      <if test="categoryPath != null">
        #{categoryPath},
      </if>
      <if test="marketPrice != null">
        #{marketPrice},
      </if>
      <if test="goodsPrice != null">
        #{goodsPrice},
      </if>
      <if test="promotionPrice != null">
        #{promotionPrice},
      </if>
      <if test="promotionType != null">
        #{promotionType},
      </if>
      <if test="goodsStock != null">
        #{goodsStock},
      </if>
      <if test="virtualSales != null">
        #{virtualSales},
      </if>
      <if test="actualSales != null">
        #{actualSales},
      </if>
      <if test="isSpec != null">
        #{isSpec},
      </if>
      <if test="mainSpecId != null">
        #{mainSpecId},
      </if>
      <if test="isSelf != null">
        #{isSelf},
      </if>
      <if test="state != null">
        #{state},
      </if>
      <if test="isRecommend != null">
        #{isRecommend},
      </if>
      <if test="onlineTime != null">
        #{onlineTime},
      </if>
      <if test="storeId != null">
        #{storeId},
      </if>
      <if test="storeName != null">
        #{storeName},
      </if>
      <if test="storeIsRecommend != null">
        #{storeIsRecommend},
      </if>
      <if test="storeState != null">
        #{storeState},
      </if>
      <if test="commentNumber != null">
        #{commentNumber},
      </if>
      <if test="isVirtualGoods != null">
        #{isVirtualGoods},
      </if>
      <if test="mainImage != null">
        #{mainImage},
      </if>
      <if test="goodsVideo != null">
        #{goodsVideo},
      </if>
      <if test="barCode != null">
        #{barCode},
      </if>
      <if test="serviceLabelIds != null">
        #{serviceLabelIds},
      </if>
      <if test="isOffline != null">
        #{isOffline},
      </if>
      <if test="isDelete != null">
        #{isDelete},
      </if>
      <if test="isLock != null">
        #{isLock},
      </if>
      <if test="defaultProductId != null">
        #{defaultProductId},
      </if>
      <if test="isVatInvoice != null">
        #{isVatInvoice},
      </if>
      <if test="createTime != null">
        #{createTime},
      </if>
      <if test="updateTime != null">
        #{updateTime},
      </if>
    </trim>
    )
  </insert>
  <!--按条件更新记录中不为空的字段-->
  <update id="updateByExampleSelective">
    UPDATE `goods`
    <trim prefix="SET" suffixOverrides=",">
      <if test="record.goodsName != null">
        `goods_name` = #{record.goodsName},
      </if>
      <if test="record.goodsBrief != null">
        `goods_brief` = #{record.goodsBrief},
      </if>
      <if test="record.keyword != null">
        `keyword` = #{record.keyword},
      </if>
      <if test="record.brandId != null">
        `brand_id` = #{record.brandId},
      </if>
      <if test="record.brandName != null">
        `brand_name` = #{record.brandName},
      </if>
      <if test="record.categoryId1 != null">
        `category_id1` = #{record.categoryId1},
      </if>
      <if test="record.categoryId2 != null">
        `category_id2` = #{record.categoryId2},
      </if>
      <if test="record.categoryId3 != null">
        `category_id3` = #{record.categoryId3},
      </if>
      <if test="record.categoryPath != null">
        `category_path` = #{record.categoryPath},
      </if>
      <if test="record.marketPrice != null">
        `market_price` = #{record.marketPrice},
      </if>
      <if test="record.goodsPrice != null">
        `goods_price` = #{record.goodsPrice},
      </if>
      <if test="record.promotionPrice != null">
        `promotion_price` = #{record.promotionPrice},
      </if>
      <if test="record.promotionType != null">
        `promotion_type` = #{record.promotionType},
      </if>
      <if test="record.goodsStock != null">
        `goods_stock` = #{record.goodsStock},
      </if>
      <if test="record.virtualSales != null">
        `virtual_sales` = #{record.virtualSales},
      </if>
      <if test="record.actualSales != null">
        `actual_sales` = #{record.actualSales},
      </if>
      <if test="record.isSpec != null">
        `is_spec` = #{record.isSpec},
      </if>
      <if test="record.mainSpecId != null">
        `main_spec_id` = #{record.mainSpecId},
      </if>
      <if test="record.isSelf != null">
        `is_self` = #{record.isSelf},
      </if>
      <if test="record.state != null">
        `state` = #{record.state},
      </if>
      <if test="record.isRecommend != null">
        `is_recommend` = #{record.isRecommend},
      </if>
      <if test="record.onlineTime != null">
        `online_time` = #{record.onlineTime},
      </if>
      <if test="record.storeId != null">
        `store_id` = #{record.storeId},
      </if>
      <if test="record.storeName != null">
        `store_name` = #{record.storeName},
      </if>
      <if test="record.storeIsRecommend != null">
        `store_is_recommend` = #{record.storeIsRecommend},
      </if>
      <if test="record.storeState != null">
        `store_state` = #{record.storeState},
      </if>
      <if test="record.commentNumber != null">
        `comment_number` = #{record.commentNumber},
      </if>
      <if test="record.isVirtualGoods != null">
        `is_virtual_goods` = #{record.isVirtualGoods},
      </if>
      <if test="record.mainImage != null">
        `main_image` = #{record.mainImage},
      </if>
      <if test="record.goodsVideo != null">
        `goods_video` = #{record.goodsVideo},
      </if>
      <if test="record.barCode != null">
        `bar_code` = #{record.barCode},
      </if>
      <if test="record.serviceLabelIds != null">
        `service_label_ids` = #{record.serviceLabelIds},
      </if>
      <if test="record.isOffline != null">
        `is_offline` = #{record.isOffline},
      </if>
      <if test="record.isDelete != null">
        `is_delete` = #{record.isDelete},
      </if>
      <if test="record.isLock != null">
        `is_lock` = #{record.isLock},
      </if>
      <if test="record.defaultProductId != null">
        `default_product_id` = #{record.defaultProductId},
      </if>
      <if test="record.isVatInvoice != null">
        `is_VAT_invoice` = #{record.isVatInvoice},
      </if>
      <if test="record.createTime != null">
        `create_time` = #{record.createTime},
      </if>
      <if test="record.updateTime != null">
        `update_time` = #{record.updateTime},
      </if>
    </trim>
    <include refid="whereCondition" />
  </update>
  <!--按照主键更新记录中不为空的字段-->
  <update id="updateByPrimaryKeySelective">
    UPDATE `goods`
    <trim prefix="SET" suffixOverrides=",">
      <if test="goodsName != null">
        `goods_name` = #{goodsName},
      </if>
      <if test="goodsBrief != null">
        `goods_brief` = #{goodsBrief},
      </if>
      <if test="keyword != null">
        `keyword` = #{keyword},
      </if>
      <if test="brandId != null">
        `brand_id` = #{brandId},
      </if>
      <if test="brandName != null">
        `brand_name` = #{brandName},
      </if>
      <if test="categoryId1 != null">
        `category_id1` = #{categoryId1},
      </if>
      <if test="categoryId2 != null">
        `category_id2` = #{categoryId2},
      </if>
      <if test="categoryId3 != null">
        `category_id3` = #{categoryId3},
      </if>
      <if test="categoryPath != null">
        `category_path` = #{categoryPath},
      </if>
      <if test="marketPrice != null">
        `market_price` = #{marketPrice},
      </if>
      <if test="goodsPrice != null">
        `goods_price` = #{goodsPrice},
      </if>
      <if test="promotionPrice != null">
        `promotion_price` = #{promotionPrice},
      </if>
      <if test="promotionType != null">
        `promotion_type` = #{promotionType},
      </if>
      <if test="goodsStock != null">
        `goods_stock` = #{goodsStock},
      </if>
      <if test="virtualSales != null">
        `virtual_sales` = #{virtualSales},
      </if>
      <if test="actualSales != null">
        `actual_sales` = #{actualSales},
      </if>
      <if test="isSpec != null">
        `is_spec` = #{isSpec},
      </if>
      <if test="mainSpecId != null">
        `main_spec_id` = #{mainSpecId},
      </if>
      <if test="isSelf != null">
        `is_self` = #{isSelf},
      </if>
      <if test="state != null">
        `state` = #{state},
      </if>
      <if test="isRecommend != null">
        `is_recommend` = #{isRecommend},
      </if>
      <if test="onlineTime != null">
        `online_time` = #{onlineTime},
      </if>
      <if test="storeId != null">
        `store_id` = #{storeId},
      </if>
      <if test="storeName != null">
        `store_name` = #{storeName},
      </if>
      <if test="storeIsRecommend != null">
        `store_is_recommend` = #{storeIsRecommend},
      </if>
      <if test="storeState != null">
        `store_state` = #{storeState},
      </if>
      <if test="commentNumber != null">
        `comment_number` = #{commentNumber},
      </if>
      <if test="isVirtualGoods != null">
        `is_virtual_goods` = #{isVirtualGoods},
      </if>
      <if test="mainImage != null">
        `main_image` = #{mainImage},
      </if>
      <if test="goodsVideo != null">
        `goods_video` = #{goodsVideo},
      </if>
      <if test="barCode != null">
        `bar_code` = #{barCode},
      </if>
      <if test="serviceLabelIds != null">
        `service_label_ids` = #{serviceLabelIds},
      </if>
      <if test="isOffline != null">
        `is_offline` = #{isOffline},
      </if>
      <if test="isDelete != null">
        `is_delete` = #{isDelete},
      </if>
      <if test="isLock != null">
        `is_lock` = #{isLock},
      </if>
      <if test="defaultProductId != null">
        `default_product_id` = #{defaultProductId},
      </if>
      <if test="isVatInvoice != null">
        `is_VAT_invoice` = #{isVatInvoice},
      </if>
      <if test="createTime != null">
        `create_time` = #{createTime},
      </if>
      <if test="updateTime != null">
        `update_time` = #{updateTime},
      </if>
    </trim>
    WHERE `goods_id` = #{goodsId}
  </update>
</mapper>