From 840aa3c2cf64384f2e1ef87a35618de5127d5114 Mon Sep 17 00:00:00 2001 From: shiyang Date: Mon, 13 Sep 2021 20:29:09 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5-=E4=BB=8A=E6=97=A5=E9=97=AE?= =?UTF-8?q?=E8=AF=8A=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../talkonlineweb/controller/IndexController.java | 17 ++++++++-- .../talkonlineweb/domain/TkRecordStatHInfo.java | 36 ++++++++++++++++++++++ .../talkonlineweb/mapper/TkRecordStatMapper.java | 22 +++++++++++++ .../talkonlineweb/service/TkRecordStatService.java | 13 ++++++++ .../service/impl/TkRecordStatServiceImpl.java | 22 +++++++++++++ .../main/resources/mapper/TkRecordStatMapper.xml | 9 ++++++ 6 files changed, 116 insertions(+), 3 deletions(-) create mode 100644 talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/TkRecordStatHInfo.java create mode 100644 talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/TkRecordStatMapper.java create mode 100644 talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/TkRecordStatService.java create mode 100644 talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/TkRecordStatServiceImpl.java create mode 100644 talkonlineweb/src/main/resources/mapper/TkRecordStatMapper.xml diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/IndexController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/IndexController.java index a752d02..efbd7d8 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/IndexController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/IndexController.java @@ -1,12 +1,15 @@ package com.lyms.talkonlineweb.controller; +import com.lyms.talkonlineweb.domain.TkRecordStatHInfo; import com.lyms.talkonlineweb.result.BaseResponse; import com.lyms.talkonlineweb.service.IndexService; +import com.lyms.talkonlineweb.service.TkRecordStatService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; import java.util.Map; @RestController @@ -16,6 +19,9 @@ public class IndexController { @Autowired private IndexService indexService; + @Autowired + private TkRecordStatService tkRecordStatService; + /** * 访问统计 * @return @@ -28,12 +34,17 @@ public class IndexController { baseResponse.setObject(rs); return baseResponse; } + /** - * + * 首页-今日问诊数量 + * @param hid 不传默认返回所有医院今日问诊次数。 + * @return */ - @GetMapping("getTkRecordStat") - public BaseResponse getTkRecordStat(){ + @GetMapping("getTkRecordStatH") + public BaseResponse getTkRecordStatH(Integer hid){ BaseResponse baseResponse=new BaseResponse(); + List tkRecordStatH = tkRecordStatService.getTkRecordStatH(hid); + baseResponse.setObject(tkRecordStatH); return baseResponse; } diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/TkRecordStatHInfo.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/TkRecordStatHInfo.java new file mode 100644 index 0000000..4495ae8 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/TkRecordStatHInfo.java @@ -0,0 +1,36 @@ +package com.lyms.talkonlineweb.domain; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + *首页-今日视图 + * @TableName tkRecordStat_h_info + */ +@TableName(value ="tkRecordStat_h_info") +@Data +public class TkRecordStatHInfo { + + /** + * 医院ID + */ + @TableField(value = "hid") + private long hid; + + /** + * 问诊时间-小时 + */ + @TableField(value = "tkhour") + private long tkhour; + + /** + * 问诊次数 + */ + @TableField(value = "hcount") + private long hcount; + + + + +} diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/TkRecordStatMapper.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/TkRecordStatMapper.java new file mode 100644 index 0000000..d45f2af --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/TkRecordStatMapper.java @@ -0,0 +1,22 @@ +package com.lyms.talkonlineweb.mapper; + + +import com.lyms.talkonlineweb.domain.TkRecordStatHInfo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +@Mapper +public interface TkRecordStatMapper { + + @Select({""}) + public List getTkRecordStatH(@Param("hid") Integer hid); +} diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/TkRecordStatService.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/TkRecordStatService.java new file mode 100644 index 0000000..fb02709 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/TkRecordStatService.java @@ -0,0 +1,13 @@ +package com.lyms.talkonlineweb.service; + +import com.lyms.talkonlineweb.domain.TkRecordStatHInfo; +import org.springframework.stereotype.Service; + +import java.util.List; + + +public interface TkRecordStatService { + + List getTkRecordStatH(Integer hid); + +} diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/TkRecordStatServiceImpl.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/TkRecordStatServiceImpl.java new file mode 100644 index 0000000..c39da8c --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/TkRecordStatServiceImpl.java @@ -0,0 +1,22 @@ +package com.lyms.talkonlineweb.service.impl; + +import com.lyms.talkonlineweb.domain.TkRecordStatHInfo; +import com.lyms.talkonlineweb.mapper.TkRecordStatMapper; +import com.lyms.talkonlineweb.service.TkRecordStatService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class TkRecordStatServiceImpl implements TkRecordStatService { + + @Autowired + private TkRecordStatMapper tkRecordStatMapper; + + + @Override + public List getTkRecordStatH(Integer hid) { + return tkRecordStatMapper.getTkRecordStatH(hid); + } +} diff --git a/talkonlineweb/src/main/resources/mapper/TkRecordStatMapper.xml b/talkonlineweb/src/main/resources/mapper/TkRecordStatMapper.xml new file mode 100644 index 0000000..9662b01 --- /dev/null +++ b/talkonlineweb/src/main/resources/mapper/TkRecordStatMapper.xml @@ -0,0 +1,9 @@ + + + + + + + -- 1.8.3.1