updateProductSknStatus.md 2.58 KB

批量审核productskn

接口名: /product/updateProductSknStatus

方法

POST JSONRAW

入参


属性名称 类型 例子 说明 是否必填 长度限制
productSknList 字符串json 商品skn Y
targetStatus number 3驳回,4通过 Y 1
rejectReason 字符串 驳回原因 N 500

对应SQL的操作库表

   <select id="selectByPrimaryKeyList" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from product
    where product_skn  in
    <foreach collection="sknList" item="item" index="index" separator="," open="(" close=")">
        #{item}
    </foreach>
  </select>


  <update id="updateBatchSknStatus">
        update product
        <trim prefix="set" suffixOverrides=",">
           <trim prefix="status =case" suffix="end,">
               <foreach collection="sknStatusList" item="item" index="index">
                    when product_skn=#{item.productSkn,jdbcType=INTEGER} then #{item.targetStauts,jdbcType=SMALLINT}
               </foreach>
            </trim>
            <trim prefix="edit_time =case" suffix="end,">
               <foreach collection="sknStatusList" item="item" index="index">
                    when product_skn=#{item.productSkn,jdbcType=INTEGER} then #{editTime,jdbcType=INTEGER}
               </foreach>
            </trim>
            <trim prefix="first_shelve_time =case" suffix="end,">
               <foreach collection="sknStatusList" item="item" index="index">
                   <if test="firstShelveTime!=null">
                        when product_skn=#{item.productSkn,jdbcType=INTEGER} then #{firstShelveTime,jdbcType=INTEGER}
                   </if>
               </foreach>
            </trim>
            <trim prefix="shelve_time =case" suffix="end,">
               <foreach collection="sknStatusList" item="item" index="index">
                    <if test="shelveTime != null" >
                        when product_skn=#{item.productSkn,jdbcType=INTEGER} then #{shelveTime,jdbcType=INTEGER}
                    </if>
               </foreach>
            </trim>
        </trim>
         where
        <foreach collection="sknStatusList" separator="or" item="item" index="index" >
            product_skn= #{item.productSkn,jdbcType=INTEGER}
        </foreach>
  </update>

错误编码


错误码code 消息 说明
200 添加成功!
400 操作失败!

返回

{
  "code": 200,
  "data": [],
  "md5": "d751713988987e9331980363e24189ce",
  "message": "update status success."
}