addLimitProduct.md 4.66 KB

新增限定商品接口

接口名: /limitProduct/addLimitProduct

方法

POST JSONRAW

入参


属性名称 类型 例子 说明 是否必填 长度限制
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的操作库表

<insert id="addLimitProduct" parameterType="com.yohobuy.platform.dal.product.model.LimitProduct" >
    <selectKey resultType="java.lang.Integer" order="AFTER" keyProperty="id">
      SELECT LAST_INSERT_ID() AS id
    </selectKey>
    insert into limit_product
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="limitProductCode != null" >
        productCode,
      </if>
      <if test="productName != null" >
        productName,
      </if>
      <if test="price != null" >
        price,
      </if>
      <if test="productSkn != null" >
        productSkn,
      </if>
      <if test="batchNo != null" >
        batchno,
      </if>
      <if test="limitProductType != null" >
        limit_product_type,
      </if>
      <if test="activityId != null" >
        activity_id,
      </if>
      <if test="saleTime != null" >
        sale_time,
      </if>
      <if test="saleTimeStr != null" >
        sale_time_str,
      </if>
      <if test="dayFlag != null" >
        day_flag,
      </if>
      <if test="hotFlag != null" >
        hotFlag,
      </if>
      <if test="orderBy != null" >
        order_by,
      </if>
      <if test="showFlag != null" >
        showFlag,
      </if>
      <if test="creatorId != null" >
        creator_id,
      </if>
      <if test="creatorName != null" >
        creator_name,
      </if>
      <if test="createTime != null" >
        create_time,
      </if>
      <if test="lastUpdateTime != null" >
        update_time,
      </if>
      <if test="status != null" >
        status,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="limitProductCode != null" >
        #{limitProductCode,jdbcType=VARCHAR},
      </if>
      <if test="productName != null" >
        #{productName,jdbcType=VARCHAR},
      </if>
      <if test="price != null" >
        #{price,jdbcType=VARCHAR},
      </if>
      <if test="productSkn != null" >
        #{productSkn,jdbcType=INTEGER},
      </if>
      <if test="batchNo != null" >
        #{batchNo,jdbcType=VARCHAR},
      </if>
      <if test="limitProductType != null" >
        #{limitProductType,jdbcType=INTEGER},
      </if>
      <if test="activityId != null" >
        #{activityId,jdbcType=INTEGER},
      </if>
      <if test="saleTime != null" >
        #{saleTime,jdbcType=INTEGER},
      </if>
      <if test="saleTimeStr != null" >
        #{saleTimeStr,jdbcType=VARCHAR},
      </if>
      <if test="dayFlag != null" >
        #{dayFlag,jdbcType=INTEGER},
      </if>
      <if test="hotFlag != null" >
         #{hotFlag,jdbcType=INTEGER},
      </if>
      <if test="orderBy != null" >
         #{orderBy,jdbcType=INTEGER},
      </if>
      <if test="showFlag != null" >
        #{showFlag,jdbcType=INTEGER},
      </if>
      <if test="creatorId != null" >
        #{creatorId,jdbcType=INTEGER},
      </if>
      <if test="creatorName != null" >
        #{creatorName,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null" >
        #{createTime,jdbcType=INTEGER},
      </if>
      <if test="lastUpdateTime != null" >
        #{lastUpdateTime,jdbcType=INTEGER},
      </if>
      <if test="status != null" >
        #{status,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
 <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 保存成功!

返回

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