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 @@ + + + + + + +