Commit ace1de95da5e74e805e63fd76ba1b25bf6a0e200

Authored by shiyang
1 parent d43f518ab3
Exists in master

首页-问诊统计

Showing 8 changed files with 239 additions and 2 deletions

talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/IndexController.java View file @ ace1de9
1 1 package com.lyms.talkonlineweb.controller;
2 2  
3 3 import com.lyms.talkonlineweb.domain.TkRecordStatHInfo;
  4 +import com.lyms.talkonlineweb.domain.TkRecordStatMInfo;
  5 +import com.lyms.talkonlineweb.domain.TkRecordStatWInfo;
  6 +import com.lyms.talkonlineweb.domain.TkRecordStatYInfo;
4 7 import com.lyms.talkonlineweb.result.BaseResponse;
5 8 import com.lyms.talkonlineweb.service.IndexService;
6 9 import com.lyms.talkonlineweb.service.TkRecordStatService;
... ... @@ -45,6 +48,42 @@
45 48 BaseResponse baseResponse=new BaseResponse();
46 49 List<TkRecordStatHInfo> tkRecordStatH = tkRecordStatService.getTkRecordStatH(hid);
47 50 baseResponse.setObject(tkRecordStatH);
  51 + return baseResponse;
  52 + }
  53 + /**
  54 + * 首页-本周问诊数量
  55 + * @param hid 不传默认返回所有医院本周问诊次数。
  56 + * @return
  57 + */
  58 + @GetMapping("getTkRecordStatW")
  59 + public BaseResponse getTkRecordStatW(Integer hid){
  60 + BaseResponse baseResponse=new BaseResponse();
  61 + List<TkRecordStatWInfo> tkRecordStatW = tkRecordStatService.getTkRecordStatW(hid);
  62 + baseResponse.setObject(tkRecordStatW);
  63 + return baseResponse;
  64 + }
  65 + /**
  66 + * 首页-本月问诊数量
  67 + * @param hid 不传默认返回所有医院本月问诊次数。
  68 + * @return
  69 + */
  70 + @GetMapping("getTkRecordStatM")
  71 + public BaseResponse getTkRecordStatM(Integer hid){
  72 + BaseResponse baseResponse=new BaseResponse();
  73 + List<TkRecordStatMInfo> tkRecordStatW = tkRecordStatService.getTkRecordStatM(hid);
  74 + baseResponse.setObject(tkRecordStatW);
  75 + return baseResponse;
  76 + }
  77 + /**
  78 + * 首页-本年问诊数量
  79 + * @param hid 不传默认返回所有医院本年问诊次数。
  80 + * @return
  81 + */
  82 + @GetMapping("getTkRecordStatY")
  83 + public BaseResponse getTkRecordStatY(Integer hid){
  84 + BaseResponse baseResponse=new BaseResponse();
  85 + List<TkRecordStatYInfo> tkRecordStatW = tkRecordStatService.getTkRecordStatY(hid);
  86 + baseResponse.setObject(tkRecordStatW);
48 87 return baseResponse;
49 88 }
50 89  
talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/TkRecordStatHInfo.java View file @ ace1de9
... ... @@ -25,7 +25,7 @@
25 25 private long tkhour;
26 26  
27 27 /**
28   - * 问诊次数
  28 + * 问诊
29 29 */
30 30 @TableField(value = "hcount")
31 31 private long hcount;
talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/TkRecordStatMInfo.java View file @ ace1de9
  1 +package com.lyms.talkonlineweb.domain;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.TableField;
  4 +import com.baomidou.mybatisplus.annotation.TableName;
  5 +import lombok.Data;
  6 +
  7 +/**
  8 + *首页-本周视图
  9 + * @TableName tkRecordStat_m_info
  10 + */
  11 +@Data
  12 +@TableName(value ="tkRecordStat_m_info")
  13 +public class TkRecordStatMInfo {
  14 +
  15 + /**
  16 + * 医院ID
  17 + */
  18 + @TableField(value = "hid")
  19 + private long hid;
  20 + /**
  21 + * 本月-天
  22 + */
  23 + @TableField(value = "days")
  24 + private long days;
  25 + /**
  26 + * 问诊量
  27 + */
  28 + @TableField(value = "dcount")
  29 + private long dcount;
  30 +
  31 +
  32 +
  33 +
  34 +}
talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/TkRecordStatWInfo.java View file @ ace1de9
  1 +package com.lyms.talkonlineweb.domain;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.TableField;
  4 +import com.baomidou.mybatisplus.annotation.TableName;
  5 +import lombok.Data;
  6 +
  7 +/**
  8 + *首页-本周视图
  9 + * @TableName tkRecordStat_w_info
  10 + */
  11 +@Data
  12 +@TableName(value ="tkRecordStat_w_info")
  13 +public class TkRecordStatWInfo {
  14 +
  15 + /**
  16 + * 医院ID
  17 + */
  18 + @TableField(value = "hid")
  19 + private long hid;
  20 + /**
  21 + * 星期0-6
  22 + */
  23 + @TableField(value = "theweek")
  24 + private long theweek;
  25 + /**
  26 + * 问诊量
  27 + */
  28 + @TableField(value = "dcount")
  29 + private long wcount;
  30 +
  31 +
  32 +
  33 +
  34 +}
talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/TkRecordStatYInfo.java View file @ ace1de9
  1 +package com.lyms.talkonlineweb.domain;
  2 +
  3 +
  4 +import com.baomidou.mybatisplus.annotation.TableField;
  5 +import com.baomidou.mybatisplus.annotation.TableName;
  6 +import lombok.Data;
  7 +
  8 +/**
  9 + *首页-本年视图
  10 + * @TableName tkRecordStat_y_info
  11 + */
  12 +@Data
  13 +@TableName(value ="tkRecordStat_y_info")
  14 +public class TkRecordStatYInfo {
  15 +
  16 + /**
  17 + * 医院ID
  18 + */
  19 + @TableField(value = "hid")
  20 + private long hid;
  21 + /**
  22 + * 月份
  23 + */
  24 + @TableField(value = "months")
  25 + private long months;
  26 + /**
  27 + * 问诊量
  28 + */
  29 + @TableField(value = "mcount")
  30 + private long mcount;
  31 +
  32 +
  33 +
  34 +
  35 +}
talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/TkRecordStatMapper.java View file @ ace1de9
... ... @@ -2,6 +2,9 @@
2 2  
3 3  
4 4 import com.lyms.talkonlineweb.domain.TkRecordStatHInfo;
  5 +import com.lyms.talkonlineweb.domain.TkRecordStatMInfo;
  6 +import com.lyms.talkonlineweb.domain.TkRecordStatWInfo;
  7 +import com.lyms.talkonlineweb.domain.TkRecordStatYInfo;
5 8 import org.apache.ibatis.annotations.Mapper;
6 9 import org.apache.ibatis.annotations.Param;
7 10 import org.apache.ibatis.annotations.Select;
8 11  
9 12  
10 13  
11 14  
... ... @@ -9,15 +12,79 @@
9 12 import java.util.List;
10 13  
11 14 @Mapper
  15 +
