Authored by tanling

限定商品管理 接口

# 平台端限定商品接口服务定义
---------------------
# 获取限定商品列表接口
> 接口名: `/limitProduct/getLimitProductList`
### 方法
> POST JSONRAW
### 入参
-------------------------
|属性名称|类型|例子|说明|是否必填|长度限制|
|-------|----|----|----|-------|--------|
|productName|String|活动23451|限定商品名称|否|255
|productSkn|String||限定商品SKN|否|11
|showFlag|String|0|是否前台展示状态,0:不展示 1:展示|否|11
|hotFlag|String|0|是否热门商品,0:非热门 1:热门|否|11
--------------------------------
```xml
<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>
```
```xml
<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|获取列表成功| |
### 返回
``` json
{
"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": "获取列表成功"
}
}
```
# 查询限定商品详情接口
> 接口名: `/limitProduct/getLimitProduct`
### 方法
> POST JSONRAW
### 入参
-------------------------
|属性名称|类型|例子|说明|是否必填|长度限制|
|-------|----|----|----|-------|--------|
|id|Integer|83|限定商品表示|是|11
--------------------------------
### 对应SQL的操作库表
```xml
<select id="selectLimitProduct" resultMap="BaseResultMap" >
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>
</select>
```
```xml
<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| 操作成功.| |
### 返回
``` json
{
"code": 200,
"message": "",
"data": {
"code": 200,
"data": {
"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
},
"md5": "a2acac4943f9a01781513ef58b1b94fd",
"message": "获取列表成功"
}
}
```
# 新增限定商品接口
> 接口名: `/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的操作库表
```xml
<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>
```
```xml
<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| 保存成功!| |
### 返回
``` json
{
"code": 200,
"data": [],
"md5": "d751713988987e9331980363e24189ce",
"message": "保存成功!"
}
```
# 修改限定商品接口
> 接口名: `/limitProduct/updateLimitProduct`
### 方法
> POST JSONRAW
### 入参
-------------------------
|属性名称|类型|例子|说明|是否必填|长度限制|
|--------|----|----|----|--------|--------|
|id|int||限定商品id|是|11
|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的操作库表
```xml
<update id="updateLimitProduct" parameterType="com.yohobuy.platform.dal.product.model.LimitProduct">
update limit_product
<set >
<if test="limitProductCode != null" >
productCode = #{limitProductCode,jdbcType=VARCHAR},
</if>
<if test="productName != null" >
productName = #{productName,jdbcType=VARCHAR},
</if>
<if test="price != null" >
price = #{price,jdbcType=VARCHAR},
</if>
<if test="batchNo != null" >
batchno = #{batchNo,jdbcType=VARCHAR},
</if>
<if test="limitProductType != null" >
limit_product_type = #{limitProductType,jdbcType=INTEGER},
</if>
<if test="activityId != null" >
activity_id = #{activityId,jdbcType=INTEGER},
</if>
<if test="productSkn != null" >
productSkn = #{productSkn,jdbcType=INTEGER},
</if>
<if test="saleTime != null" >
sale_time = #{saleTime,jdbcType=INTEGER},
</if>
<if test="saleTimeStr != null" >
sale_time_str = #{saleTimeStr,jdbcType=VARCHAR},
</if>
<if test="dayFlag != null" >
day_flag = #{dayFlag,jdbcType=INTEGER},
</if>
<if test="hotFlag != null" >
hotFlag = #{hotFlag,jdbcType=INTEGER},
</if>
<if test="orderBy != null" >
order_by = #{orderBy,jdbcType=INTEGER},
</if>
<if test="showFlag != null" >
showFlag = #{showFlag,jdbcType=INTEGER},
</if>
<if test="creatorId != null" >
creator_id = #{creatorId,jdbcType=INTEGER},
</if>
<if test="creatorName != null" >
creator_name = #{creatorName,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
create_time = #{createTime,jdbcType=INTEGER},
</if>
<if test="lastUpdateTime != null" >
update_time = #{lastUpdateTime,jdbcType=INTEGER},
</if>
<if test="status != null" >
status = #{status,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
```
```xml
<delete id="deleteLimitProductAttach" >
delete from limit_product_attach
where product_id = #{productId,jdbcType=INTEGER}
</delete>
```
```xml
<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| 修改成功!| |
|200| 修改失败!| |
### 返回
``` json
{
"code": 200,
"data": [],
"md5": "d751713988987e9331980363e24189ce",
"message": "修改成功!"
}
```
# 审核限定商品接口
> 接口名: `/limitProduct/auditLimitProduct`
### 方法
> POST JSONRAW
### 入参
-------------------------
|属性名称|类型|例子|说明|是否必填|长度限制|
|--------|----|----|----|--------|--------|
|id|int||限定商品表示|是|11
|showFlag|String||是否前台展示状态,0:不展示 1:展示|否|
|hotFlag|String||是否热门商品,0:非热门 1:热门|否|
|orderBy|int||热门限定商品的排序|否|
---------------------
### 对应SQL的操作库表
```xml
<update id="updateLimitProductByBatchNo" parameterType="com.yohobuy.platform.model.product.req.LimitProductSknUpdateReq">
update limit_product
set productSkn = #{productSkn,jdbcType=VARCHAR}
where batchno = #{batchNo,jdbcType=VARCHAR}
</update>
```
### 响应码
-------------------------
|响应码code|消息|说明|
|--------|----|----|
|200| 设置成功!| |
|5002| 设置失败!| |
### 返回
``` json
{
"code": 200,
"data": [],
"md5": "d751713988987e9331980363e24189ce",
"message": "设置成功!"
}
```
# 删除限定商品接口
> 接口名: `/limitProduct/deleteLimitProduct`
### 方法
> POST JSONRAW
### 入参
-------------------------
|属性名称|类型|例子|说明|是否必填|长度限制|
|--------|----|----|----|--------|--------|
|id|int||限定商品表示|是|11
---------------------
### 对应SQL的操作库表
```xml
<delete id="deleteLimitProduct" >
delete from limit_product
where id = #{id,jdbcType=INTEGER}
</delete>
```
```xml
<delete id="deleteLimitProductAttach" >
delete from limit_product_attach
where product_id = #{productId,jdbcType=INTEGER}
</delete>
```
### 响应码
-------------------------
|响应码code|消息|说明|
|--------|----|----|
|200| 删除成功!| |
|5003| 删除失败!| |
### 返回
``` json
{
"code": 200,
"data": [],
"md5": "d751713988987e9331980363e24189ce",
"message": "删除成功!"
}
```
# 限购码批次关联商品skn后,限定商品同步修改skn接口
> 接口名: `/limitProduct/updateLimitProductByBatchNo`
### 方法
> POST JSONRAW
### 入参
-------------------------
|属性名称|类型|例子|说明|是否必填|长度限制|
|--------|----|----|----|--------|--------|
|batchNo|String||限购码批次号|是|11
|productSkn|int||关联SKN|是|11
---------------------
### 对应SQL的操作库表
```xml
<update id="updateLimitProductByBatchNo" parameterType="com.yohobuy.platform.model.product.req.LimitProductSknUpdateReq">
update limit_product
set productSkn = #{productSkn,jdbcType=VARCHAR}
where batchno = #{batchNo,jdbcType=VARCHAR}
</update>
```
### 响应码
-------------------------
|响应码code|消息|说明|
|--------|----|----|
|200| 修改成功!| |
|5001| 修改失败!| |
### 返回
``` json
{
"code": 200,
"data": [],
"md5": "d751713988987e9331980363e24189ce",
"message": "修改成功!"
}
```
# 查询各种状态的优惠码总数接口
> 接口名: `/limitProduct/getCountByStatus`
### 方法
> POST JSONRAW
### 入参
-------------------------
|属性名称|类型|例子|说明|是否必填|长度限制|
|--------|----|----|----|--------|--------|
|batchNo|String||限购码批次号|是|11
|productSkn|int||关联SKN|是|11
---------------------
### 对应SQL的操作库表
```xml
<select id="selectLimitProductCount" resultType="java.lang.Integer" parameterType="com.yohobuy.platform.model.product.req.LimitProductReq" >
select count(id) 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="batchNo != null and batchNo != ''" >
and p.batchno like '%' #{batchNo,jdbcType=VARCHAR} '%'
</if>
<if test="status != null and status != ''" >
and p.status = #{status,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>
</select>
```
### 响应码
-------------------------
|响应码code|消息|说明|
|--------|----|----|
|200| 修改成功!| |
|5001| 修改失败!| |
### 返回
``` json
{
"code": 200,
"data": [],
"md5": "d751713988987e9331980363e24189ce",
"message": "修改成功!"
}
```
\ No newline at end of file
... ...