Authored by tanling

标签表结构导致其增删改查接口变更

... ... @@ -631,37 +631,39 @@
### 对应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>
```<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 order_by 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>
<delete id="deleteBatchByCategroyIdAndLabelName" >
delete from sales_category_label
where category_id = #{categoryId,jdbcType=INTEGER} and label_name in
(<foreach collection="labelNameList" item="item" index="index" separator="," >
#{item, jdbcType=VARCHAR}
</foreach>)
</delete>
```
```xml
<insert id="insertBatch">
insert into sales_category_label (label_name, category_id,
parent_id, label_level, status,
create_time, update_time, order_by
)
<insert id="insertBatch">
insert into sales_category_label (label_name, label_id,
category_id, 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 collection="list" item="item" index="index"
separator=",">
(#{item.labelName,jdbcType=VARCHAR}, #{item.labelId,jdbcType=VARCHAR},
#{item.categoryId,jdbcType=INTEGER}, #{item.status,jdbcType=INTEGER}, #{item.createTime,jdbcType=INTEGER},
#{item.updateTime,jdbcType=INTEGER}, #{item.orderBy,jdbcType=INTEGER})
</foreach>
</insert>
```
... ... @@ -682,129 +684,108 @@
"data": {
"list": [
{
"categoryId": "8",
"createTime": "1460444986",
"labelId": "260",
"labelLevel": "1",
"categoryId": "5",
"createTime": "1460539225",
"id": "232",
"labelId": "[798, 810, 840, 846, 852, 858, 870, 876, 927, 930, 931]",
"labelName": "经典款型",
"orderBy": "0",
"parentId": "0",
"status": "1",
"updateTime": "1460444986"
"updateTime": "1460539225"
},
{
"categoryId": "8",
"createTime": "1460444986",
"labelId": "278",
"labelLevel": "1",
"labelName": "版型",
"categoryId": "5",
"createTime": "1460539225",
"id": "234",
"labelId": "[803]",
"labelName": "面料材质",
"orderBy": "0",
"parentId": "0",
"status": "1",
"updateTime": "1460444986"
"updateTime": "1460539225"
},
{
"categoryId": "8",
"createTime": "1460444986",
"labelId": "276",
"labelLevel": "1",
"labelName": "衣长",
"categoryId": "5",
"createTime": "1460539225",
"id": "236",
"labelId": "[981, 985]",
"labelName": "袖型",
"orderBy": "0",
"parentId": "0",
"status": "1",
"updateTime": "1460444986"
"updateTime": "1460539225"
},
{
"categoryId": "8",
"createTime": "1460444986",
"labelId": "274",
"labelLevel": "1",
"labelName": "腰型",
"categoryId": "5",
"createTime": "1460539225",
"id": "238",
"labelId": "[791, 797, 809, 815, 816, 827, 838, 845, 851, 857, 863, 869, 875, 882]",
"labelName": "厚度",
"orderBy": "0",
"parentId": "0",
"status": "1",
"updateTime": "1460444986"
"updateTime": "1460539225"
},
{
"categoryId": "8",
"createTime": "1460444986",
"labelId": "272",
"labelLevel": "1",
"labelName": "裤长",
"categoryId": "5",
"createTime": "1460539225",
"id": "240",
"labelId": "[787, 793, 799, 805, 811, 817, 823, 835, 841, 847, 853, 859, 865, 871, 877]",
"labelName": "领型",
"orderBy": "0",
"parentId": "0",
"status": "1",
"updateTime": "1460444986"
"updateTime": "1460539225"
},
{
"categoryId": "8",
"createTime": "1460444986",
"labelId": "270",
"labelLevel": "1",
"categoryId": "5",
"createTime": "1460539225",
"id": "242",
"labelId": "[789, 795, 801, 807, 825, 839, 843, 849, 855, 861, 867, 873, 879]",
"labelName": "袖长",
"orderBy": "0",
"parentId": "0",
"status": "1",
"updateTime": "1460444986"
"updateTime": "1460539225"
},
{
"categoryId": "8",
"createTime": "1460444986",
"labelId": "268",
"labelLevel": "1",
"labelName": "领型",
"categoryId": "5",
"createTime": "1460539225",
"id": "244",
"labelId": "[765, 766, 767]",
"labelName": "原产地",
"orderBy": "0",
"parentId": "0",
"status": "1",
"updateTime": "1460444986"
"updateTime": "1460539225"
},
{
"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": "袖型",
"categoryId": "5",
"createTime": "1460539225",
"id": "246",
"labelId": "[788, 794, 800, 806, 812, 818, 824, 836, 842, 848, 854, 860, 866, 872, 878]",
"labelName": "衣长",
"orderBy": "0",
"parentId": "0",
"status": "1",
"updateTime": "1460444986"
"updateTime": "1460539225"
},
{
"categoryId": "8",
"createTime": "1460444986",
"labelId": "262",
"labelLevel": "1",
"labelName": "面料材质",
"categoryId": "5",
"createTime": "1460539225",
"id": "248",
"labelId": "[790, 796, 802, 808, 814, 820, 826, 837, 844, 850, 856, 862, 868, 874, 880]",
"labelName": "版型",
"orderBy": "0",
"parentId": "0",
"status": "1",
"updateTime": "1460444986"
"updateTime": "1460539225"
},
{
"categoryId": "8",
"createTime": "1460444986",
"labelId": "280",
"labelLevel": "1",
"categoryId": "5",
"createTime": "1460539225",
"id": "250",
"labelId": "[983, 987]",
"labelName": "肩型",
"orderBy": "0",
"parentId": "0",
"status": "1",
"updateTime": "1460444986"
"updateTime": "1460539225"
}
]
},
"md5": "9c4312ac1377ff0d4d3cdbfb8e89c621",
"md5": "b15a52e1d44a4da8ca77f9f9008c7098",
"message": "querySCLabelList success"
}
... ... @@ -821,48 +802,44 @@
### 入参
|属性名称|类型|例子|说明|是否必填|长度限制|
|--------|----|----|----|--------|--------|
|labelId|String|1|标签id|是|5
|id|String|1|id|是|5
|labelName|String|袖长|标签名称|否|50
|labelId|string||标签ID|否|5
|categoryId|string||关联的销售类目id|否|5
|parentId|string|1|父标签id|否|5
|orderBy|string|0|排序|否|5
|labelLevel|string|1|标签等级|否|5
|status|string|0|销售类目状态1:开启 0:关闭 |否|5
---------------------
### 对应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>
<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="labelId != null" >
label_id = #{labelId,jdbcType=VARCHAR},
</if>
<if test="categoryId != null" >
category_id = #{categoryId,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 id = #{id,jdbcType=INTEGER}
</update>
```
### 响应码
... ... @@ -897,12 +874,11 @@
### 入参
|属性名称|类型|例子|说明|是否必填|长度限制|
|--------|----|----|----|--------|--------|
|labelId|String|1|标签id|是|5
|id|String|1|id|是|5
|labelName|String|袖长|标签名称|否|50
|labelId|string||标签ID|否|5
|categoryId|string||关联的销售类目id|否|5
|parentId|string|1|父标签id|否|5
|orderBy|string|0|排序|否|5
|labelLevel|string|1|标签等级|否|5
|status|string|0|销售类目状态1:开启 0:关闭 |否|5
---------------------
... ... @@ -910,202 +886,172 @@
``` json
{
"scLabelItemList": [
{
"categoryId": "92",
"createTime": "1460453360",
"labelId": "416",
"labelLevel": "1",
"labelName": "经典款型",
"orderBy": "1",
"parentId": "0",
"status": "1",
"updateTime": "1460453360"
},
{
"categoryId": "92",
"createTime": "1460453360",
"labelId": "434",
"labelLevel": "1",
"labelName": "版型",
"orderBy": "2",
"parentId": "0",
"status": "1",
"updateTime": "1460453360"
},
{
"categoryId": "92",
"createTime": "1460453360",
"labelId": "432",
"labelLevel": "1",
"labelName": "衣长",
"orderBy": "3",
"parentId": "0",
"status": "1",
"updateTime": "1460453360"
},
{
"categoryId": "92",
"createTime": "1460453360",
"labelId": "430",
"labelLevel": "1",
"labelName": "腰型",
"orderBy": "4",
"parentId": "0",
"status": "1",
"updateTime": "1460453360"
},
{
"categoryId": "92",
"createTime": "1460453360",
"labelId": "428",
"labelLevel": "1",
"labelName": "裤长",
"orderBy": "0",
"parentId": "0",
"status": "1",
"updateTime": "1460453360"
},
{
"categoryId": "92",
"createTime": "1460453360",
"labelId": "426",
"labelLevel": "1",
"labelName": "袖长",
"orderBy": "5",
"parentId": "0",
"status": "1",
"updateTime": "1460453360"
},
{
"categoryId": "92",
"createTime": "1460453360",
"labelId": "424",
"labelLevel": "1",
"labelName": "领型",
"orderBy": "6",
"parentId": "0",
"status": "1",
"updateTime": "1460453360"
},
{
"categoryId": "92",
"createTime": "1460453360",
"labelId": "422",
"labelLevel": "1",
"labelName": "厚度",
"orderBy": "7",
"parentId": "0",
"status": "1",
"updateTime": "1460453360"
},
{
"categoryId": "92",
"createTime": "1460453360",
"labelId": "420",
"labelLevel": "1",
"labelName": "袖型",
"orderBy": "8",
"parentId": "0",
"status": "1",
"updateTime": "1460453360"
},
{
"categoryId": "92",
"createTime": "1460453360",
"labelId": "418",
"labelLevel": "1",
"labelName": "面料材质",
"orderBy": "9",
"parentId": "0",
"status": "1",
"updateTime": "1460453360"
},
{
"categoryId": "92",
"createTime": "1460453360",
"labelId": "436",
"labelLevel": "1",
"labelName": "肩型",
"orderBy": "10",
"parentId": "0",
"status": "1",
"updateTime": "1460453360"
}
]
}
"scLabelItemList": [
{
"categoryId": "5",
"createTime": "1460539225",
"id": "232",
"labelId": "[798, 810, 840, 846, 852, 858, 870, 876, 927, 930, 931]",
"labelName": "经典款型",
"orderBy": "1",
"status": "1",
"updateTime": "1460539225"
},
{
"categoryId": "5",
"createTime": "1460539225",
"id": "234",
"labelId": "[803]",
"labelName": "面料材质",
"orderBy": "2",
"status": "1",
"updateTime": "1460539225"
},
{
"categoryId": "5",
"createTime": "1460539225",
"id": "236",
"labelId": "[981, 985]",
"labelName": "袖型",
"orderBy": "3",
"status": "1",
"updateTime": "1460539225"
},
{
"categoryId": "5",
"createTime": "1460539225",
"id": "238",
"labelId": "[791, 797, 809, 815, 816, 827, 838, 845, 851, 857, 863, 869, 875, 882]",
"labelName": "厚度",
"orderBy": "4",
"status": "1",
"updateTime": "1460539225"
},
{
"categoryId": "5",
"createTime": "1460539225",
"id": "240",
"labelId": "[787, 793, 799, 805, 811, 817, 823, 835, 841, 847, 853, 859, 865, 871, 877]",
"labelName": "领型",
"orderBy": "5",
"status": "1",
"updateTime": "1460539225"
},
{
"categoryId": "5",
"createTime": "1460539225",
"id": "242",
"labelId": "[789, 795, 801, 807, 825, 839, 843, 849, 855, 861, 867, 873, 879]",
"labelName": "袖长",
"orderBy": "6",
"status": "1",
"updateTime": "1460539225"
},
{
"categoryId": "5",
"createTime": "1460539225",
"id": "244",
"labelId": "[765, 766, 767]",
"labelName": "原产地",
"orderBy": "7",
"status": "1",
"updateTime": "1460539225"
},
{
"categoryId": "5",
"createTime": "1460539225",
"id": "246",
"labelId": "[788, 794, 800, 806, 812, 818, 824, 836, 842, 848, 854, 860, 866, 872, 878]",
"labelName": "衣长",
"orderBy": "8",
"status": "1",
"updateTime": "1460539225"
},
{
"categoryId": "5",
"createTime": "1460539225",
"id": "248",
"labelId": "[790, 796, 802, 808, 814, 820, 826, 837, 844, 850, 856, 862, 868, 874, 880]",
"labelName": "版型",
"orderBy": "9",
"status": "1",
"updateTime": "1460539225"
},
{
"categoryId": "5",
"createTime": "1460539225",
"id": "250",
"labelId": "[983, 987]",
"labelName": "肩型",
"orderBy": "10",
"status": "1",
"updateTime": "1460539225"
}
]
}
```
### 对应SQL的操作库表
```xml
<update id="updateBatchByPrimaryKeySelective" parameterType="java.util.List">
update sales_category_label
<trim prefix="set" suffixOverrides=",">
<trim prefix="label_name =case" suffix="end,">
<foreach collection="scLabelList" item="item" index="index">
<if test="item.labelName!=null">
when label_id=#{item.labelId,jdbcType=INTEGER} then #{item.labelName,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="category_id =case" suffix="end,">
<foreach collection="scLabelList" item="item" index="index">
<if test="item.categoryId!=null">
when label_id=#{item.labelId,jdbcType=INTEGER} then #{item.categoryId,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="parent_id =case" suffix="end,">
<foreach collection="scLabelList" item="item" index="index">
<if test="item.parentId!=null">
when label_id=#{item.labelId,jdbcType=INTEGER} then #{item.parentId,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="label_level =case" suffix="end,">
<foreach collection="scLabelList" item="item" index="index">
<if test="item.labelLevel!=null">
when label_id=#{item.labelId,jdbcType=INTEGER} then #{item.labelLevel,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="status =case" suffix="end,">
<foreach collection="scLabelList" item="item" index="index">
<if test="item.status!=null">
when label_id=#{item.labelId,jdbcType=INTEGER} then #{item.status,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="create_time =case" suffix="end,">
<foreach collection="scLabelList" item="item" index="index">
<if test="item.createTime!=null">
when label_id=#{item.labelId,jdbcType=INTEGER} then #{item.createTime,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="update_time =case" suffix="end,">
<foreach collection="scLabelList" item="item" index="index">
<if test="item.updateTime!=null">
when label_id=#{item.labelId,jdbcType=INTEGER} then #{item.updateTime,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="order_by =case" suffix="end,">
<foreach collection="scLabelList" item="item" index="index">
<if test="item.orderBy!=null">
when label_id=#{item.labelId,jdbcType=INTEGER} then #{item.orderBy,jdbcType=INTEGER}
</if>
</foreach>
</trim>
</trim>
where
<foreach collection="scLabelList" separator="or" item="item" index="index" >
label_id= #{item.labelId,jdbcType=INTEGER}
</foreach>
</update>
update sales_category_label
<trim prefix="set" suffixOverrides=",">
<trim prefix="label_name =case" suffix="end,">
<foreach collection="scLabelList" item="item" index="index">
<if test="item.labelName!=null">
when id=#{item.id,jdbcType=INTEGER} then #{item.labelName,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="category_id =case" suffix="end,">
<foreach collection="scLabelList" item="item" index="index">
<if test="item.categoryId!=null">
when id=#{item.id,jdbcType=INTEGER} then #{item.categoryId,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="label_id =case" suffix="end,">
<foreach collection="scLabelList" item="item" index="index">
<if test="item.labelId!=null">
when id=#{item.id,jdbcType=INTEGER} then #{item.labelId,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="status =case" suffix="end,">
<foreach collection="scLabelList" item="item" index="index">
<if test="item.status!=null">
when id=#{item.id,jdbcType=INTEGER} then #{item.status,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="create_time =case" suffix="end,">
<foreach collection="scLabelList" item="item" index="index">
<if test="item.createTime!=null">
when id=#{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="update_time =case" suffix="end,">
<foreach collection="scLabelList" item="item" index="index">
<if test="item.updateTime!=null">
when id=#{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=INTEGER}
</if>
</foreach>
</trim>
<trim prefix="order_by =case" suffix="end,">
<foreach collection="scLabelList" item="item" index="index">
<if test="item.orderBy!=null">
when id=#{item.id,jdbcType=INTEGER} then #{item.orderBy,jdbcType=INTEGER}
</if>
</foreach>
</trim>
</trim>
where(
<foreach collection="scLabelList" separator="or" item="item" index="index" >
id=#{item.id,jdbcType=INTEGER}
</foreach>)
</update>
```
### 响应码
... ...