saveSearchSort.md 2.29 KB

单独排序信息

接口名: /product/saveSearchSort

方法

POST JSONRAW

入参


属性名称 类型 例子 说明 是否必填 长度限制
searchSortList json字符串 productSkn必填 id 当此为修改的封面则必填否则认为为新增 modelId 品牌排序填“1”,奥莱排序填“2,”,搜索排序填“3”) projectId 填写1 必填 100

对应SQL的操作库表

  <insert id="insertBatch" parameterType="java.util.List">
    insert into product_search (product_skn, model_id, 
      project_id, int_value, string_value,  create_time, product_id)
    values 
     <foreach collection="productSearchList" item="item" index="index" separator="," >  
        (#{item.productSkn},#{item.modelId},#{item.projectId},#{item.intValue},#{item.stringValue},#{item.createTime}, #{item.productId})  
    </foreach>
  </insert>

  <update id="updateBatch" parameterType="java.util.List">
        update product_search
        <trim prefix="set" suffixOverrides=",">
            <trim prefix="int_value =case" suffix="end,">
               <foreach collection="productSearchList" item="item" index="index">
                       <if test="item.intValue!=null">
                        when id=#{item.id,jdbcType=INTEGER} then #{item.intValue,jdbcType=INTEGER}
                       </if>
               </foreach>
            </trim>
            <trim prefix="string_value =case" suffix="end,">
               <foreach collection="productSearchList" item="item" index="index">
                       <if test="item.stringValue!=null">
                        when id=#{item.id,jdbcType=INTEGER} then #{item.stringValue,jdbcType=VARCHAR}
                       </if>
               </foreach>
            </trim>
         </trim>
            where
          <foreach collection="productSearchList" separator="or" item="item" index="index" >
            id= #{item.id,jdbcType=INTEGER}
        </foreach>

  </update>

错误编码


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

返回

{
  "code": 200,
  "data": [],
  "md5": "d751713988987e9331980363e24189ce",
  "message": "保存排序信息成功"
}