Commit 3acbb7e0 by rongkailun

【新增】知识检索新增分页接口

parent aacc9510
......@@ -391,5 +391,15 @@ public class NewsController extends AbstractController {
return R.ok().put("data", list);
}
/**知识检索分页列表*/
@Login
@PostMapping("/api/searchKnowledgePageList")
public R searchKnowledgePageList(@RequestBody NewsParams params) {
Page<List<Map<String, Object>>> page = this.newsService.searchKnowledgePageList(params,
new Page(params.getPage(), params.getLimit()));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
}
......@@ -74,4 +74,5 @@ public interface NewsDao extends BaseMapper<NewsEntity> {
List<NewsEntity> newsTop10();
List<Map<String, Object>> searchKnowledgeInfoNewList(@Param("params") Map<String, Object> map, Page page);
}
......@@ -73,5 +73,6 @@ public interface NewsService extends IService<NewsEntity> {
List<NewsEntity> newsTop10();
Page<List<Map<String, Object>>> searchKnowledgePageList(NewsParams params, Page page);
}
......@@ -364,6 +364,106 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
return list;
}
@Override
public Page<List<Map<String, Object>>> searchKnowledgePageList(NewsParams newsParams, Page page) {
Map<String,Object> map = new HashMap<>();
if("sptm".equals(newsParams.getType())){
map = new HashMap<>();
map.put("name","40");
List<String> child = getChild(map);
map.put("list",child);
map.put("typeName","sptm");
map.put("title",newsParams.getTitle());
List<Map<String, Object>> dataList = getDataListNew(map,page);
page.setRecords(dataList);
}else if("ewtm".equals(newsParams.getType())){
map = new HashMap<>();
map.put("name","45");
map.put("title",newsParams.getTitle());
List<String> child = getChild(map);
map.put("list",child);
map.put("typeName","ewtm");
List<Map<String, Object>> dataList = getDataListNew(map,page);
page.setRecords(dataList);
}else if("zxcbm".equals(newsParams.getType())){
map = new HashMap<>();
map.put("name","93");
map.put("title",newsParams.getTitle());
List<String> child = getChild(map);
map.put("list",child);
map.put("typeName","zxcbm");
List<Map<String, Object>> dataList = getDataListNew(map,page);
page.setRecords(dataList);
}else if("dwbm".equals(newsParams.getType())){
map = new HashMap<>();
map.put("name","94");
map.put("title",newsParams.getTitle());
List<String> child = getChild(map);
map.put("list",child);
map.put("title","dwbm");
List<Map<String, Object>> dataList = getDataListNew(map,page);
page.setRecords(dataList);
}else if("gln".equals(newsParams.getType())){
map = new HashMap<>();
map.put("name","95");
map.put("title",newsParams.getTitle());
List<String> child = getChild(map);
map.put("list",child);
map.put("typeName","gln");
List<Map<String, Object>> dataList = getDataListNew(map,page);
page.setRecords(dataList);
}else if("epc".equals(newsParams.getType())){
map = new HashMap<>();
map.put("name","83");
map.put("title",newsParams.getTitle());
List<String> child = getChild(map);
map.put("list",child);
List<Map<String, Object>> dataList = getDataListNew(map,page);
page.setRecords(dataList);
}else if("rfid".equals(newsParams.getType())){
map = new HashMap<>();
map.put("name","77");
map.put("title",newsParams.getTitle());
List<String> child = getChild(map);
map.put("list",child);
List<Map<String, Object>> dataList = getDataListNew(map,page);
page.setRecords(dataList);
}else if("gds".equals(newsParams.getType())){
map = new HashMap<>();
map.put("name","85");
map.put("title",newsParams.getTitle());
List<String> child = getChild(map);
map.put("list",child);
map.put("typeName","gds");
List<Map<String, Object>> dataList = getDataListNew(map,page);
page.setRecords(dataList);
}else if("ecr".equals(newsParams.getType())){
map = new HashMap<>();
map.put("name","81");
map.put("title",newsParams.getTitle());
List<String> child = getChild(map);
map.put("list",child);
map.put("typeName","ecr");
List<Map<String, Object>> dataList = getDataListNew(map,page);
page.setRecords(dataList);
}else if("ebXML".equals(newsParams.getType())){
map = new HashMap<>();
map.put("name","79");
map.put("title",newsParams.getTitle());
List<String> child = getChild(map);
map.put("list",child);
map.put("typeName","ebXML");
List<Map<String, Object>> dataList = getDataListNew(map,page);
page.setRecords(dataList);
}
return page;
}
private List<Map<String, Object>> getDataListNew(Map<String, Object> map, Page page) {
List<Map<String,Object>> list = this.newsDao.searchKnowledgeInfoNewList(map,page);
return list;
}
private List<Map<String,Object>> getDataList(Map<String, Object> map) {
List<Map<String,Object>> list = this.newsDao.searchKnowledgeInfo(map);
return list;
......
......@@ -478,4 +478,19 @@
ORDER BY
hits DESC
</select>
<select id="searchKnowledgeInfoNewList" resultType="java.util.Map">
SELECT
Title,knowledgeInfoID,#{params.typeName} as type
FROM
knowledgeInfo t
LEFT JOIN knowledgeCategory tt ON t.knowledgeCategoryID = tt.knowledgeCategoryID
where 1=1
<if test="params.title !=null and params.title !=''">
and t.Title like concat(concat('%',#{title}),'%')
</if>
and t.knowledgeCategoryID in
<foreach collection="params.list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment