Commit 840aa3c2cf64384f2e1ef87a35618de5127d5114

Authored by shiyang
1 parent e3ed14ae63
Exists in master and in 1 other branch dev

首页-今日问诊统计

Showing 6 changed files with 116 additions and 3 deletions

talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/IndexController.java View file @ 840aa3c
1 1 package com.lyms.talkonlineweb.controller;
2 2  
  3 +import com.lyms.talkonlineweb.domain.TkRecordStatHInfo;
3 4 import com.lyms.talkonlineweb.result.BaseResponse;
4 5 import com.lyms.talkonlineweb.service.IndexService;
  6 +import com.lyms.talkonlineweb.service.TkRecordStatService;
5 7 import org.springframework.beans.factory.annotation.Autowired;
6 8 import org.springframework.web.bind.annotation.GetMapping;
7 9 import org.springframework.web.bind.annotation.RequestMapping;
8 10 import org.springframework.web.bind.annotation.RestController;
9 11  
  12 +import java.util.List;
10 13 import java.util.Map;
11 14  
12 15 @RestController
... ... @@ -16,6 +19,9 @@
16 19 @Autowired
17 20 private IndexService indexService;
18 21  
  22 + @Autowired
  23 + private TkRecordStatService tkRecordStatService;
  24 +
19 25 /**
20 26 * 访问统计
21 27 * @return
22 28  
23 29  
24 30  
... ... @@ -28,12 +34,17 @@
28 34 baseResponse.setObject(rs);
29 35 return baseResponse;
30 36 }
  37 +
31 38 /**
32   - *
  39 + * 首页-今日问诊数量
  40 + * @param hid 不传默认返回所有医院今日问诊次数。
  41 + * @return
33 42 */
34   - @GetMapping("getTkRecordStat")
35   - public BaseResponse getTkRecordStat(){
  43 + @GetMapping("getTkRecordStatH")
  44 + public BaseResponse getTkRecordStatH(Integer hid){
36 45 BaseResponse baseResponse=new BaseResponse();
  46 + List<TkRecordStatHInfo> tkRecordStatH = tkRecordStatService.getTkRecordStatH(hid);
  47 + baseResponse.setObject(tkRecordStatH);
37 48 return baseResponse;
38 49 }
39 50  
talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/TkRecordStatHInfo.java View file @ 840aa3c
  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_h_info
  10 + */
  11 +@TableName(value ="tkRecordStat_h_info")
  12 +@Data
  13 +public class TkRecordStatHInfo {
  14 +
  15 + /**
  16 + * 医院ID
  17 + */
  18 + @TableField(value = "hid")
  19 + private long hid;
  20 +
  21 + /**
  22 + * 问诊时间-小时
  23 + */
  24 + @TableField(value = "tkhour")
  25 + private long tkhour;
  26 +
  27 + /**
  28 + * 问诊次数
  29 + */
  30 + @TableField(value = "hcount")
  31 + private long hcount;
  32 +
  33 +
  34 +
  35 +
  36 +}
talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/TkRecordStatMapper.java View file @ 840aa3c
  1 +package com.lyms.talkonlineweb.mapper;
  2 +
  3 +
  4 +import com.lyms.talkonlineweb.domain.TkRecordStatHInfo;
  5 +import org.apache.ibatis.annotations.Mapper;
  6 +import org.apache.ibatis.annotations.Param;
  7 +import org.apache.ibatis.annotations.Select;
  8 +
  9 +import java.util.List;
  10 +
  11 +@Mapper
  12 +public interface TkRecordStatMapper {
  13 +
  14 + @Select({"<script>",
  15 + "select hid,tkhour,hcount from tkRecordStat_h_info",
  16 + "where 1=1",
  17 + "<when test='hid!=null'>",
  18 + "and hid=#{hid}",
  19 + "</when>",
  20 + "</script>"})
  21 + public List<TkRecordStatHInfo> getTkRecordStatH(@Param("hid") Integer hid);
  22 +}
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/TkRecordStatService.java View file @ 840aa3c
  1 +package com.lyms.talkonlineweb.service;
  2 +
  3 +import com.lyms.talkonlineweb.domain.TkRecordStatHInfo;
  4 +import org.springframework.stereotype.Service;
  5 +
  6 +import java.util.List;
  7 +
  8 +
  9 +public interface TkRecordStatService {
  10 +
  11 + List<TkRecordStatHInfo> getTkRecordStatH(Integer hid);
  12 +
  13 +}
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/TkRecordStatServiceImpl.java View file @ 840aa3c
  1 +package com.lyms.talkonlineweb.service.impl;
  2 +
  3 +import com.lyms.talkonlineweb.domain.TkRecordStatHInfo;
  4 +import com.lyms.talkonlineweb.mapper.TkRecordStatMapper;
  5 +import com.lyms.talkonlineweb.service.TkRecordStatService;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.stereotype.Service;
  8 +
  9 +import java.util.List;
  10 +
  11 +@Service
  12 +public class TkRecordStatServiceImpl implements TkRecordStatService {
  13 +
  14 + @Autowired
  15 + private TkRecordStatMapper tkRecordStatMapper;
  16 +
  17 +
  18 + @Override
  19 + public List<TkRecordStatHInfo> getTkRecordStatH(Integer hid) {
  20 + return tkRecordStatMapper.getTkRecordStatH(hid);
  21 + }
  22 +}
talkonlineweb/src/main/resources/mapper/TkRecordStatMapper.xml View file @ 840aa3c
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper
  3 + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4 + "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5 +<mapper namespace="com.lyms.talkonlineweb.mapper.ArticleInfoMapper">
  6 +
  7 +
  8 +
  9 +</mapper>