queryResource.md 5.98 KB

查询资源(分页)

接口名: `/resources/queryResource

方法

POST JSONRAW

入参


属性名称 类型 例子 说明 是否必填 长度限制
name string 男首 资源名称 100
sortId int 2 分类编号 11
platformId int 1 平台编号 11
page int 1 页码

对应SQL的操作库表

  <select id="selectCountByNameLikeAndSortIdAndPlatFormId" resultType="java.lang.Integer">
    select
    count(1)
    from resources
    where 1 = 1
    <if test="name != null" >
      and name like #{name,jdbcType=VARCHAR}
    </if>
    <if test="sortId != null" >
      and sort_id = #{sortId,jdbcType=INTEGER}
    </if>
    <if test="platformId != null" >
      and platform_id = #{platformId,jdbcType=INTEGER}
    </if>
  </select>

    <select id="selectByNameLikeAndSortIdAndPlatFormId" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from resources
    where 1 = 1
    <if test="name != null" >
      and name like #{name,jdbcType=VARCHAR}
    </if>
    <if test="sortId != null" >
      and sort_id = #{sortId,jdbcType=INTEGER}
    </if>
    <if test="platformId != null" >
      and platform_id = #{platformId,jdbcType=INTEGER}
    </if>
    limit #{page.startIndex,jdbcType=INTEGER},#{page.pageSize,jdbcType=INTEGER}
  </select>

    <select id="selectAll" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from platform order by create_time DESC
  </select>

    <select id="selectAll" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from resources_sort order by create_time desc
  </select>

错误编码


错误码code 消息 说明
200 操作成功

返回

{
    "code": 200,
    "data": {
        "list": [
            {
                "code": "201504091403001",
                "createTime": 1430378310,
                "id": 8,
                "matchCode": "",
                "name": "男首页",
                "platformId": 1,
                "platformName": "yohoApp",
                "sortId": 2,
                "sortName": "男首"
            },
            {
                "code": "201504091403002",
                "createTime": 1430382471,
                "id": 10,
                "matchCode": "",
                "name": "女首页",
                "platformId": 1,
                "platformName": "yohoApp",
                "sortId": 3,
                "sortName": "女首"
            },
            {
                "code": "92cc5ace088dd2ddfb850e2fa673302e",
                "createTime": 1430581214,
                "id": 11,
                "matchCode": "",
                "name": "逛.潮人列表页广告",
                "platformId": 1,
                "platformName": "yohoApp",
                "sortId": 4,
                "sortName": "逛列表页"
            },
            {
                "code": "b51a4c7211a658c800472c9abf30c746",
                "createTime": 1430583683,
                "id": 12,
                "matchCode": "",
                "name": "逛.话题列表广告",
                "platformId": 1,
                "platformName": "yohoApp",
                "sortId": 4,
                "sortName": "逛列表页"
            },
            {
                "code": "180a31250622f11180f808d4404d0e78",
                "createTime": 1430583783,
                "id": 13,
                "matchCode": "",
                "name": "逛. 搭配列表广告",
                "platformId": 1,
                "platformName": "yohoApp",
                "sortId": 4,
                "sortName": "逛列表页"
            },
            {
                "code": "5b2f6bb1547c817e30d96007c60c1893",
                "createTime": 1430583858,
                "id": 14,
                "matchCode": "",
                "name": "逛.潮品列表广告",
                "platformId": 1,
                "platformName": "yohoApp",
                "sortId": 4,
                "sortName": "逛列表页"
            },
            {
                "code": "268654b65a362c866378b092ad8a5342",
                "createTime": 1430584009,
                "id": 15,
                "matchCode": "",
                "name": "逛.小贴士",
                "platformId": 1,
                "platformName": "yohoApp",
                "sortId": 4,
                "sortName": "逛列表页"
            },
            {
                "code": "8c48745a39373d621bf5fd80edf59b5e",
                "createTime": 1430725440,
                "id": 16,
                "matchCode": "",
                "name": "男装底部切换到女装首页banner",
                "platformId": 1,
                "platformName": "yohoApp",
                "sortId": 2,
                "sortName": "男首"
            },
            {
                "code": "c63939b2ad458e9cb51147940c1da2e5",
                "createTime": 1430725950,
                "id": 17,
                "matchCode": "",
                "name": "女首进入男首的banner",
                "platformId": 1,
                "platformName": "yohoApp",
                "sortId": 3,
                "sortName": "女首"
            },
            {
                "code": "b714c25f503ab4e6bc143a42d1404cbb",
                "createTime": 1430809519,
                "id": 18,
                "matchCode": "",
                "name": "Plus 国际优选推荐头部广告",
                "platformId": 1,
                "platformName": "yohoApp",
                "sortId": 5,
                "sortName": "Plus/Star"
            }
        ],
        "page": 1,
        "size": 10,
        "total": 308,
        "totalPage": 31
    },
    "md5": "9c6777ba7425010536cd342e80610119",
    "message": "操作成功"
}