Authored by chaogeng

update

1 -## 编辑plustar分类接口  
2 -  
3 -> 接口名: '/guang/plustar/updatePlustar'  
4 -  
5 -### 方法  
6 -  
7 -> POST JSONRAW  
8 -  
9 -### 入参  
10 -  
11 --------------------------  
12 -|属性名称|类型|例子|说明|是否必填|范围|  
13 -|--------|----|----|----|----|----|  
14 -|id|String|450|plustar ID|是||  
15 -|brandId|String|30|品牌id|否||  
16 -|brandType|String|1|频道id|否||  
17 -|coverImg|String|http://img12.static.yhbimg.com/yhb-img01/2016/03/28/08/02a4da74a108380e93a33dc5eb91b42f2f.jpg|封面图|否||  
18 -|bannerImg|String[]|["http://img12.static.yhbimg.com/yhb-img01/2016/03/28/08/02a4da74a108380e93a33dc5eb91b42f2f.jpg?imageView/2/w/300/h/300"]|banner图|否||  
19 -|bannerTitle|String|广泛丰厚的|banner标签|否||  
20 -|orderBy|String|23|排序|否||  
21 -|gender|String|1|性别|否||  
22 -|status|String|1|是否可用|否||  
23 ----------------------  
24 -  
25 -### 对应SQL的操作库表  
26 -  
27 -```xml  
28 - <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >  
29 - select  
30 - <include refid="Base_Column_List" />  
31 - from brand_relation  
32 - where id = #{id,jdbcType=INTEGER}  
33 - </select>  
34 -  
35 - <update id="updateByPrimaryKeySelective" parameterType="com.yohobuy.platform.dal.guang.model.BrandRelation" >  
36 - update brand_relation  
37 - <set >  
38 - <if test="brandId != null" >  
39 - brand_id = #{brandId,jdbcType=INTEGER},  
40 - </if>  
41 - <if test="brandType != null" >  
42 - brand_type = #{brandType,jdbcType=TINYINT},  
43 - </if>  
44 - <if test="coverImg != null" >  
45 - cover_img = #{coverImg,jdbcType=VARCHAR},  
46 - </if>  
47 - <if test="bannerTitle != null" >  
48 - banner_title = #{bannerTitle,jdbcType=VARCHAR},  
49 - </if>  
50 - <if test="isRecommend != null" >  
51 - is_recommend = #{isRecommend,jdbcType=TINYINT},  
52 - </if>  
53 - <if test="orderBy != null" >  
54 - order_by = #{orderBy,jdbcType=SMALLINT},  
55 - </if>  
56 - <if test="isDifferent != null" >  
57 - is_different = #{isDifferent,jdbcType=BIT},  
58 - </if>  
59 - <if test="gender != null" >  
60 - gender = #{gender,jdbcType=CHAR},  
61 - </if>  
62 - <if test="status != null" >  
63 - status = #{status,jdbcType=BIT},  
64 - </if>  
65 - <if test="createTime != null" >  
66 - create_time = #{createTime,jdbcType=INTEGER},  
67 - </if>  
68 - <if test="updateTime != null" >  
69 - update_time = #{updateTime,jdbcType=INTEGER},  
70 - </if>  
71 - </set>  
72 - where id = #{id,jdbcType=INTEGER}  
73 - </update>  
74 -  
75 - <delete id="deleteByRelationId" parameterType="java.lang.Integer" >  
76 - delete from brand_img  
77 - where relation_id = #{relationId,jdbcType=INTEGER}  
78 - </delete>  
79 -  
80 - <insert id="insertBatch" parameterType="java.util.List" >  
81 - insert into brand_img (relation_id, banner_img)  
82 - values  
83 - <foreach collection="list" item="item" separator=",">  
84 - (#{item.relationId}, #{item.bannerImg})  
85 - </foreach>  
86 - </insert>  
87 -```  
88 -  
89 -### 错误编码  
90 -  
91 --------------------------  
92 -|错误码code|消息|说明|  
93 -|--------|----|----|  
94 -|400| plustar is null| |  
95 -|400| 没有找到该品牌关系| |  
96 -|500| 插入banner图片失败| |  
97 -|200| 修改成功!| |  
98 -|400| 修改失败!| |  
99 -  
100 -### 返回  
101 -  
102 -``` json  
103 -{  
104 - "code":200,  
105 - "message":"修改成功!"  
106 -}  
107 - 1 +## 编辑plustar分类接口
  2 +
  3 +> 接口名: '/guang/plustar/updatePlustar'
  4 +
  5 +### 方法
  6 +
  7 +> POST JSONRAW
  8 +
  9 +### 入参
  10 +
  11 +-------------------------
  12 +|属性名称|类型|例子|说明|是否必填|范围|
  13 +|--------|----|----|----|----|----|
  14 +|id|String|450|plustar ID|是|1-10|
  15 +|brandId|String|30|品牌id|是|1-10|
  16 +|brandType|String|1|频道id|是|1-1|
  17 +|coverImg|String|http://img12.static.yhbimg.com/yhb-img01/2016/03/28/08/02a4da74a108380e93a33dc5eb91b42f2f.jpg|封面图|是|1-85|
  18 +|bannerImg|String[]|["http://img12.static.yhbimg.com/yhb-img01/2016/03/28/08/02a4da74a108380e93a33dc5eb91b42f2f.jpg?imageView/2/w/300/h/300"]|banner图|否|-|
  19 +|bannerTitle|String|广泛丰厚的|banner标签|否|0-85|
  20 +|orderBy|String|23|排序|否|0-6|
  21 +|gender|String|1|性别|否|0-1|
  22 +|status|String|1|是否可用|否|0-1|
  23 +---------------------
  24 +
  25 +### 对应SQL的操作库表
  26 +
  27 +```xml
  28 + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  29 + select
  30 + <include refid="Base_Column_List" />
  31 + from brand_relation
  32 + where id = #{id,jdbcType=INTEGER}
  33 + </select>
  34 +
  35 + <update id="updateByPrimaryKeySelective" parameterType="com.yohobuy.platform.dal.guang.model.BrandRelation" >
  36 + update brand_relation
  37 + <set >
  38 + <if test="brandId != null" >
  39 + brand_id = #{brandId,jdbcType=INTEGER},
  40 + </if>
  41 + <if test="brandType != null" >
  42 + brand_type = #{brandType,jdbcType=TINYINT},
  43 + </if>
  44 + <if test="coverImg != null" >
  45 + cover_img = #{coverImg,jdbcType=VARCHAR},
  46 + </if>
  47 + <if test="bannerTitle != null" >
  48 + banner_title = #{bannerTitle,jdbcType=VARCHAR},
  49 + </if>
  50 + <if test="isRecommend != null" >
  51 + is_recommend = #{isRecommend,jdbcType=TINYINT},
  52 + </if>
  53 + <if test="orderBy != null" >
  54 + order_by = #{orderBy,jdbcType=SMALLINT},
  55 + </if>
  56 + <if test="isDifferent != null" >
  57 + is_different = #{isDifferent,jdbcType=BIT},
  58 + </if>
  59 + <if test="gender != null" >
  60 + gender = #{gender,jdbcType=CHAR},
  61 + </if>
  62 + <if test="status != null" >
  63 + status = #{status,jdbcType=BIT},
  64 + </if>
  65 + <if test="createTime != null" >
  66 + create_time = #{createTime,jdbcType=INTEGER},
  67 + </if>
  68 + <if test="updateTime != null" >
  69 + update_time = #{updateTime,jdbcType=INTEGER},
  70 + </if>
  71 + </set>
  72 + where id = #{id,jdbcType=INTEGER}
  73 + </update>
  74 +
  75 + <delete id="deleteByRelationId" parameterType="java.lang.Integer" >
  76 + delete from brand_img
  77 + where relation_id = #{relationId,jdbcType=INTEGER}
  78 + </delete>
  79 +
  80 + <insert id="insertBatch" parameterType="java.util.List" >
  81 + insert into brand_img (relation_id, banner_img)
  82 + values
  83 + <foreach collection="list" item="item" separator=",">
  84 + (#{item.relationId}, #{item.bannerImg})
  85 + </foreach>
  86 + </insert>
  87 +```
  88 +
  89 +### 错误编码
  90 +
  91 +-------------------------
  92 +|错误码code|消息|说明|
  93 +|--------|----|----|
  94 +|400| plustar is null| |
  95 +|400| 没有找到该品牌关系| |
  96 +|500| 插入banner图片失败| |
  97 +|200| 修改成功!| |
  98 +|400| 修改失败!| |
  99 +
  100 +### 返回
  101 +
  102 +``` json
  103 +{
  104 + "code":200,
  105 + "message":"修改成功!"
  106 +}
  107 +
108 ``` 108 ```