queryTabProductNum.md 4.8 KB

获取每个Tab页商品数量

接口名: /product/queryTabProductNum

方法

POST JSONRAW

入参


属性名称 类型 例子 说明 是否必填 长度限制
productSkn number 商品skn N 10
productSkc number 商品skc N 10
productSku number 商品sku N 10
productName 字符串 名称 N 100
shopId number 店铺Id N 5
brandId number 品牌Id N 5
isJit 枚举型(字符串) 是否jit商品"Y" 或者 "N" N 1
stock 枚举型(数字型) 是否有库存0 或者 1 N 11
isScreen 枚举型 是否拍摄状态"Y" 或者 "N" N 1
isMeasure 枚举型 是否测量状态"Y" 或者 "N" N 1
gender 枚举型 性别1男2女 3通用 N 1
maxSortId 数字型 一级分类Id N 5
middleSortId 数字型 二级分类Id N 5
smallSortId 数字型 三级分类Id N 5
isOutLets 枚举型 是否奥莱"Y" 或者 "N" "B" N 1

对应SQL的操作库表

  <select id="selectSknListByReqCount" resultType="java.lang.Integer" parameterType="com.yohobuy.platform.dal.product.model.BaseProductEx">
    select   count(0) from product where 1 = 1
      <if test="baseProduct.productSkn != null" >
        And product_skn = #{baseProduct.productSkn, jdbcType=INTEGER}
      </if>
      <if test="baseProduct.productName != null" >
        And product_name like concat('%', #{baseProduct.productName, jdbcType=VARCHAR}, '%')
      </if>
      <if test="baseProduct.brandId != null" >
        And brand_id = #{baseProduct.brandId, jdbcType=SMALLINT}
      </if>
      <if test="baseProduct.isScreen != null" >
        And is_screen = #{baseProduct.isScreen, jdbcType=CHAR}
      </if>
      <if test="baseProduct.isMeasure != null" >
        And is_measure = #{baseProduct.isMeasure, jdbcType=CHAR}
      </if>
      <if test="baseProduct.supplierId != null" >
        And supplier_id = #{baseProduct.supplierId, jdbcType=INTEGER}
      </if>
      <if test="baseProduct.isJit != null" >
        And is_jit = #{baseProduct.isJit, jdbcType=CHAR}
      </if>
      <if test="baseProduct.maxSortId != null" >
        And max_sort_id = #{baseProduct.maxSortId, jdbcType=SMALLINT}
      </if>
      <if test="baseProduct.middleSortId != null" >
        And middle_sort_id = #{baseProduct.middleSortId, jdbcType=SMALLINT}
      </if>
      <if test="baseProduct.smallSortId != null" >
        And small_sort_id = #{baseProduct.smallSortId, jdbcType=SMALLINT}
      </if>
       <if test="baseProduct.isOutLets != null" >
        And is_outlets = #{baseProduct.isOutLets, jdbcType=CHAR}
      </if>
      <if test="baseProduct.isAdvance != null" >
        And is_advance = #{baseProduct.isAdvance, jdbcType=CHAR}
      </if>
      <if test="baseProduct.gender != null" >
       And gender = #{baseProduct.gender, jdbcType=CHAR}
      </if>
      <if test="baseProduct.isInfoMiss != null" >
       And is_info_miss = #{baseProduct.isInfoMiss, jdbcType=CHAR}
      </if>
      <if test="baseProduct.stock != null" >
        <if test="baseProduct.stock == 1" >
            And stock >= #{baseProduct.stock, jdbcType=SMALLINT}
        </if>
        <if test="baseProduct.stock == 0" >
            And (stock = 0 OR stock is null)
        </if>
      </if>
      <if test="baseProduct.isAuditing != null" >
        <if test="baseProduct.isAuditing == 200" >
             And is_auditing = 200
        </if>
        <if test="baseProduct.isAuditing != 200" >
            And is_auditing in(100, 300)
        </if>
      </if>
      <if test="baseProduct.status != null" >
        <if test="baseProduct.status == 1" >
             And status = 1
        </if>
        <if test="baseProduct.status != 1" >
            And status != 1
        </if>
      </if>
      <if test="baseProduct.productStatusList != null" >
         AND status in
         <foreach collection="baseProduct.productStatusList" item="item" index="index" separator="," open="(" close=")">
            #{item}
        </foreach>
      </if>
      <if test="baseProduct.onlyShowSknList != null" >
         AND (product_skn in
         <foreach collection="baseProduct.onlyShowSknList" item="item" index="index" separator="," open="(" close=")">
            #{item, jdbcType=INTEGER}
        </foreach> OR shop_id = #{baseProduct.shopId, jdbcType=SMALLINT} )
      </if>
      <if test="baseProduct.onlyShowSknList == null" >
         <if test="baseProduct.shopId != null" >
            And shop_id = #{baseProduct.shopId, jdbcType=SMALLINT}
          </if>
      </if>
  </select>

错误编码


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

返回

{
  "code": 200,
  "data": {
    "1": 2,
    "2": 3,
    "3": 0
  },
  "md5": "7a00abc3b20f0fcef16a085a753892e4",
  "message": "num"
}