|
|
@ -147,12 +147,16 @@ public class ArticleSerivceImpl implements ArticleSerive {
|
|
|
|
Integer pageNum = jsonObject.getInteger("pageNum") == null ? 1 : jsonObject.getInteger("pageNum");
|
|
|
|
Integer pageNum = jsonObject.getInteger("pageNum") == null ? 1 : jsonObject.getInteger("pageNum");
|
|
|
|
Integer pageSize = jsonObject.getInteger("pageSize") == null ? 5 : jsonObject.getInteger("pageSize");
|
|
|
|
Integer pageSize = jsonObject.getInteger("pageSize") == null ? 5 : jsonObject.getInteger("pageSize");
|
|
|
|
String param = jsonObject.getString("param");
|
|
|
|
String param = jsonObject.getString("param");
|
|
|
|
|
|
|
|
String keyword = jsonObject.getString("keyword");
|
|
|
|
if (StringUtils.isNotEmpty(param)){
|
|
|
|
if (StringUtils.isNotEmpty(param)){
|
|
|
|
param = "%" + param + "%" ;
|
|
|
|
param = "%" + param + "%" ;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(keyword)){
|
|
|
|
|
|
|
|
keyword = "%" + keyword + "%" ;
|
|
|
|
|
|
|
|
}
|
|
|
|
Long firstCategory = jsonObject.getLong("firstCategory");
|
|
|
|
Long firstCategory = jsonObject.getLong("firstCategory");
|
|
|
|
Long secondCategory = jsonObject.getLong("secondCategory");
|
|
|
|
Long secondCategory = jsonObject.getLong("secondCategory");
|
|
|
|
List<ArticleVo> CategoryList = articleMapper.searchArticleListByCondition(param,firstCategory,secondCategory);
|
|
|
|
List<ArticleVo> CategoryList = articleMapper.searchArticleListByCondition(param,keyword,firstCategory,secondCategory);
|
|
|
|
JSONObject pageJson = PageUtils.page(CategoryList,pageNum,pageSize);
|
|
|
|
JSONObject pageJson = PageUtils.page(CategoryList,pageNum,pageSize);
|
|
|
|
return pageJson;
|
|
|
|
return pageJson;
|
|
|
|
}
|
|
|
|
}
|
|
|
|