update.md 1.8 KB

更新品牌款型系列接口

接口名: /brandSeries/update

入参


属性名称 类型 例子 说明 是否必填
id int 15 ID
seriesName string 羽绒服系列 名称
shopsId int 1 店铺id
brandId int 1 店铺id下的某个品牌id
type int 1 1:"品牌款型";2:"品牌系列"
orderBy int 1 排序值

返回

{
  "code": 200,--若失败为500
  "data": [],
  "md5": "d751713988987e9331980363e24189ce",
  "message": "success"
}

对应SQL的操作库表

 update brand_series
    <set >
      <if test="shopsId != null" >
        shops_id = #{shopsId,jdbcType=INTEGER},
      </if>
      <if test="brandId != null" >
        brand_id = #{brandId,jdbcType=INTEGER},
      </if>
      <if test="seriesName != null" >
        series_name = #{seriesName,jdbcType=VARCHAR},
      </if>
      <if test="parentId != null" >
        parent_id = #{parentId,jdbcType=INTEGER},
      </if>
      <if test="orderBy != null" >
        order_by = #{orderBy,jdbcType=SMALLINT},
      </if>
      <if test="status != null" >
        status = #{status,jdbcType=TINYINT},
      </if>

      <if test="bannarImg != null" >
        bannar_img = #{bannarImg,jdbcType=VARCHAR},
      </if>
      update_time = #{updateTime,jdbcType=INTEGER}
    </set>
    where id = #{id,jdbcType=INTEGER}

eg:

 update brand_series
    set 
        shops_id = 1,
        brand_id = 2,
        series_name = 'test-name',
        parent_id =0,
        order_by = 3,
        status = 1,
        bannar_img = '',

      update_time = unix_timestamp

    where id = 1