updateRel.md 2.2 KB

更新品牌关注

接口名: /guang/relationship/updateRel

方法

POST JSONRAW

入参


属性名称 类型 例子 说明 是否必填 范围
id Integer 232 主键ID 1-11
brandId Integer 232 品牌ID 1-11
brandType Byte 5 品牌类型 1-1
activityImg String http://img11.static.yhbimg.com/yhb-img01/2015/05/21/11/01b1f048e00c9af01cb25bbf6f622258c5.jpg?imageView/{mode}/w/{width}/h/{height} 活动图片 0-255

对应SQL的操作库表

    <update id="updateByPrimaryKeySelective" parameterType="com.yohobuy.platform.dal.guang.model.BrandRelationship" >
        update brand_relationship
        <set >
          <if test="brandId != null" >
            brand_id = #{brandId,jdbcType=INTEGER},
          </if>
          <if test="brandType != null" >
            brand_type = #{brandType,jdbcType=TINYINT},
          </if>
          <if test="activityName != null" >
            activity_name = #{activityName,jdbcType=VARCHAR},
          </if>
          <if test="discount != null" >
            discount = #{discount,jdbcType=TINYINT},
          </if>
          <if test="createTime != null" >
            create_time = #{createTime,jdbcType=INTEGER},
          </if>
        </set>
        where id = #{id,jdbcType=INTEGER}
    </update>

    <delete id="deleteByShipId" parameterType="java.lang.Integer" >
        delete from relationship_image
        where ship_id = #{shipId,jdbcType=INTEGER}
    </delete>

    <insert id="insertBatch" parameterType="java.util.List" >
        insert into relationship_image (ship_id, activity_img, 
          create_time)
        values
        <foreach collection="list" item="item" separator=",">
            (#{item.shipId,jdbcType=INTEGER}, #{item.activityImg,jdbcType=VARCHAR},#{item.createTime,jdbcType=INTEGER})
        </foreach>
    </insert>

错误编码


错误码code 消息 说明
200 添加成功
400 添加失败

返回

    {
        "code": "200",
        "message":"更新成功"
    }