...
|
...
|
@@ -2,21 +2,126 @@ |
|
|
|
|
|
> 接口名: '/guang/article/getList'
|
|
|
|
|
|
### 方法
|
|
|
|
|
|
> POST JSONRAW
|
|
|
|
|
|
### 入参
|
|
|
|
|
|
-------------------------
|
|
|
|属性名称|类型|例子|说明|是否必填|长度限制|
|
|
|
|--------|----|----|----|----|----|
|
|
|
|articleTitle|String|尖货盘点|资讯标题||1-85|
|
|
|
|articleGender|String|1|性别||1-1|
|
|
|
|authorId|int|2890|作者ID||1-11|
|
|
|
|maxSortId|int|12|分类ID||1-11|
|
|
|
|status|int|1|资讯状态||1-1|
|
|
|
|orderBy|String|1|时间方式||12-13|
|
|
|
|startTime|String|2016-01-01|开始时间||10-10|
|
|
|
|endTime|String|2016-02-01|结束时间||10-10|
|
|
|
|articleTitle|String|尖货盘点|资讯标题|否|0-85|
|
|
|
|articleGender|String|1|性别|否|0-1|
|
|
|
|authorId|int|2890|作者ID|否|0-11|
|
|
|
|maxSortId|int|12|分类ID|否|0-11|
|
|
|
|status|int|1|资讯状态|否|0-1|
|
|
|
|orderBy|String|1|时间方式|否|0-13|
|
|
|
|startTime|String|2016-01-01|开始时间|否|0-10|
|
|
|
|endTime|String|2016-02-01|结束时间|否|0-10|
|
|
|
---------------------
|
|
|
|
|
|
### 对应SQL的操作库表
|
|
|
|
|
|
```xml
|
|
|
<select id="selectArticleList" resultMap="BaseResultMap">
|
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
|
|
from article where 1 = 1
|
|
|
<if test="article.articleTitle != null and article.articleTitle != ''" >
|
|
|
and article_title like CONCAT('%',#{article.articleTitle},'%')
|
|
|
</if>
|
|
|
<if test="article.articleGender != null and article.articleGender != ''" >
|
|
|
and article_gender = #{article.articleGender}
|
|
|
</if>
|
|
|
<if test="article.authorId != null and article.authorId != ''" >
|
|
|
and author_id = #{article.authorId}
|
|
|
</if>
|
|
|
<if test="article.tag != null and article.tag != ''" >
|
|
|
and tag = #{article.tag}
|
|
|
</if>
|
|
|
<if test="article.maxSortId != null and article.maxSortId != ''" >
|
|
|
and max_sort_id = #{article.maxSortId}
|
|
|
</if>
|
|
|
<if test="article.status != null and article.status == 0" >
|
|
|
and (publish_time > unix_timestamp(curdate()) or publish_time = 0)
|
|
|
</if>
|
|
|
<if test="article.status != null and article.status == 1" >
|
|
|
and unix_timestamp(curdate()) > publish_time and publish_time > 0
|
|
|
</if>
|
|
|
<if test="article.status != null and article.status == -1" >
|
|
|
and status = #{article.status}
|
|
|
</if>
|
|
|
<if test="article.createTime == 1 and startTime != null" >
|
|
|
and create_time > #{startTime}
|
|
|
</if>
|
|
|
<if test="article.createTime == 1 and endTime != null" >
|
|
|
and #{endTime} > create_time
|
|
|
</if>
|
|
|
<if test="article.publishTime == 1 and startTime != null" >
|
|
|
and publish_time > #{startTime}
|
|
|
</if>
|
|
|
<if test="article.publishTime == 1 and endTime != null" >
|
|
|
and #{endTime} > publish_time
|
|
|
</if>
|
|
|
<if test="orderBy != null and orderBy == 'create_time'" >
|
|
|
order by create_time desc
|
|
|
</if>
|
|
|
<if test="orderBy != null and orderBy == 'publish_time'" >
|
|
|
order by publish_time desc
|
|
|
</if>
|
|
|
limit #{offset}, #{limit}
|
|
|
</select>
|
|
|
<select id="selectArticleListCount" resultType="java.lang.Integer">
|
|
|
select ifnull(count(1),0)
|
|
|
from article where 1 = 1
|
|
|
<if test="article.articleTitle != null and article.articleTitle != ''" >
|
|
|
and article_title like CONCAT('%',#{article.articleTitle},'%')
|
|
|
</if>
|
|
|
<if test="article.articleGender != null and article.articleGender != ''" >
|
|
|
and article_gender = #{article.articleGender}
|
|
|
</if>
|
|
|
<if test="article.authorId != null and article.authorId != ''" >
|
|
|
and author_id = #{article.authorId}
|
|
|
</if>
|
|
|
<if test="article.tag != null and article.tag != ''" >
|
|
|
and tag = #{article.tag}
|
|
|
</if>
|
|
|
<if test="article.maxSortId != null and article.maxSortId != ''" >
|
|
|
and max_sort_id = #{article.maxSortId}
|
|
|
</if>
|
|
|
<if test="article.status != null and article.status == 0" >
|
|
|
and (publish_time > unix_timestamp(curdate()) or publish_time = 0)
|
|
|
</if>
|
|
|
<if test="article.status != null and article.status == 1" >
|
|
|
and unix_timestamp(curdate()) > publish_time and publish_time > 0
|
|
|
</if>
|
|
|
<if test="article.status != null and article.status == -1" >
|
|
|
and status = #{article.status}
|
|
|
</if>
|
|
|
<if test="article.createTime == 1 and startTime != null" >
|
|
|
and create_time > #{startTime}
|
|
|
</if>
|
|
|
<if test="article.createTime == 1 and endTime != null" >
|
|
|
and #{endTime} > create_time
|
|
|
</if>
|
|
|
<if test="article.publishTime == 1 and startTime != null" >
|
|
|
and publish_time > #{startTime}
|
|
|
</if>
|
|
|
<if test="article.publishTime == 1 and endTime != null" >
|
|
|
and #{endTime} > publish_time
|
|
|
</if>
|
|
|
</select>
|
|
|
```
|
|
|
|
|
|
### 错误编码
|
|
|
|
|
|
-------------------------
|
|
|
|错误码code|消息|说明|
|
|
|
|--------|----|----|
|
|
|
|400| 请求参数为空!| |
|
|
|
|200| 操作成功| |
|
|
|
|
|
|
### 返回
|
|
|
|
|
|
``` json
|
...
|
...
|
|