Commit 2c6eded7f5221eb5b5302d8466c657dfaf7775ed
1 parent
c00d533682
Exists in
master
专家组推荐统计
Showing 4 changed files with 46 additions and 0 deletions
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/ArticleController.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsArticleMapper.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsArticleService.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsArticleServiceImpl.java
talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/ArticleController.java
View file @
2c6eded
| ... | ... | @@ -156,5 +156,19 @@ |
| 156 | 156 | return baseResponse; |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | + /** | |
| 160 | + * 专家组推荐统计 | |
| 161 | + * @return | |
| 162 | + */ | |
| 163 | + @GetMapping("getArtPushStat") | |
| 164 | + public BaseResponse getArtPushStat(){ | |
| 165 | + BaseResponse baseResponse=new BaseResponse(); | |
| 166 | + | |
| 167 | + Map<String, Object> pMap = lymsArticleService.getArtPushStat(); | |
| 168 | + baseResponse.setObject(pMap); | |
| 169 | + | |
| 170 | + return baseResponse; | |
| 171 | + } | |
| 172 | + | |
| 159 | 173 | } |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsArticleMapper.java
View file @
2c6eded
| ... | ... | @@ -2,6 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | import com.lyms.talkonlineweb.domain.LymsArticle; |
| 4 | 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| 5 | +import com.sun.corba.se.impl.ior.OldJIDLObjectKeyTemplate; | |
| 5 | 6 | import org.apache.ibatis.annotations.Select; |
| 6 | 7 | |
| 7 | 8 | import java.util.List; |
| ... | ... | @@ -17,5 +18,15 @@ |
| 17 | 18 | |
| 18 | 19 | @Select("SELECT COUNT(1) allcnt,SUM(CASE WHEN DATE(a.`createdtime`)=DATE(NOW()) THEN 1 END) ncnt FROM lyms_article a") |
| 19 | 20 | List<Map<String, Object>> getArtStat(); |
| 21 | + | |
| 22 | +// 今日推荐 | |
| 23 | + @Select("SELECT COUNT(1) cnt FROM lyms_pushedart WHERE DATE(createdtime)=DATE(NOW())") | |
| 24 | + Map<String, Object> todayPush(); | |
| 25 | +// 今日已读 | |
| 26 | + @Select("SELECT COUNT(1) cnt FROM lyms_pushedart WHERE DATE(createdtime)=DATE(NOW()) AND isread=1") | |
| 27 | + Map<String, Object> todayRead(); | |
| 28 | + | |
| 29 | + @Select("SELECT COUNT(1) cnt FROM lyms_pushedart") | |
| 30 | + Map<String, Object> sumPush(); | |
| 20 | 31 | } |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsArticleService.java
View file @
2c6eded
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsArticleServiceImpl.java
View file @
2c6eded
| ... | ... | @@ -7,6 +7,8 @@ |
| 7 | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | 8 | import org.springframework.stereotype.Service; |
| 9 | 9 | |
| 10 | +import java.util.ArrayList; | |
| 11 | +import java.util.HashMap; | |
| 10 | 12 | import java.util.List; |
| 11 | 13 | import java.util.Map; |
| 12 | 14 | |
| ... | ... | @@ -28,6 +30,23 @@ |
| 28 | 30 | @Override |
| 29 | 31 | public List<Map<String, Object>> getArtStat() { |
| 30 | 32 | return lymsArticleMapper.getArtStat(); |
| 33 | + } | |
| 34 | + | |
| 35 | + @Override | |
| 36 | + public Map<String, Object> getArtPushStat() { | |
| 37 | + Map<String, Object> rs=new HashMap<>(); | |
| 38 | + //今日推荐 | |
| 39 | + Map<String, Object> todayPush=lymsArticleMapper.todayPush(); | |
| 40 | + rs.put("todayPush",todayPush.get("cnt")); | |
| 41 | + | |
| 42 | + Map<String,Object> todayRead=lymsArticleMapper.todayRead(); | |
| 43 | + rs.put("todayRead",todayRead.get("cnt")); | |
| 44 | + | |
| 45 | + Map<String,Object> sumPush=lymsArticleMapper.sumPush(); | |
| 46 | + rs.put("sumPush",sumPush.get("cnt")); | |
| 47 | + | |
| 48 | + | |
| 49 | + return rs; | |
| 31 | 50 | } |
| 32 | 51 | } |