企业spark案例 —— 出租车轨迹图表展示(头歌)
创始人
2024-11-28 06:05:47
0

MainMapper.java:

package net.educoder.app.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@Mapper
public interface MainMapper {
    
    //参考
    @Select("SELECT _num from taxi_trend WHERE _taxi = #{type} ORDER BY _time")
    List findTaxiTrendNumByType(String type);
    /**********begin**********/
    @Select("SELECT _time FROM taxi_trend GROUP BY _time ")
    List findTaxiTrendTime();
    @Select("select _taxi from taxi_trend group by _taxi")
    List findTaxiType();
    @Select("SELECT _type from taxi_servicenum GROUP BY _type")
    List findTaxiPlatform();
    @Select("SELECT _serviceType FROM taxi_servicenum GROUP BY _serviceType ORDER BY _serviceType")
    List findAllTaxiService();
    @Select("SELECT _num FROM taxi_servicenum WHERE _type = #{Platform} order BY _serviceType ")
    List findServiceNumByPlatform(String Platform);    
    /**********end**********/
}
 

MainController.java:

package net.educoder.app.controller;
import net.educoder.app.entity.Chart_Line;
import net.educoder.app.entity.Chart_Radar;
import net.educoder.app.mapper.MainMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
public class MainController {
    /**********begin**********/
    @Autowired
    MainMapper mainMapper;
    @RequestMapping("/index")
    public String index() {
        return "index";
    }
    @RequestMapping("/Line_Chart")
    @ResponseBody
    public Map Line_Chart() {
        List taxiType = mainMapper.findTaxiType();
        Map map = new HashMap<>();
        List resultList = new ArrayList<>();
        for (String s : taxiType) {
            List list = mainMapper.findTaxiTrendNumByType(s);
            Chart_Line chart_line = new Chart_Line(s, "line", list);
            resultList.add(chart_line);
        }
        List taxiTrendTimeList = mainMapper.findTaxiTrendTime();
        map.put("timeList", taxiTrendTimeList);
        map.put("resultData", resultList);
        return map;
    }
    @RequestMapping("/Radar_Chart")
    @ResponseBody
    public Map Radar_Chart() {
        Map map = new HashMap<>();
        List allTaxiService = mainMapper.findAllTaxiService();
        List> indicatorList = new ArrayList<>();
        for (String s : allTaxiService) {
            HashMap stringIntegerHashMap = new HashMap<>();
            stringIntegerHashMap.put("name", s);
            stringIntegerHashMap.put("max", 100);
            indicatorList.add(stringIntegerHashMap);
        }
        List taxiPlatform = mainMapper.findTaxiPlatform();
        List resultList = new ArrayList<>();
        for (String s : taxiPlatform) {
            List serviceNumByPlatform = mainMapper.findServiceNumByPlatform(s);
            Chart_Radar chart_radar = new Chart_Radar(s, serviceNumByPlatform);
            resultList.add(chart_radar);
        }
        map.put("resultData", resultList);
        map.put("legendData", taxiPlatform);
        map.put("indicator", indicatorList);
        return map;
    }
    /**********end**********/
}
 

index.html:




   
   








相关内容

热门资讯

牛牛链接房卡找谁购买/微信牛牛... 牛牛是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:15984933许多玩家在游戏中会购买房卡来享受...
终于发现!微信上链接牛牛房卡,... 微信游戏中心:斗牛房卡,添加微信【71319951】,进入游戏中心或相关小程序,搜索“微信斗牛房卡”...
科技实测!牛牛房卡批发平台卡卡... 科技实测!牛牛房卡批发平台卡卡娱乐/房卡在哪里购买卡卡娱乐是一款非常受欢迎的游戏,咨询房/卡添加微信...
终于发现!如何创建炸金花房间,... 微信游戏中心:炸金花房卡,添加微信【56001354】,进入游戏中心或相关小程序,搜索“微信炸金花房...
重大通报,牛牛房卡官网烛龙大厅... 微信游戏中心:烛龙大厅/新道游房卡在哪里买打开微信,添加客服微信【88355042】,进入游戏中心或...
给大家讲解“微信链接金花房卡怎... 天王大厅是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:15984933许多玩家在游戏中会购买房卡来...
IA解析/金花房卡怎么购买白虎... 白虎大厅是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:【3329006910】或QQ:332900...
一分钟了解!金花房卡制作链接新... 今 日消息,新天道/皇豪互娱房卡添加微信33549083 苹果今日发布了 iOS 16.1 正式版更...
终于发现!拼三张房卡链接在哪弄... 微信游戏中心:拼三张房卡,添加微信【66336574】,进入游戏中心或相关小程序,搜索“微信拼三张房...
牛牛链接房卡那里有/微信拼三张... 牛牛是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:15984933许多玩家在游戏中会购买房卡来享受...
牛牛链接房卡那里有/微信链接金... 牛牛是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:15984933许多玩家在游戏中会购买房卡来享受...
终于发现!拼三张房卡从哪买的,... 微信游戏中心:拼三张房卡,添加微信【71319951】,进入游戏中心或相关小程序,搜索“微信拼三张房...
终于发现!微信里面拼三张房卡在... 微信游戏中心:拼三张房卡,添加微信【56001354】,进入游戏中心或相关小程序,搜索“微信拼三张房...
终于找到“微信炸金花房卡到哪里... 微信炸金花是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:160470940许多玩家在游戏中会购买房...
正版授权!斗牛房卡充值超稳众娱... 超稳众娱是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:【3329006910】或QQ:332900...
终于发现!微信群牛牛房卡到哪里... 微信游戏中心:斗牛房卡,添加微信【66336574】,进入游戏中心或相关小程序,搜索“微信斗牛房卡”...
在哪里买炸金花房卡哪家便宜/微... 金花是一款非常受欢迎的棋牌游戏,咨询房/卡添加微信:86909166许多玩家在游戏中会购买房卡来享受...
重大通报,游戏微信牛牛房卡新神... 您好!微信新神兽/青龙大厅大厅链接获取房卡可以通过以下几种方式购买: 1.微信渠道:(新神兽/青龙...
一分钟了解!牛牛房卡游戏平台加... 钻石大厅房卡更多详情添加微:33549083、 2、在商城页面中选择房卡选项。 3、根...
终于发现!微信创建炸金花好友房... 微信游戏中心:炸金花房卡,添加微信【71319951】,进入游戏中心或相关小程序,搜索“微信炸金花房...