updateLimitProduct.md 3.66 KB

修改限定商品接口

接口名: /limitProduct/updateLimitProduct

方法

POST JSONRAW

入参


属性名称 类型 例子 说明 是否必填 长度限制
id int 限定商品id 11
productName String 限定商品名称 255
batchNo String 限购码批次号 11
limitProductType String 限定商品活动类型: 分享得限购码:1 排队得限购码:2
activityId int 排队关联的活动ID 11
saleTimeStr String 2016-04-21 10:45:00 开售日期 11
dayFlag int 1 是否具体到日期,1:具体到日,0:不具体到日 1
hotFlag int 1 是否热门商品,0:非热门 1:热门 1
orderBy int 1 限定商品的排序 1
showFlag int 1 是否前台展示状态,0:不展示 1:展示 1
attachmentContent String 附件信息字符串 1

对应SQL的操作库表

<update id="updateLimitProduct" parameterType="com.yohobuy.platform.dal.product.model.LimitProduct">
    update limit_product
    <set >
      <if test="limitProductCode != null" >
        productCode = #{limitProductCode,jdbcType=VARCHAR},
      </if>
      <if test="productName != null" >
        productName = #{productName,jdbcType=VARCHAR},
      </if>
      <if test="price != null" >
        price = #{price,jdbcType=VARCHAR},
      </if>
      <if test="batchNo != null" >
        batchno = #{batchNo,jdbcType=VARCHAR},
      </if>
      <if test="limitProductType != null" >
        limit_product_type = #{limitProductType,jdbcType=INTEGER},
      </if>
      <if test="activityId != null" >
        activity_id = #{activityId,jdbcType=INTEGER},
      </if>
      <if test="productSkn != null" >
        productSkn = #{productSkn,jdbcType=INTEGER},
      </if>
      <if test="saleTime != null" >
        sale_time = #{saleTime,jdbcType=INTEGER},
      </if>
      <if test="saleTimeStr != null" >
        sale_time_str = #{saleTimeStr,jdbcType=VARCHAR},
      </if>
      <if test="dayFlag != null" >
        day_flag = #{dayFlag,jdbcType=INTEGER},
      </if>
      <if test="hotFlag != null" >
         hotFlag = #{hotFlag,jdbcType=INTEGER},
      </if>
      <if test="orderBy != null" >
         order_by = #{orderBy,jdbcType=INTEGER},
      </if>
      <if test="showFlag != null" >
         showFlag = #{showFlag,jdbcType=INTEGER},
      </if>
      <if test="creatorId != null" >
        creator_id = #{creatorId,jdbcType=INTEGER},
      </if>
      <if test="creatorName != null" >
        creator_name = #{creatorName,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null" >
        create_time = #{createTime,jdbcType=INTEGER},
      </if>
      <if test="lastUpdateTime != null" >
        update_time = #{lastUpdateTime,jdbcType=INTEGER},
      </if>
      <if test="status != null" >
        status = #{status,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
<delete id="deleteLimitProductAttach" >
    delete from limit_product_attach
      where product_id = #{productId,jdbcType=INTEGER}
  </delete>
<insert id="addLimitProductAttach" parameterType="java.util.List">
    insert into limit_product_attach ( product_id, attach_type, is_default,
    attach_name, attach_url, order_by, intro,
    status ) values
    <foreach collection="list" item="item" index="index"
        separator=",">
        ( #{item.productId}, #{item.attachType}, #{item.isDefault},
        #{item.attachName}, #{item.attachUrl},
        #{item.orderBy}, #{item.intro},
        #{item.status} )
    </foreach>
  </insert>

响应码


响应码code 消息 说明
200 修改成功!
200 修改失败!

返回

{
    "code": 200,
    "data": [],
    "md5": "d751713988987e9331980363e24189ce",
    "message": "修改成功!"
}