12 16 public interface TkRecordStatMapper {
13 17  
  18 + /**
  19 + * 今日问诊量
  20 + * @param hid
  21 + * @return
  22 + */
14 23 @Select({"<script>",
15   - "select hid,tkhour,hcount from tkRecordStat_h_info",
  24 + "select hid,hours,hcount from tkRecordStat_h_info",
16 25 "where 1=1",
17 26 "<when test='hid!=null'>",
18 27 "and hid=#{hid}",
19 28 "</when>",
  29 + "<when test='hid==null'>",
  30 + "GROUP BY hours",
  31 + "</when>",
  32 + "ORDER BY hours ASC",
20 33 "</script>"})
21 34 public List<TkRecordStatHInfo> getTkRecordStatH(@Param("hid") Integer hid);
  35 +
  36 + /**
  37 + * 本周问诊量
  38 + * @param hid
  39 + * @return
  40 + */
  41 + @Select({"<script>",
  42 + "select hid,theweek,dcount from tkRecordStat_w_info",
  43 + "where 1=1",
  44 + "<when test='hid!=null'>",
  45 + "and hid=#{hid}",
  46 + "</when>",
  47 + "<when test='hid==null'>",
  48 + "GROUP BY theweek",
  49 + "</when>",
  50 + "ORDER BY theweek ASC",
  51 + "</script>"})
  52 + List<TkRecordStatWInfo> getTkRecordStatW(@Param("hid") Integer hid);
  53 +
  54 + /**
  55 + * 本月问诊量
  56 + * @param hid
  57 + * @return
  58 + */
  59 + @Select({"<script>",
  60 + "select hid,days,dcount from tkRecordStat_m_info",
  61 + "where 1=1",
  62 + "<when test='hid!=null'>",
  63 + "and hid=#{hid}",
  64 + "</when>",
  65 + "<when test='hid==null'>",
  66 + "GROUP BY days",
  67 + "</when>",
  68 + "ORDER BY days ASC",
  69 + "</script>"})
  70 + List<TkRecordStatMInfo> getTkRecordStatM(@Param("hid") Integer hid);
  71 +
  72 + /**
  73 + * 本年问诊量
  74 + * @param hid
  75 + * @return
  76 + */
  77 + @Select({"<script>",
  78 + "select hid,months,mcount from tkRecordStat_y_info",
  79 + "where 1=1",
  80 + "<when test='hid!=null'>",
  81 + "and hid=#{hid}",
  82 + "</when>",
  83 + "<when test='hid==null'>",
  84 + "GROUP BY months",
  85 + "</when>",
  86 + "ORDER BY months ASC",
  87 + "</script>"})
  88 + List<TkRecordStatYInfo> getTkRecordStatY(@Param("hid") Integer hid);
22 89 }
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/TkRecordStatService.java View file @ ace1de9
1 1 package com.lyms.talkonlineweb.service;
2 2  
3 3 import com.lyms.talkonlineweb.domain.TkRecordStatHInfo;
  4 +import com.lyms.talkonlineweb.domain.TkRecordStatMInfo;
  5 +import com.lyms.talkonlineweb.domain.TkRecordStatWInfo;
  6 +import com.lyms.talkonlineweb.domain.TkRecordStatYInfo;
4 7 import org.springframework.stereotype.Service;
5 8  
6 9 import java.util.List;
... ... @@ -10,5 +13,10 @@
10 13  
11 14 List<TkRecordStatHInfo> getTkRecordStatH(Integer hid);
12 15  
  16 + List<TkRecordStatWInfo> getTkRecordStatW(Integer hid);
  17 +
  18 + List<TkRecordStatMInfo> getTkRecordStatM(Integer hid);
  19 +
  20 + List<TkRecordStatYInfo> getTkRecordStatY(Integer hid);
13 21 }
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/TkRecordStatServiceImpl.java View file @ ace1de9
1 1 package com.lyms.talkonlineweb.service.impl;
2 2  
3 3 import com.lyms.talkonlineweb.domain.TkRecordStatHInfo;
  4 +import com.lyms.talkonlineweb.domain.TkRecordStatMInfo;
  5 +import com.lyms.talkonlineweb.domain.TkRecordStatWInfo;
  6 +import com.lyms.talkonlineweb.domain.TkRecordStatYInfo;
4 7 import com.lyms.talkonlineweb.mapper.TkRecordStatMapper;
5 8 import com.lyms.talkonlineweb.service.TkRecordStatService;
  9 +import lombok.extern.log4j.Log4j2;
6 10 import org.springframework.beans.factory.annotation.Autowired;
7 11 import org.springframework.stereotype.Service;
8 12  
9 13 import java.util.List;
10 14  
11 15 @Service
  16 +@Log4j2
12 17 public class TkRecordStatServiceImpl implements TkRecordStatService {
13 18  
14 19 @Autowired
... ... @@ -18,6 +23,21 @@
18 23 @Override
19 24 public List<TkRecordStatHInfo> getTkRecordStatH(Integer hid) {
20 25 return tkRecordStatMapper.getTkRecordStatH(hid);
  26 + }
  27 +
  28 + @Override
  29 + public List<TkRecordStatWInfo> getTkRecordStatW(Integer hid) {
  30 + return tkRecordStatMapper.getTkRecordStatW(hid);
  31 + }
  32 +
  33 + @Override
  34 + public List<TkRecordStatMInfo> getTkRecordStatM(Integer hid) {
  35 + return tkRecordStatMapper.getTkRecordStatM(hid);
  36 + }
  37 +
  38 + @Override
  39 + public List<TkRecordStatYInfo> getTkRecordStatY(Integer hid) {
  40 + return tkRecordStatMapper.getTkRecordStatY(hid);
21 41 }
22 42 }