Commit dbc859d3 by rongkailun

【新增】资讯排行top10

parent fa1e12e9
......@@ -383,4 +383,13 @@ public class NewsController extends AbstractController {
KnowledgeinfoEntity retMap = this.knowledgeinfoService.getById(id);
return R.ok().put("data", retMap);
}
/**资讯排行TOP10*/
@Login
@GetMapping("/api/newsTop10")
public R newsTop10() {
List<NewsEntity> list = this.newsService.newsTop10();
return R.ok().put("data", list);
}
}
......@@ -71,4 +71,7 @@ public interface NewsDao extends BaseMapper<NewsEntity> {
List<Map<String, Object>> searchKnowledgeInfoList();
List<Map<String, Object>> hotList();
List<NewsEntity> newsTop10();
}
......@@ -70,5 +70,8 @@ public interface NewsService extends IService<NewsEntity> {
List<Map<String, Object>> searchKnowledgeInfoList();
List<Map<String, Object>> hotList();
List<NewsEntity> newsTop10();
}
......@@ -353,6 +353,12 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
return list;
}
@Override
public List<NewsEntity> newsTop10() {
List<NewsEntity> list = this.newsDao.newsTop10();
return list;
}
private List<Map<String,Object>> getDataList(Map<String, Object> map) {
List<Map<String,Object>> list = this.newsDao.searchKnowledgeInfo(map);
return list;
......
......@@ -31,6 +31,12 @@
<result property="showtime" column="showtime"/>
<result property="checkdate" column="checkdate"/>
</resultMap>
<select id="newsTop10" resultMap="newsMap">
select top 10 title,id from news where 1=1 and levels > 0
and status = '1'
and datediff(month, releasedate,getdate())=0
order by hits desc
</select>
<!--查询新闻列表-->
<select id="selectNewsList" resultMap="newsMap" parameterType="io.office.modules.manage.entity.dto.NewsParams">
......
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