Commit 53ed56314beff34e35030a31248922ef2bf747dd
Exists in
master
and in
1 other branch
Merge remote-tracking branch 'origin/master'
Showing 9 changed files
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/IndexController.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/TkRecordStatDateInfo.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/TkRecordStatHInfo.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/TkRecordStatMInfo.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/TkRecordStatWInfo.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/TkRecordStatYInfo.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/TkRecordStatMapper.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/TkRecordStatService.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/TkRecordStatServiceImpl.java
talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/IndexController.java
View file @
53ed563
| 1 | 1 | package com.lyms.talkonlineweb.controller; |
| 2 | 2 | |
| 3 | -import com.lyms.talkonlineweb.domain.TkRecordStatHInfo; | |
| 3 | +import com.lyms.talkonlineweb.domain.*; | |
| 4 | 4 | import com.lyms.talkonlineweb.result.BaseResponse; |
| 5 | 5 | import com.lyms.talkonlineweb.service.IndexService; |
| 6 | 6 | import com.lyms.talkonlineweb.service.TkRecordStatService; |
| ... | ... | @@ -37,7 +37,7 @@ |
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * 首页-今日问诊数量 |
| 40 | - * @param hid 不传默认返回所有医院今日问诊次数。 | |
| 40 | + * @param hid 不传默认返回所有医院今日问诊量。 | |
| 41 | 41 | * @return |
| 42 | 42 | */ |
| 43 | 43 | @GetMapping("getTkRecordStatH") |
| ... | ... | @@ -45,6 +45,54 @@ |
| 45 | 45 | BaseResponse baseResponse=new BaseResponse(); |
| 46 | 46 | List<TkRecordStatHInfo> tkRecordStatH = tkRecordStatService.getTkRecordStatH(hid); |
| 47 | 47 | baseResponse.setObject(tkRecordStatH); |
| 48 | + return baseResponse; | |
| 49 | + } | |
| 50 | + /** | |
| 51 | + * 首页-本周问诊数量 | |
| 52 | + * @param hid 不传默认返回所有医院本周问诊量。 | |
| 53 | + * @return | |
| 54 | + */ | |
| 55 | + @GetMapping("getTkRecordStatW") | |
| 56 | + public BaseResponse getTkRecordStatW(Integer hid){ | |
| 57 | + BaseResponse baseResponse=new BaseResponse(); | |
| 58 | + List<TkRecordStatWInfo> tkRecordStatW = tkRecordStatService.getTkRecordStatW(hid); | |
| 59 | + baseResponse.setObject(tkRecordStatW); | |
| 60 | + return baseResponse; | |
| 61 | + } | |
| 62 | + /** | |
| 63 | + * 首页-本月问诊数量 | |
| 64 | + * @param hid 不传默认返回所有医院本月问诊量。 | |
| 65 | + * @return | |
| 66 | + */ | |
| 67 | + @GetMapping("getTkRecordStatM") | |
| 68 | + public BaseResponse getTkRecordStatM(Integer hid){ | |
| 69 | + BaseResponse baseResponse=new BaseResponse(); | |
| 70 | + List<TkRecordStatMInfo> tkRecordStatW = tkRecordStatService.getTkRecordStatM(hid); | |
| 71 | + baseResponse.setObject(tkRecordStatW); | |
| 72 | + return baseResponse; | |
| 73 | + } | |
| 74 | + /** | |
| 75 | + * 首页-本年问诊数量 | |
| 76 | + * @param hid 不传默认返回所有医院本年问诊量。 | |
| 77 | + * @return | |
| 78 | + */ | |
| 79 | + @GetMapping("getTkRecordStatY") | |
| 80 | + public BaseResponse getTkRecordStatY(Integer hid){ | |
| 81 | + BaseResponse baseResponse=new BaseResponse(); | |
| 82 | + List<TkRecordStatYInfo> tkRecordStatW = tkRecordStatService.getTkRecordStatY(hid); | |
| 83 | + baseResponse.setObject(tkRecordStatW); | |
| 84 | + return baseResponse; | |
| 85 | + } | |
| 86 | + /** | |
| 87 | + * 首页-日期筛选问诊量 | |
| 88 | + * @param hid 不传默认返回所有医院日起筛选问诊量。 | |
| 89 | + * @return | |
| 90 | + */ | |
| 91 | + @GetMapping("getTkRecordStatDate") | |
| 92 | + public BaseResponse getTkRecordStatDate(String startdate,String enddate,Integer hid){ | |
| 93 | + BaseResponse baseResponse=new BaseResponse(); | |
| 94 | + List<TkRecordStatDateInfo> tkRecordStatW = tkRecordStatService.getTkRecordStatDate(startdate,enddate,hid); | |
| 95 | + baseResponse.setObject(tkRecordStatW); | |
| 48 | 96 | return baseResponse; |
| 49 | 97 | } |
| 50 | 98 |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/TkRecordStatDateInfo.java
View file @
53ed563
| 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_date_info | |
| 10 | + */ | |
| 11 | +@Data | |
| 12 | +@TableName(value ="tkRecordStat_date_info") | |
| 13 | +public class TkRecordStatDateInfo { | |
| 14 | + | |
| 15 | + /** | |
| 16 | + * 医院ID | |
| 17 | + */ | |
| 18 | + @TableField(value = "hid") | |
| 19 | + private long hid; | |
| 20 | + /** | |
| 21 | + * 筛选日期 | |
| 22 | + */ | |
| 23 | + @TableField(value = "days") | |
| 24 | + private String days; | |
| 25 | + /** | |
| 26 | + * 问诊量 | |
| 27 | + */ | |
| 28 | + @TableField(value = "dcount") | |
| 29 | + private long dcount; | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | +} |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/TkRecordStatHInfo.java
View file @
53ed563
talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/TkRecordStatMInfo.java
View file @
53ed563
| 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 @
53ed563
| 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 @
53ed563
| 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 @
53ed563
| 1 | 1 | package com.lyms.talkonlineweb.mapper; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | -import com.lyms.talkonlineweb.domain.TkRecordStatHInfo; | |
| 4 | +import com.lyms.talkonlineweb.domain.*; | |
| 5 | 5 | import org.apache.ibatis.annotations.Mapper; |
| 6 | 6 | import org.apache.ibatis.annotations.Param; |
| 7 | 7 | import org.apache.ibatis.annotations.Select; |
| 8 | 8 | |
| 9 | 9 | |
| 10 | 10 | |
| 11 | 11 | |
| ... | ... | @@ -9,15 +9,153 @@ |
| 9 | 9 | import java.util.List; |
| 10 | 10 | |
| 11 | 11 | @Mapper |
| 12 | + | |
| 12 | 13 | public interface TkRecordStatMapper { |
| 13 | 14 | |
| 15 | + /** | |
| 16 | + * 今日问诊量 | |
| 17 | + * @param hid | |
| 18 | + * @return | |
| 19 | + */ | |
| 14 | 20 | @Select({"<script>", |
| 15 | - "select hid,tkhour,hcount from tkRecordStat_h_info", | |
| 21 | + "select hid,hours ", | |
| 22 | + "<choose>", | |
| 23 | + "<when test='hid!=null'>", | |
| 24 | + ",hcount ", | |
| 25 | + "</when>", | |
| 26 | + "<otherwise>", | |
| 27 | + ",sum(hcount) as hcount ", | |
| 28 | + "</otherwise>", | |
| 29 | + "</choose>", | |
| 30 | + "from tkRecordStat_h_info", | |
| 16 | 31 | "where 1=1", |
| 17 | - "<when test='hid!=null'>", | |
| 18 | - "and hid=#{hid}", | |
| 19 | - "</when>", | |
| 32 | + "<choose>", | |
| 33 | + "<when test='hid!=null'>", | |
| 34 | + "and hid=#{hid}", | |
| 35 | + "</when>", | |
| 36 | + "<otherwise>", | |
| 37 | + "GROUP BY hours", | |
| 38 | + "</otherwise>", | |
| 39 | + "</choose>", | |
| 40 | + "ORDER BY hours ASC", | |
| 20 | 41 | "</script>"}) |
| 21 | 42 | public List<TkRecordStatHInfo> getTkRecordStatH(@Param("hid") Integer hid); |
| 43 | + | |
| 44 | + /** | |
| 45 | + * 本周问诊量 | |
| 46 | + * @param hid | |
| 47 | + * @return | |
| 48 | + */ | |
| 49 | + @Select({"<script>", | |
| 50 | + "select hid,theweek ", | |
| 51 | + "<choose>", | |
| 52 | + "<when test='hid!=null'>", | |
| 53 | + ",dcount ", | |
| 54 | + "</when>", | |
| 55 | + "<otherwise>", | |
| 56 | + ",sum(dcount) as dcount ", | |
| 57 | + "</otherwise>", | |
| 58 | + "</choose>", | |
| 59 | + "from tkRecordStat_w_info", | |
| 60 | + "where 1=1", | |
| 61 | + "<choose>", | |
| 62 | + "<when test='hid!=null'>", | |
| 63 | + "and hid=#{hid}", | |
| 64 | + "</when>", | |
| 65 | + "<otherwise>", | |
| 66 | + "GROUP BY theweek", | |
| 67 | + "</otherwise>", | |
| 68 | + "</choose>", | |
| 69 | + "ORDER BY theweek ASC", | |
| 70 | + "</script>"}) | |
| 71 | + List<TkRecordStatWInfo> getTkRecordStatW(@Param("hid") Integer hid); | |
| 72 | + | |
| 73 | + /** | |
| 74 | + * 本月问诊量 | |
| 75 | + * @param hid | |
| 76 | + * @return | |
| 77 | + */ | |
| 78 | + @Select({"<script>", | |
| 79 | + "select hid,days ", | |
| 80 | + "<choose>", | |
| 81 | + "<when test='hid!=null'>", | |
| 82 | + ",dcount ", | |
| 83 | + "</when>", | |
| 84 | + "<otherwise>", | |
| 85 | + ",sum(dcount) as dcount ", | |
| 86 | + "</otherwise>", | |
| 87 | + "</choose>", | |
| 88 | + "from tkRecordStat_m_info", | |
| 89 | + "where 1=1", | |
| 90 | + "<choose>", | |
| 91 | + "<when test='hid!=null'>", | |
| 92 | + "and hid=#{hid}", | |
| 93 | + "</when>", | |
| 94 | + "<otherwise>", | |
| 95 | + "GROUP BY days", | |
| 96 | + "</otherwise>", | |
| 97 | + "</choose>", | |
| 98 | + "ORDER BY days ASC", | |
| 99 | + "</script>"}) | |
| 100 | + List<TkRecordStatMInfo> getTkRecordStatM(@Param("hid") Integer hid); | |
| 101 | + | |
| 102 | + /** | |
| 103 | + * 本年问诊量 | |
| 104 | + * @param hid | |
| 105 | + * @return | |
| 106 | + */ | |
| 107 | + @Select({"<script>", | |
| 108 | + "select hid,months ", | |
| 109 | + "<choose>", | |
| 110 | + "<when test='hid!=null'>", | |
| 111 | + ",mcount ", | |
| 112 | + "</when>", | |
| 113 | + "<otherwise>", | |
| 114 | + ",sum(mcount) as mcount ", | |
| 115 | + "</otherwise>", | |
| 116 | + "</choose>", | |
| 117 | + "from tkRecordStat_y_info", | |
| 118 | + "where 1=1", | |
| 119 | + "<choose>", | |
| 120 | + "<when test='hid!=null'>", | |
| 121 | + "and hid=#{hid}", | |
| 122 | + "</when>", | |
| 123 | + "<otherwise>", | |
| 124 | + "GROUP BY months", | |
| 125 | + "</otherwise>", | |
| 126 | + "</choose>", | |
| 127 | + "ORDER BY months ASC", | |
| 128 | + "</script>"}) | |
| 129 | + List<TkRecordStatYInfo> getTkRecordStatY(@Param("hid") Integer hid); | |
| 130 | + /** | |
| 131 | + * 日期筛选问诊量 | |
| 132 | + * @param hid | |
| 133 | + * @return | |
| 134 | + */ | |
| 135 | + @Select({"<script>", | |
| 136 | + "select hid,days", | |
| 137 | + "<choose>", | |
| 138 | + "<when test='hid!=null'>", | |
| 139 | + ",dcount ", | |
| 140 | + "</when>", | |
| 141 | + "<otherwise>", | |
| 142 | + ",sum(dcount) as dcount ", | |
| 143 | + "</otherwise>", | |
| 144 | + "</choose>", | |
| 145 | + "from tkRecordStat_date_info", | |
| 146 | + "where 1=1", | |
| 147 | + "<![CDATA[ and DATE(days)>=DATE(#{startdate}) and DATE(days)<=DATE(#{enddate}) ]]>", | |
| 148 | + "<choose>", | |
| 149 | + "<when test='hid!=null'>", | |
| 150 | + "and hid=#{hid}", | |
| 151 | + "</when>", | |
| 152 | + "<otherwise>", | |
| 153 | + "GROUP BY days", | |
| 154 | + "</otherwise>", | |
| 155 | + "</choose>", | |
| 156 | + "ORDER BY days ASC", | |
| 157 | + "</script>"}) | |
| 158 | + List<TkRecordStatDateInfo> getTkRecordStatDate(@Param("startdate") String startdate,@Param("enddate") String enddate,@Param("hid") Integer hid); | |
| 159 | + | |
| 22 | 160 | } |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/TkRecordStatService.java
View file @
53ed563
| 1 | 1 | package com.lyms.talkonlineweb.service; |
| 2 | 2 | |
| 3 | -import com.lyms.talkonlineweb.domain.TkRecordStatHInfo; | |
| 3 | +import com.lyms.talkonlineweb.domain.*; | |
| 4 | 4 | import org.springframework.stereotype.Service; |
| 5 | 5 | |
| 6 | 6 | import java.util.List; |
| ... | ... | @@ -10,5 +10,12 @@ |
| 10 | 10 | |
| 11 | 11 | List<TkRecordStatHInfo> getTkRecordStatH(Integer hid); |
| 12 | 12 | |
| 13 | + List<TkRecordStatWInfo> getTkRecordStatW(Integer hid); | |
| 14 | + | |
| 15 | + List<TkRecordStatMInfo> getTkRecordStatM(Integer hid); | |
| 16 | + | |
| 17 | + List<TkRecordStatYInfo> getTkRecordStatY(Integer hid); | |
| 18 | + | |
| 19 | + List<TkRecordStatDateInfo> getTkRecordStatDate(String startdate, String enddate, Integer hid); | |
| 13 | 20 | } |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/TkRecordStatServiceImpl.java
View file @
53ed563
| 1 | 1 | package com.lyms.talkonlineweb.service.impl; |
| 2 | 2 | |
| 3 | -import com.lyms.talkonlineweb.domain.TkRecordStatHInfo; | |
| 3 | +import com.lyms.talkonlineweb.domain.*; | |
| 4 | 4 | import com.lyms.talkonlineweb.mapper.TkRecordStatMapper; |
| 5 | 5 | import com.lyms.talkonlineweb.service.TkRecordStatService; |
| 6 | +import lombok.extern.log4j.Log4j2; | |
| 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | 8 | import org.springframework.stereotype.Service; |
| 8 | 9 | |
| 9 | 10 | import java.util.List; |
| 10 | 11 | |
| 11 | 12 | @Service |
| 13 | +@Log4j2 | |
| 12 | 14 | public class TkRecordStatServiceImpl implements TkRecordStatService { |
| 13 | 15 | |
| 14 | 16 | @Autowired |
| ... | ... | @@ -18,6 +20,26 @@ |
| 18 | 20 | @Override |
| 19 | 21 | public List<TkRecordStatHInfo> getTkRecordStatH(Integer hid) { |
| 20 | 22 | return tkRecordStatMapper.getTkRecordStatH(hid); |
| 23 | + } | |
| 24 | + | |
| 25 | + @Override | |
| 26 | + public List<TkRecordStatWInfo> getTkRecordStatW(Integer hid) { | |
| 27 | + return tkRecordStatMapper.getTkRecordStatW(hid); | |
| 28 | + } | |
| 29 | + | |
| 30 | + @Override | |
| 31 | + public List<TkRecordStatMInfo> getTkRecordStatM(Integer hid) { | |
| 32 | + return tkRecordStatMapper.getTkRecordStatM(hid); | |
| 33 | + } | |
| 34 | + | |
| 35 | + @Override | |
| 36 | + public List<TkRecordStatYInfo> getTkRecordStatY(Integer hid) { | |
| 37 | + return tkRecordStatMapper.getTkRecordStatY(hid); | |
| 38 | + } | |
| 39 | + | |
| 40 | + @Override | |
| 41 | + public List<TkRecordStatDateInfo> getTkRecordStatDate(String startdate, String enddate, Integer hid) { | |
| 42 | + return tkRecordStatMapper.getTkRecordStatDate(startdate, enddate, hid); | |
| 21 | 43 | } |
| 22 | 44 | } |