queryAll.md 2.16 KB

获取品牌款型系列列表(有分页)

接口名: /brandSeries/queryAll

入参


属性名称 类型 例子 说明 是否必填
seriesName string 羽绒服系列 名称
shopsId int 1 店铺id
brandId int 1 店铺id下的某个品牌id
type int 1 1:"品牌款型";2:"品牌系列"
page int 1 页码数,默认1
size int 10 记录数,默认10条
status int 1 状态 1:打开 0:关闭

返回

{
  "code": 200,--若失败为500
  "data": {
    "list": [
      {
        "brandId": 5,
        "id": 48,
        "seriesName": "test-cc-u",
        "shopsId": 5,
        "status": 1,
        "type": 5
      }
    ],
    "page": 0,-第几页
    "size": 0,-单页记录数
    "total": 437,--总数
    "totalPage": 1--总页数
  },
  "md5": "81531967e3291781f608555ca63ccd28",
  "message": "success"
}

对应SQL的操作库表

  select
    id, shops_id, brand_id, series_name, parent_id, order_by, status, bannar_img,create_time,update_time
    from brand_series
    where 1=1
    <if test="condition.shopsId != null" >
      and shops_id = #{condition.shopsId,jdbcType=INTEGER}
    </if>
    <if test="condition.brandId != null" >
      and brand_id = #{condition.brandId,jdbcType=INTEGER}
    </if>
    <if test="condition.seriesName != null" >
      and series_name LIKE CONCAT('%',#{condition.seriesName,jdbcType=VARCHAR},'%')
    </if>
    <if test="condition.status != null" >
      and status=#{condition.status,jdbcType=TINYINT}
    </if>
    order by update_time desc, create_time desc
    limit #{beginIndex},#{size}

eg:

 select
    id, shops_id, brand_id, series_name, parent_id, order_by, status, bannar_img,create_time,update_time
    from brand_series
    where 1=1
      and shops_id = 2
      and brand_id = 1
      and series_name LIKE CONCAT('%','what?','%')
      and status=1
    order by update_time desc, create_time desc
    limit 0,10