getLimitProductList.md 4.04 KB

获取限定商品列表接口

接口名: /limitProduct/getLimitProductList

方法

POST JSONRAW

入参


属性名称 类型 例子 说明 是否必填 长度限制
productName String 活动23451 限定商品名称 255
productSkn String 限定商品SKN 11
showFlag String 0 是否前台展示状态,0:不展示 1:展示 11
hotFlag String 0 是否热门商品,0:非热门 1:热门 11

 <select id="selectLimitProductList" resultMap="BaseResultMap" parameterType="com.yohobuy.platform.model.product.req.LimitProductReq" >
    select 
    <include refid="Base_Column_List" />
    from limit_product p
    where 1=1
    <if test="id != null and id != ''" >
      and p.id = #{id,jdbcType=INTEGER}
    </if>

    <if test="productSkn != null and productSkn != ''" >
      and p.productSkn=#{productSkn,jdbcType=INTEGER}
    </if>

    <if test="productName != null and productName != ''" >
      and p.productName like '%' #{productName,jdbcType=VARCHAR} '%'
    </if>

    <if test="status != null and status != ''" >
      and p.status = #{status,jdbcType=VARCHAR}
    </if>

    <if test="batchNo != null and batchNo != ''" >
      and p.batchno like '%' #{batchNo,jdbcType=VARCHAR} '%'
    </if>

    <if test="hotFlag != null and hotFlag != ''" >
      and p.hotFlag = #{hotFlag,jdbcType=VARCHAR}
    </if>

    <if test="showFlag != null and showFlag != ''" >
      and p.showFlag = #{showFlag,jdbcType=VARCHAR}
    </if>

    <if test="saleFlag != null and saleFlag != '' and saleFlag == 1" >
      and p.sale_time &lt; #{currentTime,jdbcType=INTEGER}
    </if>

    <if test="saleFlag != null and saleFlag != '' and saleFlag == 0" >
      and p.sale_time &gt; #{currentTime,jdbcType=INTEGER}
    </if>

    order by p.create_time desc limit #{offset},#{limit}
  </select>
<select id="selectLimitProductAttachByProductIds" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select
    <include refid="Base_Column_List" />
    from limit_product_attach p
    where 
    <foreach item="item" collection="list" index="index" separator="or" open="(" close=")">
     p.product_id = #{item}
    </foreach>
  </select>

响应码


响应码code 消息 说明
200 获取列表成功

返回

{
    "code": 200,
    "message": "",
    "data": {
        "code": 200,
        "data": {
            "list": [
                {
                    "attachUrl": "http://img10.static.yhbimg.com/goodsimg/2016/04/20/10/01c1d3796667ec0d12080ba1eba717d496.jpg",
                    "dayFlag": 1,
                    "hotFlag": 0,
                    "id": 406,
                    "limitProductCode": "2016042018243782",
                    "notSaleOrderBy": 0,
                    "orderBy": 0,
                    "productName": "限购测试商品用例",
                    "productSkn": 50000181,
                    "saleFlag": 1,
                    "saleTime": 1461206700,
                    "saleTimeStr": "2016-04-21 10:45:00",
                    "showFlag": 1,
                    "status": 1
                },
                {
                    "attachUrl": "http://img10.static.yhbimg.com/goodsimg/2016/03/25/11/01ae6f53f9906bbb25dc5b4c71e2ce4522.jpg",
                    "dayFlag": 1,
                    "hotFlag": 0,
                    "id": 379,
                    "limitProductCode": "201603251101546",
                    "notSaleOrderBy": 0,
                    "orderBy": 1,
                    "productName": "wy-基线测试-分享获取限购码1-001",
                    "productSkn": 51144575,
                    "saleFlag": 1,
                    "saleTime": 1458835200,
                    "saleTimeStr": "2016-03-25 00:00:00",
                    "showFlag": 1,
                    "status": 1
                }
            ],
            "page": 1,
            "size": 20,
            "total": 138,
            "totalPage": 7
        },
        "md5": "a2acac4943f9a01781513ef58b1b94fd",
        "message": "获取列表成功"
    }
}