From 7c4d1982647c6e1ff870c8fda1d62d406df7598b Mon Sep 17 00:00:00 2001 From: linziming <871440130@qq.com> Date: Fri, 8 Jul 2022 09:14:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?ads=E5=B1=82-=E6=B5=81=E9=87=8F=E4=B8=BB?= =?UTF-8?q?=E9=A2=98-=E5=90=84=E6=B8=A0=E9=81=93=E6=B5=81=E9=87=8F?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sugar/bean/TrafficDurPerSession.java | 18 ++ .../sugar/bean/TrafficPvPerSession.java | 19 ++ .../com/example/sugar/bean/TrafficSvCt.java | 19 ++ .../com/example/sugar/bean/TrafficUjRate.java | 18 ++ .../com/example/sugar/bean/TrafficUvCt.java | 19 ++ .../sugar/controller/TrafficController.java | 191 ++++++++++++++++++ .../mapper/TrafficSourceStatsMapper.java | 69 +++++++ .../service/TrafficSourceStatsService.java | 22 ++ .../TrafficSourceStatsServiceImpl.java | 47 +++++ 9 files changed, 422 insertions(+) create mode 100644 sugar/src/main/java/com/example/sugar/bean/TrafficDurPerSession.java create mode 100644 sugar/src/main/java/com/example/sugar/bean/TrafficPvPerSession.java create mode 100644 sugar/src/main/java/com/example/sugar/bean/TrafficSvCt.java create mode 100644 sugar/src/main/java/com/example/sugar/bean/TrafficUjRate.java create mode 100644 sugar/src/main/java/com/example/sugar/bean/TrafficUvCt.java create mode 100644 sugar/src/main/java/com/example/sugar/controller/TrafficController.java create mode 100644 sugar/src/main/java/com/example/sugar/mapper/TrafficSourceStatsMapper.java create mode 100644 sugar/src/main/java/com/example/sugar/service/TrafficSourceStatsService.java create mode 100644 sugar/src/main/java/com/example/sugar/service/TrafficSourceStatsServiceImpl.java diff --git a/sugar/src/main/java/com/example/sugar/bean/TrafficDurPerSession.java b/sugar/src/main/java/com/example/sugar/bean/TrafficDurPerSession.java new file mode 100644 index 0000000..866e812 --- /dev/null +++ b/sugar/src/main/java/com/example/sugar/bean/TrafficDurPerSession.java @@ -0,0 +1,18 @@ +package com.example.sugar.bean; + +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor +public class TrafficDurPerSession { + // 来源 + String sc; + // 来源网站 + String sourceSite; + // 来源网址 + String sourceUrl; + + // 各会话页面访问时长 + Double durPerSession; +} \ No newline at end of file diff --git a/sugar/src/main/java/com/example/sugar/bean/TrafficPvPerSession.java b/sugar/src/main/java/com/example/sugar/bean/TrafficPvPerSession.java new file mode 100644 index 0000000..af8fee8 --- /dev/null +++ b/sugar/src/main/java/com/example/sugar/bean/TrafficPvPerSession.java @@ -0,0 +1,19 @@ +package com.example.sugar.bean; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +public class TrafficPvPerSession { + // 来源 + String sc; + // 来源网站 + String sourceSite; + // 来源网址 + String sourceUrl; + + // 各会话页面浏览数 + Double pvPerSession; +} \ No newline at end of file diff --git a/sugar/src/main/java/com/example/sugar/bean/TrafficSvCt.java b/sugar/src/main/java/com/example/sugar/bean/TrafficSvCt.java new file mode 100644 index 0000000..bb9ba51 --- /dev/null +++ b/sugar/src/main/java/com/example/sugar/bean/TrafficSvCt.java @@ -0,0 +1,19 @@ +package com.example.sugar.bean; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +public class TrafficSvCt { + // 来源 + String sc; + // 来源网站 + String sourceSite; + // 来源网址 + String sourceUrl; + + // 会话数 + Integer svCt; +} \ No newline at end of file diff --git a/sugar/src/main/java/com/example/sugar/bean/TrafficUjRate.java b/sugar/src/main/java/com/example/sugar/bean/TrafficUjRate.java new file mode 100644 index 0000000..8c74e25 --- /dev/null +++ b/sugar/src/main/java/com/example/sugar/bean/TrafficUjRate.java @@ -0,0 +1,18 @@ +package com.example.sugar.bean; + +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor +public class TrafficUjRate { + // 来源 + String sc; + // 来源网站 + String sourceSite; + // 来源网址 + String sourceUrl; + + // 跳出率 + Double ujRate; +} \ No newline at end of file diff --git a/sugar/src/main/java/com/example/sugar/bean/TrafficUvCt.java b/sugar/src/main/java/com/example/sugar/bean/TrafficUvCt.java new file mode 100644 index 0000000..34f6025 --- /dev/null +++ b/sugar/src/main/java/com/example/sugar/bean/TrafficUvCt.java @@ -0,0 +1,19 @@ +package com.example.sugar.bean; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +public class TrafficUvCt { + // 来源 + String sc; + // 来源网站 + String sourceSite; + // 来源网址 + String sourceUrl; + + // 独立访客数 + Integer uvCt; +} \ No newline at end of file diff --git a/sugar/src/main/java/com/example/sugar/controller/TrafficController.java b/sugar/src/main/java/com/example/sugar/controller/TrafficController.java new file mode 100644 index 0000000..6429560 --- /dev/null +++ b/sugar/src/main/java/com/example/sugar/controller/TrafficController.java @@ -0,0 +1,191 @@ +package com.example.sugar.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.example.sugar.bean.*; +import com.example.sugar.service.TrafficSourceStatsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RestController +@RequestMapping("/sugar/traffic") +public class TrafficController { + + // 自动装载渠道流量统计服务实现类 + @Autowired + private TrafficSourceStatsService trafficSourceStatsService; + + // 1. 独立访客请求拦截方法 + @RequestMapping("/uvCt") + public String getUvCt(int date) { + + List trafficUvCtList = trafficSourceStatsService.getUvCt(date); + + JSONObject result = new JSONObject(); + result.put("status", 0); + result.put("msg", ""); + + JSONObject data = new JSONObject(); + JSONArray categories = new JSONArray(); + JSONArray data1 = new JSONArray(); + for (TrafficUvCt trafficUvCt : trafficUvCtList) { + categories.add(trafficUvCt.getSourceSite()); + data1.add(trafficUvCt.getUvCt()); + } + data.put("categories", categories); + + JSONArray series = new JSONArray(); + JSONObject one = new JSONObject(); + + one.put("name", "独立访客数"); + one.put("data", data1); + + series.add(one); + + data.put("series",series); + + result.put("data", data); + return result.toJSONString(); + } + + // 2. 会话数请求拦截方法 + @RequestMapping("/svCt") + public String getPvCt(int date) { + List svCtList = trafficSourceStatsService.getSvCt(date); + + JSONObject result = new JSONObject(); + result.put("status", 0); + result.put("msg", ""); + + JSONObject data = new JSONObject(); + JSONArray categories = new JSONArray(); + JSONArray data1 = new JSONArray(); + + for (TrafficSvCt svCt : svCtList) { + categories.add(svCt.getSourceSite()); + data1.add(svCt.getSvCt()); + } + + data.put("categories", categories); + + JSONArray series = new JSONArray(); + JSONObject one = new JSONObject(); + series.add(one); + + one.put("name", "会话数"); + one.put("data", data1); + + data.put("series",series); + + result.put("data", data); + return result.toJSONString(); + } + + // 3. 各会话浏览页面数请求拦截方法 + @RequestMapping("/pvPerSession") + public String getPvPerSession(int date) { + + List list = trafficSourceStatsService.getPvPerSession(date); + + JSONObject result = new JSONObject(); + result.put("status", 0); + result.put("msg", ""); + + JSONObject data = new JSONObject(); + JSONArray categories = new JSONArray(); + JSONArray data1 = new JSONArray(); + for (TrafficPvPerSession pvPerSession : list) { + categories.add(pvPerSession.getSourceSite()); + data1.add(pvPerSession.getPvPerSession()); + } + + data.put("categories", categories); + + JSONArray series = new JSONArray(); + JSONObject one = new JSONObject(); + + one.put("name", "会话平均页面浏览数"); + one.put("data", data1); + + series.add(one); + + data.put("series",series); + + result.put("data", data); + return result.toJSONString(); + } + + // 4. 各会话累计访问时长请求拦截方法 + @RequestMapping("/durPerSession") + public String getDurPerSession(int date) { + + List list = trafficSourceStatsService.getDurPerSession(date); + + JSONObject result = new JSONObject(); + result.put("status", 0); + result.put("msg", ""); + + JSONObject data = new JSONObject(); + JSONArray categories = new JSONArray(); + JSONArray data1 = new JSONArray(); + for (TrafficDurPerSession durPerSession : list) { + categories.add(durPerSession.getSourceSite()); + data1.add(durPerSession.getDurPerSession()); + } + + data.put("categories", categories); + + JSONArray series = new JSONArray(); + JSONObject one = new JSONObject(); + + one.put("name", "会话平均页面访问时长"); + one.put("data", data1); + + series.add(one); + + data.put("series",series); + + result.put("data", data); + return result.toJSONString(); + } + + @RequestMapping("/ujRate") + public String getUjRate(int date) { + + List list = trafficSourceStatsService.getUjRate(date); + + JSONObject result = new JSONObject(); + result.put("status", 0); + result.put("msg", ""); + + JSONObject data = new JSONObject(); + JSONArray categories = new JSONArray(); + JSONArray data1 = new JSONArray(); + + for (TrafficUjRate ujRate : list) { + categories.add(ujRate.getSourceSite()); + data1.add(ujRate.getUjRate()); + } + + data.put("categories", categories); + + JSONArray series = new JSONArray(); + JSONObject one = new JSONObject(); + + one.put("name", "跳出率"); + one.put("data", data1); + + series.add(one); + + data.put("series",series); + + result.put("data", data); + return result.toJSONString(); + } + + +} \ No newline at end of file diff --git a/sugar/src/main/java/com/example/sugar/mapper/TrafficSourceStatsMapper.java b/sugar/src/main/java/com/example/sugar/mapper/TrafficSourceStatsMapper.java new file mode 100644 index 0000000..144442a --- /dev/null +++ b/sugar/src/main/java/com/example/sugar/mapper/TrafficSourceStatsMapper.java @@ -0,0 +1,69 @@ +package com.example.sugar.mapper; + +import com.example.sugar.bean.*; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +public interface TrafficSourceStatsMapper { + // 1. 获取各来源独立访客数 + @Select("select sc, \n" + + " source_site, \n" + + " source_url, \n" + + " sum(uv_ct) uv_ct \n" + + "from dws_traffic_rc_vc_ch_ar_is_new_page_view_window \n" + + "where toYYYYMMDD(stt) = #{date} \n" + + "group by toYYYYMMDD(stt), sc,source_site,source_url \n" + + "order by uv_ct desc") + List selectUvCt(@Param("date")Integer date); + + // 2. 获取各来源会话数 + @Select("SELECT\n" + + " sc,\n" + + " source_site,\n" + + " source_url,\n" + + " sum(sv_ct) AS sv_ct\n" + + "FROM dws_traffic_rc_vc_ch_ar_is_new_page_view_window\n" + + "WHERE toYYYYMMDD(stt) = #{date}\n" + + "GROUP BY\n" + + " toYYYYMMDD(stt),\n" + + " sc,\n" + + " source_site,\n" + + " source_url\n" + + "ORDER BY sv_ct DESC") + List selectSvCt(@Param("date")Integer date); + + // 3. 获取各来源会话平均页面浏览数 + @Select("select sc,\n" + + " source_site," + + " source_url," + + " sum(pv_ct) / sum(sv_ct) pv_per_session\n" + + "from dws_traffic_rc_vc_ch_ar_is_new_page_view_window\n" + + "where toYYYYMMDD(stt) = #{date}\n" + + "group by toYYYYMMDD(stt), sc, source_site,source_url\n" + + "order by pv_per_session desc") + List selectPvPerSession(@Param("date")Integer date); + + // 4. 获取各来源会话平均页面访问时长 + @Select("select sc,\n" + + " source_site," + + " source_url," + + " sum(dur_sum) / sum(sv_ct) dur_per_session\n" + + "from dws_traffic_rc_vc_ch_ar_is_new_page_view_window\n" + + "where toYYYYMMDD(stt) = #{date}\n" + + "group by toYYYYMMDD(stt), sc, source_site,source_url\n" + + "order by dur_per_session desc") + List selectDurPerSession(@Param("date")Integer date); + + // 5. 获取各来源跳出率 + @Select("select sc,\n" + + " source_site," + + " source_url," + + " sum(uj_ct) / sum(sv_ct) uj_rate\n" + + "from dws_traffic_rc_vc_ch_ar_is_new_page_view_window\n" + + "where toYYYYMMDD(stt) = #{date}\n" + + "group by toYYYYMMDD(stt), sc, source_site,source_url\n" + + "order by uj_rate desc") + List selectUjRate(@Param("date")Integer date); +} \ No newline at end of file diff --git a/sugar/src/main/java/com/example/sugar/service/TrafficSourceStatsService.java b/sugar/src/main/java/com/example/sugar/service/TrafficSourceStatsService.java new file mode 100644 index 0000000..aaf1ccb --- /dev/null +++ b/sugar/src/main/java/com/example/sugar/service/TrafficSourceStatsService.java @@ -0,0 +1,22 @@ +package com.example.sugar.service; + +import com.example.sugar.bean.*; + +import java.util.List; + +public interface TrafficSourceStatsService { + // 1. 获取各渠道独立访客数 + List getUvCt(Integer date); + + // 2. 获取各渠道会话数 + List getSvCt(Integer date); + + // 3. 获取各渠道会话平均页面浏览数 + List getPvPerSession(Integer date); + + // 4. 获取各渠道会话平均页面访问时长 + List getDurPerSession(Integer date); + + // 5. 获取各渠道跳出率 + List getUjRate(Integer date); +} \ No newline at end of file diff --git a/sugar/src/main/java/com/example/sugar/service/TrafficSourceStatsServiceImpl.java b/sugar/src/main/java/com/example/sugar/service/TrafficSourceStatsServiceImpl.java new file mode 100644 index 0000000..e389fa0 --- /dev/null +++ b/sugar/src/main/java/com/example/sugar/service/TrafficSourceStatsServiceImpl.java @@ -0,0 +1,47 @@ +package com.example.sugar.service; + + +import com.example.sugar.bean.*; +import com.example.sugar.mapper.TrafficSourceStatsMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class TrafficSourceStatsServiceImpl implements TrafficSourceStatsService { + + // 自动装载 Mapper 接口实现类 + @Autowired + TrafficSourceStatsMapper trafficSourceStatsMapper; + + // 1. 获取各来源独立访客数 + @Override + public List getUvCt(Integer date) { + return trafficSourceStatsMapper.selectUvCt(date); +} + + // 2. 获取各来源会话数 + @Override + public List getSvCt(Integer date) { + return trafficSourceStatsMapper.selectSvCt(date); + } + + // 3. 获取各来源会话平均页面浏览数 + @Override + public List getPvPerSession(Integer date) { + return trafficSourceStatsMapper.selectPvPerSession(date); + } + + // 4. 获取各来源会话平均页面访问时长 + @Override + public List getDurPerSession(Integer date) { + return trafficSourceStatsMapper.selectDurPerSession(date); + } + + // 5. 获取各来源跳出率 + @Override + public List getUjRate(Integer date) { + return trafficSourceStatsMapper.selectUjRate(date); + } +} \ No newline at end of file -- Gitee From ee4d1e66740120e040fbf122037aa326b31d2819 Mon Sep 17 00:00:00 2001 From: linziming <871440130@qq.com> Date: Fri, 8 Jul 2022 14:19:58 +0800 Subject: [PATCH 2/2] =?UTF-8?q?ads=E5=B1=82-=E6=B5=81=E9=87=8F=E4=B8=BB?= =?UTF-8?q?=E9=A2=98-=E6=B5=81=E9=87=8F=E5=88=86=E6=97=B6=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bean/TrafficVisitorStatsPerHour.java | 17 ++++++ .../sugar/controller/TrafficController.java | 53 ++++++++++++++++++- .../mapper/TrafficVisitorStatsMapper.java | 28 ++++++++++ .../service/TrafficVisitorStatsService.java | 10 ++++ .../TrafficVisitorStatsServiceImpl.java | 21 ++++++++ 5 files changed, 127 insertions(+), 2 deletions(-) create mode 100644 sugar/src/main/java/com/example/sugar/bean/TrafficVisitorStatsPerHour.java create mode 100644 sugar/src/main/java/com/example/sugar/mapper/TrafficVisitorStatsMapper.java create mode 100644 sugar/src/main/java/com/example/sugar/service/TrafficVisitorStatsService.java create mode 100644 sugar/src/main/java/com/example/sugar/service/TrafficVisitorStatsServiceImpl.java diff --git a/sugar/src/main/java/com/example/sugar/bean/TrafficVisitorStatsPerHour.java b/sugar/src/main/java/com/example/sugar/bean/TrafficVisitorStatsPerHour.java new file mode 100644 index 0000000..3e9c268 --- /dev/null +++ b/sugar/src/main/java/com/example/sugar/bean/TrafficVisitorStatsPerHour.java @@ -0,0 +1,17 @@ +package com.example.sugar.bean; + +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor +public class TrafficVisitorStatsPerHour { + // 小时 + Integer hr; + // 独立访客数 + Long uvCt; + // 页面浏览数 + Long pvCt; + // 会话平均浏览页面数 + Double pvPerSession; +} \ No newline at end of file diff --git a/sugar/src/main/java/com/example/sugar/controller/TrafficController.java b/sugar/src/main/java/com/example/sugar/controller/TrafficController.java index 6429560..089589e 100644 --- a/sugar/src/main/java/com/example/sugar/controller/TrafficController.java +++ b/sugar/src/main/java/com/example/sugar/controller/TrafficController.java @@ -4,9 +4,9 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.example.sugar.bean.*; import com.example.sugar.service.TrafficSourceStatsService; +import com.example.sugar.service.TrafficVisitorStatsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.List; @@ -18,8 +18,57 @@ public class TrafficController { // 自动装载渠道流量统计服务实现类 @Autowired private TrafficSourceStatsService trafficSourceStatsService; + // 自动装载访客状态统计服务实现类 + @Autowired + private TrafficVisitorStatsService trafficVisitorStatsService; + + // 访客状态分时统计请求拦截方法 + @RequestMapping("/visitorPerHr") + public String getVisitorPerHr(int date) { + JSONObject result = new JSONObject(); + List list = trafficVisitorStatsService.getVisitorPerHrStats(date); + result.put("status", 0); + result.put("msg", ""); + JSONObject data = new JSONObject(); + JSONArray categories = new JSONArray(); + JSONArray series = new JSONArray(); + + JSONObject one = new JSONObject(); + one.put("name", "独立访客数"); + JSONArray data1 = new JSONArray(); + + JSONObject two = new JSONObject(); + two.put("name", "页面浏览数"); + JSONArray data2 = new JSONArray(); + + JSONObject three = new JSONObject(); + three.put("name", "会话平均浏览页面数"); + JSONArray data3 = new JSONArray(); + + for (TrafficVisitorStatsPerHour visitorStatsPerHour : list) { + categories.add(visitorStatsPerHour.getHr()); + data1.add(visitorStatsPerHour.getUvCt()); + data2.add(visitorStatsPerHour.getPvCt()); + data3.add(visitorStatsPerHour.getPvPerSession()); + } + + one.put("data", data1); + two.put("data", data2); + three.put("data", data3); + + series.add(one); + series.add(two); + series.add(three); + + data.put("categories", categories); + data.put("series", series); + + result.put("data", data); + return result.toJSONString(); + } + - // 1. 独立访客请求拦截方法 + // 1. 独立访客请求拦截方法 @RequestMapping("/uvCt") public String getUvCt(int date) { diff --git a/sugar/src/main/java/com/example/sugar/mapper/TrafficVisitorStatsMapper.java b/sugar/src/main/java/com/example/sugar/mapper/TrafficVisitorStatsMapper.java new file mode 100644 index 0000000..9373f60 --- /dev/null +++ b/sugar/src/main/java/com/example/sugar/mapper/TrafficVisitorStatsMapper.java @@ -0,0 +1,28 @@ +package com.example.sugar.mapper; + +import com.example.sugar.bean.TrafficVisitorStatsPerHour; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +public interface TrafficVisitorStatsMapper { + +// 分时流量数据查询 + @Select("SELECT\n" + + " t1.hr,\n" + + " sum(t1.uv_ct) AS uv_ct,\n" + + " sum(t1.pv_ct) AS pv_ct,\n" + + " sum(t1.pv_ct) / sum(t1.sv_ct) AS pv_per_session\n" + + "FROM\n" + + "(\n" + + " SELECT\n" + + " toHour(stt) AS hr,\n" + + " uv_ct,\n" + + " pv_ct,\n" + + " sv_ct\n" + + " FROM dws_traffic_rc_vc_ch_ar_is_new_page_view_window\n" + + " WHERE toYYYYMMDD(stt) = #{date}\n" + + ") AS t1\n" + + "GROUP BY t1.hr") + List selectVisitorStatsPerHr(Integer date); +} \ No newline at end of file diff --git a/sugar/src/main/java/com/example/sugar/service/TrafficVisitorStatsService.java b/sugar/src/main/java/com/example/sugar/service/TrafficVisitorStatsService.java new file mode 100644 index 0000000..69e3c83 --- /dev/null +++ b/sugar/src/main/java/com/example/sugar/service/TrafficVisitorStatsService.java @@ -0,0 +1,10 @@ +package com.example.sugar.service; + +import com.example.sugar.bean.TrafficVisitorStatsPerHour; + +import java.util.List; + +public interface TrafficVisitorStatsService { + // 获取分时流量数据 + List getVisitorPerHrStats(Integer date); +} \ No newline at end of file diff --git a/sugar/src/main/java/com/example/sugar/service/TrafficVisitorStatsServiceImpl.java b/sugar/src/main/java/com/example/sugar/service/TrafficVisitorStatsServiceImpl.java new file mode 100644 index 0000000..13b644c --- /dev/null +++ b/sugar/src/main/java/com/example/sugar/service/TrafficVisitorStatsServiceImpl.java @@ -0,0 +1,21 @@ +package com.example.sugar.service; + +import com.example.sugar.bean.TrafficVisitorStatsPerHour; +import com.example.sugar.mapper.TrafficVisitorStatsMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class TrafficVisitorStatsServiceImpl implements TrafficVisitorStatsService { + + @Autowired + private TrafficVisitorStatsMapper trafficVisitorStatsMapper; + + // 获取分时流量统计数据 + @Override + public List getVisitorPerHrStats(Integer date) { + return trafficVisitorStatsMapper.selectVisitorStatsPerHr(date); + } +} \ No newline at end of file -- Gitee