queryHotSearchTerms.md 3.31 KB

查询热销搜索词

接口名: /searchWords/queryHotSearchTerms

方法

POST JSONRAW

入参


属性名称 类型 例子 说明 是否必填 长度限制
page number 1 当前页 默认1 11
size number 20 条数 默认10 11

对应SQL的操作库表

  <select id="selectListBySearch" resultMap="BaseResultMap" parameterType="com.yohobuy.platform.model.search.req.SearchWordsQueryReq">
        select
        <include refid="Base_Column_List"/>
        from search_terms
        where 1=1
        <if test="type != null">
            and type = #{type,jdbcType=SMALLINT}
        </if>
        <if test="content != null and content !=''">
            and content  like CONCAT('%','${content}','%' )
        </if>
        <if test="channelIds != null and channelIds !=''">
            and channel_ids  like CONCAT('%','${channelIds}','%' )
        </if>
        <if test="status != null">
            and status = #{status,jdbcType=INTEGER}
        </if>
        <if test="startTime != null">
            and start_time >= #{startTime,jdbcType=INTEGER}
        </if>

        <if test="endTime != null">
            <![CDATA[     and end_time <= #{endTime,jdbcType=INTEGER}]]>
        </if>
        order by id desc
        <if test="start != null and size !=null">
        limit #{start},#{size}
        </if>

    </select>

    <select id="selectCntBySearch" resultType="java.lang.Integer" parameterType="com.yohobuy.platform.model.search.req.SearchWordsQueryReq">
        select
        count(1)
        from search_terms
        where 1=1
        <if test="type != null">
            and type = #{type,jdbcType=SMALLINT}
        </if>
        <if test="content != null and content !=''">
            and content  like CONCAT('%','${content}','%' )
        </if>
        <if test="status != null">
            and status = #{status,jdbcType=INTEGER}
        </if>
        <if test="startTime != null">
            and start_time >= #{startTime,jdbcType=INTEGER}
        </if>
        <if test="channelIds != null and channelIds !=''">
            and channel_ids  like CONCAT('%','${channelIds}','%' )
        </if>
        <if test="endTime != null">
            <![CDATA[     and end_time <= #{endTime,jdbcType=INTEGER}]]>
        </if>

    </select>

错误编码


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

返回

{
  "code": 200,
  "data": {
    "list": [
      {
        "channelIds": "1,2",
        "content": "hhhgg",
        "creatorUid": 0,
        "creatorUsrname": "wxtest1",
        "id": 123,
        "modifyUid": 0,
        "modifyUsrname": "wxtest1",
        "status": 2,
        "type": 1,
        "url": "hhh"
      },
      {
        "channelIds": "1,2,3,4",
        "content": "aaaa",
        "creatorUid": 0,
        "creatorUsrname": "wxtest1",
        "id": 122,
        "status": 2,
        "type": 1,
        "url": "aaaaa"
      }
    ],
    "page": 1,
    "size": 2,
    "total": 18,
    "totalPage": 9
  },
  "md5": "3ead7bfd94211a4352e0edfb9d5afbf8",
  "message": "查询搜索词列表"
}