Authored by bblu

销售类目接口

# 添加销售类目接口
> 接口名: `/salesCategory/addSC`
### 方法
> POST JSONRAW
### 入参
-------------------------
|属性名称|类型|例子|说明|是否必填|
|--------|----|----|----|--------|
|categoryName|String|创意家居|销售类目名称|是|
|relationParameter|String|285,113|关联的物理类目id|否|
|relationUrl|string||关联url|否|
|parentId|string|1|父销售类目id|否|
|orderBy|string|0|排序|否|
|icon|string||销售类目图标|否|
---------------------
### 对应SQL的操作库表
```xml
<insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" parameterType="com.yohobuy.platform.dal.product.model.SalesCategory">
insert into sales_category
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="categoryId != null">
category_id,
</if>
<if test="categoryName != null">
category_name,
</if>
<if test="relationParameter != null">
relation_parameter,
</if>
<if test="relationUrl != null">
relation_url,
</if>
<if test="parentId != null">
parent_id,
</if>
<if test="orderBy != null">
order_by,
</if>
<if test="icon != null">
icon,
</if>
<if test="categoryCode != null">
category_code,
</if>
<if test="state != null">
state,
</if>
<if test="levelNumber != null">
level_number,
</if>
<if test="createTime != null">
create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="categoryId != null">
#{categoryId,jdbcType=INTEGER},
</if>
<if test="categoryName != null">
#{categoryName,jdbcType=VARCHAR},
</if>
<if test="relationParameter != null">
#{relationParameter,jdbcType=VARCHAR},
</if>
<if test="relationUrl != null">
#{relationUrl,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
#{parentId,jdbcType=INTEGER},
</if>
<if test="orderBy != null">
#{orderBy,jdbcType=INTEGER},
</if>
<if test="icon != null">
#{icon,jdbcType=VARCHAR},
</if>
<if test="categoryCode != null">
#{categoryCode,jdbcType=VARCHAR},
</if>
<if test="state != null">
#{state,jdbcType=INTEGER},
</if>
<if test="levelNumber != null">
#{levelNumber,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=INTEGER},
</if>
</trim>
</insert>
```
### 响应码
-------------------------
|响应码code|消息|说明|
|--------|----|----|
|200| addSC success| |
### 返回
``` json
{
"code": 200,
"data": "",
"md5": "d751713988987e9331980363e24189ce",
"message": "addSC success."
}
```
... ...
# 根据销售类目的id查询销售类目接口
> 接口名: `/salesCategory/querySCById`
### 方法
> POST JSONRAW
### 入参
-------------------------
|属性名称|类型|例子|说明|是否必填|
|-------|----|----|----|-------|
|categoryId|String|59|销售类目id|是|
--------------------------------
### 对应SQL的操作库表
```xml
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
select
<include refid="Base_Column_List" />
from sales_category
where category_id = #{categoryId,jdbcType=INTEGER}
</select>
```
```xml
<select id="selectListByIDSWhenDefaultStatus" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from product_sort
where
status=1 and
id in
<foreach collection="sortIdList" item="item" index="index" separator="," open="(" close=")">
#{item, jdbcType=SMALLINT}
</foreach>
</select>
```
### 响应码
-------------------------
|响应码code|消息|说明|
|--------|----|----|
|200| querySCById success| |
|400| 销售类目ID不能为空| |
### 返回
``` json
{
"code": 200,
"data": {
"categoryCode": "1,5,45,0",
"categoryId": "45",
"categoryName": "T恤",
"createTime": "1441118277",
"icon": "",
"levelNumber": "3",
"orderBy": "5",
"parentId": "5",
"parentSC": [
{
"categoryCode": "1,0,0,0",
"categoryId": "1",
"categoryName": "男生",
"createTime": "1441117726",
"icon": "",
"items": [
{
"categoryCode": "1,5,0,0",
"categoryId": "5",
"categoryName": "上衣",
"createTime": "1441117792",
"icon": "http://img11.static.yhbimg.com/taobaocms/2015/09/01/14/01d48022e08742f1c96766caa6484593ce.jpg?imageView/{mode}/w/{width}/h/{height}",
"levelNumber": "2",
"orderBy": "10",
"parentId": "1",
"relationParameter": "114,293,116,117,115,119,124,122,413,258,173,227,125,118,121,123",
"relationUrl": "",
"state": "0"
}
],
"levelNumber": "1",
"orderBy": "0",
"parentId": "0",
"relationParameter": "114,293,116,117,115,119,124,122,131,129,346,133,348,147,149,148,151,231,152,153,196,238,239,240,349,157,342,156,161,300,160,233,341,340,210,339,351,186,235,163,224,322,323,324,325,326,327,328,329,330,331,72,74,75,76,142,77,78,79,80,199,213,217,218,234,303,305,306,307,334,162,316,164,317,295,321,311,357,359,320,195,197,413,130,258,173,227,125,118,121,123,263,260,264,261,352",
"relationUrl": "",
"state": "0"
}
],
"relationParameter": "114,293",
"relationProductSort": [
{
"createTime": 0,
"gender": 3,
"id": 1,
"isHot": "N",
"items": [
{
"createTime": 0,
"gender": 3,
"id": 11,
"isHot": "N",
"items": [
{
"createTime": 0,
"gender": 3,
"id": 114,
"isHot": "N",
"orderBy": 12,
"parentId": 11,
"sortCode": "1,11,114",
"sortLevel": 3,
"sortName": "T恤",
"status": 1,
"updateTime": 0
},
{
"createTime": 0,
"gender": 3,
"id": 293,
"isHot": "N",
"orderBy": 0,
"parentId": 11,
"sortCode": "1,11,293",
"sortInitials": "cxtx",
"sortLevel": 3,
"sortName": "长袖T恤",
"status": 1,
"updateTime": 0
}
],
"orderBy": 8,
"parentId": 1,
"sortCode": "1,11,0",
"sortInitials": "tx",
"sortLevel": 2,
"sortName": "T恤",
"status": 1,
"updateTime": 1458048766
}
],
"orderBy": 100,
"parentId": 0,
"sortCode": "1,0,0",
"sortInitials": "sy",
"sortLevel": 1,
"sortName": "上衣",
"status": 1,
"updateTime": 1453802272
}
],
"relationUrl": "",
"state": "0"
},
"md5": "5336e9aad255923dc684de32719ded0b",
"message": "querySCById success"
}
```
... ...
# 销售类目的标签查询
> 接口名: `/salesCategoryLabel/querySCLabelList`
### 方法
> POST JSONRAW
### 入参
-------------------------
|属性名称|类型|例子|说明|是否必填|
|-------|----|----|----|-------|
|categoryId|String|52|销售类目的id|是|
|status|String|1|状态 1:开启, 0:关闭|否|
--------------------------------
### 对应SQL的操作库表
```xml
<select id="selectSCLabelByCond" resultMap="BaseResultMap" parameterType="com.yohobuy.platform.dal.product.model.SalesCategoryLabel">
select
<include refid="Base_Column_List" />
from sales_category_label
where category_id = #{categoryId,jdbcType=INTEGER}
<if test="status != null">
and status = #{status,jdbcType=INTEGER}
</if>
order by label_level desc
</select>
```
```xml
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
select
<include refid="Base_Column_List" />
from sales_category
where category_id = #{categoryId,jdbcType=INTEGER}
</select>
```
```xml
<insert id="insertBatch">
insert into sales_category_label (label_name, category_id,
parent_id, label_level, status,
create_time, update_time, order_by
)
values
<foreach collection="list" item="item" index="index" separator=",">
(#{item.labelName},#{item.categoryId},#{item.parentId},#{item.labelLevel},#{item.status},#{item.createTime},#{item.updateTime},#{item.orderBy})
</foreach>
</insert>
```
### 响应码
-------------------------
|响应码code|消息|说明|
|--------|----|----|
|200| querySCLabelList success| |
|400| 销售类目ID不能为空| |
### 返回
``` json
{
"code": 200,
"data": {
"list": [
{
"categoryId": "8",
"createTime": "1460444986",
"labelId": "260",
"labelLevel": "1",
"labelName": "经典款型",
"orderBy": "0",
"parentId": "0",
"status": "1",
"updateTime": "1460444986"
},
{
"categoryId": "8",
"createTime": "1460444986",
"labelId": "278",
"labelLevel": "1",
"labelName": "版型",
"orderBy": "0",
"parentId": "0",
"status": "1",
"updateTime": "1460444986"
},
{
"categoryId": "8",
"createTime": "1460444986",
"labelId": "276",
"labelLevel": "1",
"labelName": "衣长",
"orderBy": "0",
"parentId": "0",
"status": "1",
"updateTime": "1460444986"
},
{
"categoryId": "8",
"createTime": "1460444986",
"labelId": "274",
"labelLevel": "1",
"labelName": "腰型",
"orderBy": "0",
"parentId": "0",
"status": "1",
"updateTime": "1460444986"
},
{
"categoryId": "8",
"createTime": "1460444986",
"labelId": "272",
"labelLevel": "1",
"labelName": "裤长",
"orderBy": "0",
"parentId": "0",
"status": "1",
"updateTime": "1460444986"
},
{
"categoryId": "8",
"createTime": "1460444986",
"labelId": "270",
"labelLevel": "1",
"labelName": "袖长",
"orderBy": "0",
"parentId": "0",
"status": "1",
"updateTime": "1460444986"
},
{
"categoryId": "8",
"createTime": "1460444986",
"labelId": "268",
"labelLevel": "1",
"labelName": "领型",
"orderBy": "0",
"parentId": "0",
"status": "1",
"updateTime": "1460444986"
},
{
"categoryId": "8",
"createTime": "1460444986",
"labelId": "266",
"labelLevel": "1",
"labelName": "厚度",
"orderBy": "0",
"parentId": "0",
"status": "1",
"updateTime": "1460444986"
},
{
"categoryId": "8",
"createTime": "1460444986",
"labelId": "264",
"labelLevel": "1",
"labelName": "袖型",
"orderBy": "0",
"parentId": "0",
"status": "1",
"updateTime": "1460444986"
},
{
"categoryId": "8",
"createTime": "1460444986",
"labelId": "262",
"labelLevel": "1",
"labelName": "面料材质",
"orderBy": "0",
"parentId": "0",
"status": "1",
"updateTime": "1460444986"
},
{
"categoryId": "8",
"createTime": "1460444986",
"labelId": "280",
"labelLevel": "1",
"labelName": "肩型",
"orderBy": "0",
"parentId": "0",
"status": "1",
"updateTime": "1460444986"
}
]
},
"md5": "9c4312ac1377ff0d4d3cdbfb8e89c621",
"message": "querySCLabelList success"
}
```
... ...
# 更新销售类目接口
> 接口名: `/salesCategory/updateSC`
### 方法
> POST JSONRAW
### 入参
-------------------------
|属性名称|类型|例子|说明|是否必填|
|--------|----|----|----|--------|
|categoryId|String|4|销售类目id|是|
|categoryName|String|创意家居|销售类目名称|否|
|relationParameter|String|285,113|关联的物理类目id|否|
|relationUrl|string||关联url|否|
|parentId|String|1|父销售类目id|否|
|orderBy|String|0|排序|否|
|icon|string||销售类目图标|否|
|status|String|0|销售类目状态1:开启 0:关闭 |否
---------------------
### 对应SQL的操作库表
```xml
<update id="updateByPrimaryKeySelective" parameterType="com.yohobuy.platform.dal.product.model.SalesCategory">
update sales_category
<set>
<if test="categoryName != null">
category_name = #{categoryName,jdbcType=VARCHAR},
</if>
<if test="relationParameter != null">
relation_parameter = #{relationParameter,jdbcType=VARCHAR},
</if>
<if test="relationUrl != null">
relation_url = #{relationUrl,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
parent_id = #{parentId,jdbcType=INTEGER},
</if>
<if test="orderBy != null">
order_by = #{orderBy,jdbcType=INTEGER},
</if>
<if test="icon != null">
icon = #{icon,jdbcType=VARCHAR},
</if>
<if test="categoryCode != null">
category_code = #{categoryCode,jdbcType=VARCHAR},
</if>
<if test="state != null">
state = #{state,jdbcType=INTEGER},
</if>
<if test="levelNumber != null">
level_number = #{levelNumber,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=INTEGER},
</if>
</set>
where category_id = #{categoryId,jdbcType=INTEGER}
</update>
```
### 响应码
-------------------------
|响应码code|消息|说明|
|--------|----|----|
|200| updateSC success| |
|400| 类目id丢失/修改参数不合法| |
### 返回
``` json
{
"code": 200,
"data": "",
"md5": "d751713988987e9331980363e24189ce",
"message": "updateSC success."
}
```
... ...
# 更新销售类目的标签接口
> 接口名: `/salesCategoryLabel/updateSCLabel`
### 方法
> POST JSONRAW
### 入参
|属性名称|类型|例子|说明|是否必填|
|--------|----|----|----|--------|
|labelId|String|1|标签id|是|
|labelName|String|袖长|标签名称|否|
|categoryId|string||关联的销售类目id|否|
|parentId|string|1|父标签id|否|
|orderBy|string|0|排序|否|
|labelLevel|string|1|标签等级|否|
|status|string|0|销售类目状态1:开启 0:关闭 |否
---------------------
### 对应SQL的操作库表
```xml
<update id="updateByPrimaryKeySelective" parameterType="com.yohobuy.platform.dal.product.model.SalesCategoryLabel">
update sales_category_label
<set>
<if test="labelName != null">
label_name = #{labelName,jdbcType=VARCHAR},
</if>
<if test="categoryId != null">
category_id = #{categoryId,jdbcType=INTEGER},
</if>
<if test="parentId != null">
parent_id = #{parentId,jdbcType=INTEGER},
</if>
<if test="labelLevel != null">
label_level = #{labelLevel,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=INTEGER},
</if>
<if test="orderBy != null">
order_by = #{orderBy,jdbcType=INTEGER},
</if>
</set>
where label_id = #{labelId,jdbcType=INTEGER}
</update>
```
### 响应码
-------------------------
|响应码code|消息|说明|
|--------|----|----|
|200| updateCategoryLabel success| |
|400| 类目id丢失/修改参数不合法| |
### 返回
``` json
{
"code": 200,
"data": [],
"md5": "d751713988987e9331980363e24189ce",
"message": "updateSCLabel success."
}
```
... ...