Commit 440c8ca9 by rongkailun

【新增】相关链接接口

parent beeb48fa
......@@ -463,4 +463,13 @@ public class NewsController extends AbstractController {
NewtopicEntity newtopic = newtopicService.getById(id);
return R.ok().put("data", newtopic);
}
/**相关链接*/
@Login
@GetMapping("/api/relatedLinks")
public R relatedLinks(@RequestParam Map<String,Object> params) {
List<NewsEntity> list = this.newsService.relatedLinks(params);
return R.ok().put("data", list);
}
}
......@@ -90,4 +90,6 @@ public interface NewsDao extends BaseMapper<NewsEntity> {
List<NewsEntity> syzxphList();
List<NewtopicEntity> zttjList();
List<NewsEntity> relatedLinks(Map<String, Object> params);
}
......@@ -88,5 +88,7 @@ public interface NewsService extends IService<NewsEntity> {
List<NewsEntity> syzxphList();
List<NewtopicEntity> zttjList();
List<NewsEntity> relatedLinks(Map<String, Object> params);
}
......@@ -501,6 +501,12 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
return list;
}
@Override
public List<NewsEntity> relatedLinks(Map<String, Object> params) {
List<NewsEntity> list = this.newsDao.relatedLinks(params);
return list;
}
private List<Map<String, Object>> getDataListNew(Map<String, Object> map, Page page) {
List<Map<String,Object>> list = this.newsDao.searchKnowledgeInfoNewList(map,page);
return list;
......
......@@ -593,4 +593,16 @@ ORDER BY
<select id="zttjList" resultType="io.office.modules.manage.entity.NewtopicEntity">
select top 10 * from NewTopic where levels>0 and parentid=0 and checkflag=1 order by levels desc,classid desc
</select>
<select id="relatedLinks" resultType="io.office.modules.manage.entity.NewsEntity">
SELECT
TOP 10 *
FROM
news
WHERE
levels > 0
AND status = 1
AND Id != #{id}
AND keyword LIKE concat ('%', #{keyword}, '%')
order by releasedate desc
</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