티스토리 뷰

코딩/spring

[21주 1일차] 팀별 순위

ehzim 2024. 2. 26. 19:50

 

 

Controller

TeamWinningController.java

package com.springmvc.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.springmvc.domain.Team;
import com.springmvc.domain.TeamWinning;
import com.springmvc.repository.TeamWinningRepository;
import com.springmvc.service.TeamService;
import com.springmvc.service.TeamWinningService;

@Controller
@RequestMapping("team/result")
public class TeamWinningController {
	
	@Autowired
	private TeamWinningService teamWinningService;
	
	@Autowired
	private TeamWinningRepository teamWinningRepository;
	
	@GetMapping
	public String requestWinningList(Model model) {
		List<TeamWinning> list =teamWinningService.readAllWinningList();
		model.addAttribute("winningList",list);
		return "/Team/winnings";
	}
	
	@GetMapping("/all")
	public String requestAllWInningList(Model model) {
		List<TeamWinning> list = teamWinningService.readAllWinningList();
		
		return "/Team/winnings";
	}
	
	@GetMapping("/a")
	public String allWinningList(Model model) {
		List<TeamWinning> sortedWinningList = teamWinningRepository.calAndSortWinningRate();
	    model.addAttribute("winningList", sortedWinningList);
	    return "/Team/board";
	}
	
//	@GetMapping("/winning")
//	public String requestWinningById(@RequestParam("id") String winningId, Model model) {
//		TeamWinning winningById = teamWinningService.readWinningById(winningId);
//		model.addAttribute("winning",winningById);
//		return"/Team/winning";
//	}
	
	@GetMapping("/winning")
	public String requestWinningDetails(@RequestParam("id") String teamId, Model model) {
	    // Get recent matches result, total wins, total losses, and winning rate from service
	    String recentMatchesResult = teamWinningService.getRecentMatchesResult(teamId);
	    int totalWins = teamWinningService.totalWins(teamId);
	    int totalTies = teamWinningService.totalTie(teamId);
	    int totalLosses = teamWinningService.totalLose(teamId);
	    double winningRate = teamWinningService.calculateWinningRate(teamId);
	    int totalGames = teamWinningService.totalGames(teamId);
	   
	    // Add these attributes to the model
	    model.addAttribute("recentMatchesResult", recentMatchesResult);
	    model.addAttribute("totalWins", totalWins);
	    model.addAttribute("totalTies",totalTies);
	    model.addAttribute("totalLosses", totalLosses);
	    model.addAttribute("winningRate", winningRate);
	    model.addAttribute("totalGames",totalGames);

	    return "/Team/winning";
	}
	
	
	@GetMapping("/recent")
    public String getRecentMatchesResult(@RequestParam("id") String teamId, Model model) {
        String recentMatchesResult=teamWinningService.getRecentMatchesResult(teamId);
        model.addAttribute("recent",recentMatchesResult);
        
        System.out.println("recent도착");
        return "/Team/recent";
    }
	
	//create
	@GetMapping("/add")
	public String requestAddWinningForm(@ModelAttribute("addWinning")TeamWinning teamWinning) {
		return "/Team/radd";
	}
	
	@PostMapping("/add")
	public String submitAddNewWinning(@ModelAttribute("addWinning")TeamWinning teamWinning, HttpServletRequest request){
		teamWinningService.setNewWinning(teamWinning);
		return "redirect:/team/result";
	}
	
	@GetMapping("/update")
	public String getUpdateWinningForm(@ModelAttribute("updateWinning") TeamWinning teamWinning, @RequestParam("id") String winningId, Model model) {
		TeamWinning winningById = teamWinningService.readWinningById(winningId);
		System.out.println("위닝 아이디 : " +winningId);
		model.addAttribute("winning",winningById);
		return "/Team/rupdateForm";
	}
	
	@PostMapping("/update")
	public String submitUpdateWinningForm(@ModelAttribute("updateWinning") TeamWinning teamWinning ) {
		teamWinningService.setUpdateWinning(teamWinning);
		return "redirect:/winning";
	}
	
	@GetMapping(value="/delete")
	public String getDeleteForm(Model Model, String winningId) {
		teamWinningService.setDeleteWinning(winningId);
		return "redirect:/team/result";
	
	}
	
	@GetMapping("/rate")
	public String getTeamRate(@RequestParam("id") String teamId, Model model) {
		
		double winningRate = teamWinningService.calculateWinningRate(teamId);
	    model.addAttribute("winningRate", winningRate);
	    return "/Team/rate"; // 뷰 페이지의 경로에 맞게 수정
	
	}
}

 

 

 

 

 

 

 

Domain

TeamWinning.java

package com.springmvc.domain;

import java.io.Serializable;
import java.util.List;

public class TeamWinning implements Serializable{

	
	private static final long serialVersionUID = -3281574142158274296L;

	
	private String winningId;  //구단성적아이디
	private String teamId;  //팀아이디
	private int matches;  //경기수
	private double rate; //승룰
	private String recent; //최근결과
	private String date; //경기날짜
	private String result;  //경기결과
	private int totalWins;
	private int totalTie;
	private int totalLose;
	
	
	
	public String getRecent() {
		return recent;
	}

	public void setRecent(String recent) {
		this.recent = recent;
	}

	public int getTotalWins() {
		return totalWins;
	}

	public void setTotalWins(int totalWins) {
		this.totalWins = totalWins;
	}

	public int getTotalTie() {
		return totalTie;
	}

	public void setTotalTie(int totalTie) {
		this.totalTie = totalTie;
	}

	public int getTotalLose() {
		return totalLose;
	}

	public void setTotalLose(int totalLose) {
		this.totalLose = totalLose;
	}

	
	public TeamWinning() {
		super();
		// TODO Auto-generated constructor stub
	}



    // countRecentWins 메서드를 구현하지 않고, 서비스 레이어에서 처리하는 것이 좋을 것 같습니다.
    // 메서드를 호출하는 측에서 필요한 로직을 구현하도록 유도합니다.	

	public String getWinningId() {
		return winningId;
	}


	public void setWinningId(String winningId) {
		this.winningId = winningId;
	}


	public String getTeamId() {
		return teamId;
	}


	public void setTeamId(String teamId) {
		this.teamId = teamId;
	}


	public int getMatches() {
		return matches;
	}


	public void setMatches(int matches) {
		this.matches = matches;
	}


	public double getRate() {
		return rate;
	}


	public void setRate(double rate) {
		this.rate = rate;
	}





	public String getDate() {
		return date;
	}


	public void setDate(String date) {
		this.date = date;
	}


	public String getResult() {
		return result;
	}


	public void setResult(String result) {
		this.result = result;
	}

	
	
}

 

 

 

 

 

 

 

Service

 

TeamService.java

package com.springmvc.service;

import java.util.List;

import com.springmvc.domain.TeamWinning;

public interface TeamWinningService {

	List<TeamWinning> readAllWinningList();
	TeamWinning readWinningById(String winningId);
	String getRecentMatchesResult(String teamId);
	int totalWins(String teamId);
	int totalTie(String teamId);
	int totalLose(String teamId);
	int totalGames(String teamId);
	void setNewWinning(TeamWinning teamWinning);
	void setUpdateWinning(TeamWinning teamWinning);
	void setDeleteWinning(String winningId);
	double calculateWinningRate(String teamId);

}

 

 

TeamService.Impl.java

package com.springmvc.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.springmvc.domain.TeamWinning;
import com.springmvc.repository.TeamWinningRepository;

@Service
public class TeamWinningServiceImpl implements TeamWinningService {

	@Autowired
	private TeamWinningRepository teamWinningRepository;
	
	
	@Override
	public List<TeamWinning> readAllWinningList() {
		
		return teamWinningRepository.readAllWinningList();
	}

	@Override
	public TeamWinning readWinningById(String teamId) {
		TeamWinning teamById = teamWinningRepository.readWinningById(teamId);
		return teamById;
	}

//최근10경기
	@Override
	public String getRecentMatchesResult(String teamId) {
		List<TeamWinning> recentMatchesResults = teamWinningRepository.getRecentMatchesResults(teamId);
		return calculateRecentMatchesResult(recentMatchesResults);
	}
	
	private String calculateRecentMatchesResult(List<TeamWinning> recentMatchesResults) {
		int recentWins=0;
		int recentTies=0;
		int recentLosses=0;
		
		for(TeamWinning result : recentMatchesResults) {
			if("Win".equals(result.getResult())) {
				recentWins++;
			}
			else if("Lose".equals(result.getResult())) {
				recentLosses++;
			}
			else if("Tie".equals(result.getResult())) {
				recentTies++;
			}
		}
		return recentWins + "승" + recentTies + "무" +recentLosses+"패";
	}
	

	@Override
	public void setNewWinning(TeamWinning teamWinning) {
		teamWinningRepository.setNewWinning(teamWinning);
		
	}

	@Override
	public void setUpdateWinning(TeamWinning teamWinning) {
		teamWinningRepository.setUpdateWinning(teamWinning);
		
	}

	@Override
	public void setDeleteWinning(String winningId) {
		teamWinningRepository.setDeleteWinning(winningId);
		
	}

	@Override
	public int totalWins(String teamId) {
		// TODO Auto-generated method stub
		return teamWinningRepository.totalWins(teamId);
	}

	@Override
	public int totalTie(String teamId) {
		// TODO Auto-generated method stub
		return teamWinningRepository.totalTie(teamId);
	}

	@Override
	public int totalLose(String teamId) {
		// TODO Auto-generated method stub
		return teamWinningRepository.totalLose(teamId);
	}

	@Override
	public double calculateWinningRate(String teamId) {
		// TODO Auto-generated method stub
		return teamWinningRepository.calculateWinningRate(teamId);
	}

	@Override
	public int totalGames(String teamId) {
		// TODO Auto-generated method stub
		return teamWinningRepository.totalGames(teamId);
	} 

	

}

 

 

 

 

 

 

Repository

 

 

TeamWinningRepository.java

package com.springmvc.repository;

import java.util.List;

import com.springmvc.domain.TeamWinning;

public interface TeamWinningRepository {

	List<TeamWinning> readAllWinningList();
	TeamWinning readWinningById(String teamId);
	List<TeamWinning> getRecentMatchesResults(String teamId);
	List<TeamWinning> calAndSortWinningRate();
	int totalWins(String teamId);
	int totalTie(String teamId);
	int totalLose(String teamId);
	int totalGames(String teamId);
	double calculateWinningRate(String teamId);
	
	void setNewWinning(TeamWinning teamWinning);
	void setUpdateWinning(TeamWinning teamWinning);
	void setDeleteWinning(String winningId);
}
//이 클래스는 주로 데이터베이스에서 조회된 특정 팀의 성적 정보를 담는 데 사용되며, 
//객체 간의 데이터 전송이나 저장에 용이합니다. 
//JPA(Entity)로 사용되기 위해서 @Entity 어노테이션이 추가되면 특정 데이터베이스 테이블과 매핑할 수 있습니다.

 

TeamWinningRepositoryImpl.java

package com.springmvc.repository;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;

import javax.sql.DataSource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Repository;

import com.springmvc.domain.Team;
import com.springmvc.domain.TeamWinning;
import com.springmvc.service.TeamWinningService;


@Repository
public class TeamWinningRepositoryImpl implements TeamWinningRepository{

	private JdbcTemplate template;
	
	@Autowired
	private TeamRepository teamRepository;
	
	@Autowired
	private TeamWinningService teamWinningService;
	
	@Autowired
	public void setJdbcTemplate(DataSource dataSource) {
		this.template=new JdbcTemplate(dataSource);
	}
	
	@Override
	public List<TeamWinning> readAllWinningList() {
		String SQL = "SELECT * FROM t_score";
		List<TeamWinning> listOfWinnings = template.query(SQL, new TeamWinningRowMapper());
		
		
		return listOfWinnings;
	}

	@Override
	public TeamWinning readWinningById(String teamId) {
	    String SQL = "SELECT * FROM t_score WHERE teamid=?";
	    List<TeamWinning> resultList = template.query(SQL, new Object[]{teamId}, new TeamWinningRowMapper());

	    if (!resultList.isEmpty()) {
	        // teamId에 해당하는 결과가 있는 경우
	        return resultList.get(0); // 일단은 첫 번째 결과를 반환하도록 함
	    } else {
	        // teamId에 해당하는 결과가 없는 경우
	        throw new IllegalArgumentException("일치하는 결과가 없습니다.");
	    }
		
	}

	 //최근10경기보여주기
	
	@Override
	public List<TeamWinning> getRecentMatchesResults(String teamId) {
		String SQL = "SELECT * FROM t_score WHERE teamId=? ORDER BY ts_date desc limit 10";
		List<TeamWinning> listOfRecent = template.query(SQL, new TeamWinningRowMapper(), teamId);

	    // 해당 TeamWinning 객체 가져오기
	    TeamWinning teamWinning = readWinningById(teamId);

	    // 가져온 TeamWinning 객체에 recent 저장
	    if (teamWinning != null) {
			/* teamWinning.setRecent(listOfRecent); */
	    }

	    return listOfRecent;
	}
	
	
	
	//create
	@Override 
	public void setNewWinning(TeamWinning teamWinning) {
		String SQL = "INSERT INTO t_score (ts_id, teamid, ts_matches, ts_result, ts_date)"+"VALUES(?, ?, ?, ?, ?)";
		template.update(SQL,teamWinning.getWinningId(),teamWinning.getTeamId(),teamWinning.getMatches(),teamWinning.getResult(),teamWinning.getDate());
	}

	@Override
	public void setUpdateWinning(TeamWinning teamWinning) {
		String SQL = "UPDATE t_score SET teamid=?, ts_matches=?, ts_result=?, ts_date=? WHERE ts_id=?";
		template.update(SQL,teamWinning.getTeamId(),teamWinning.getMatches(),teamWinning.getResult(),teamWinning.getDate(),teamWinning.getWinningId());
	}

	@Override
	public void setDeleteWinning(String winningId) {
		String SQL = "DELETE FROM t_score WHERE ts_id=?";
		this.template.update(SQL, winningId);
		
	}


	public void setTemplate(JdbcTemplate template) {
		this.template = template;
	}

	@Override
	public int totalWins(String teamId) {
		String SQL = "SELECT COUNT(*) AS totalWins FROM t_score WHERE teamId=? AND ts_result='Win'";
		
		int totalWins = template.queryForObject(SQL, Integer.class, teamId);
		
		// 해당 TeamWinning 객체 가져오기
	    TeamWinning teamWinning = readWinningById(teamId);

	    // 가져온 TeamWinning 객체에 totalWins 저장
	    if (teamWinning != null) {
	        
	        teamWinning.setTotalWins(totalWins);
	    }

	    return totalWins;
	
	}

	@Override
	public int totalTie(String teamId) {
		String SQL = "SELECT COUNT(*) AS totalTie FROM t_score WHERE teamId=? AND ts_result='Tie'";
	
		int totalTie = template.queryForObject(SQL, Integer.class, teamId);
	
		// 해당 TeamWinning 객체 가져오기
	    TeamWinning teamWinning = readWinningById(teamId);

	    // 가져온 TeamWinning 객체에 totalTie 저장
	    if (teamWinning != null) {
	        
	        teamWinning.setTotalWins(totalTie);
	    }

	    return totalTie;
	}

	@Override
	public int totalLose(String teamId) {
		String SQL = "SELECT COUNT(*) AS totalLose FROM t_score WHERE teamId=? AND ts_result='Lose'";
		
		int totalLose = template.queryForObject(SQL, Integer.class, teamId);
		// 해당 TeamWinning 객체 가져오기
	    TeamWinning teamWinning = readWinningById(teamId);

	    // 가져온 TeamWinning 객체에 totalLose 저장
	    if (teamWinning != null) {
	        
	        teamWinning.setTotalWins(totalLose);
	    }

	    return totalLose;
	
	}
	
	//승률 보여주기 (나중에 순위 보여주려면 저기서 내림차순?으로 순위 매기기 그리고 where 조건하고 sql문 조금 바꿔야함 groupby teamId로 해야함

	@Override
	public double calculateWinningRate(String teamId) {
		String SQL = "SELECT COUNT(*) FROM t_score WHERE teamId=? AND ts_result='Win'";
		int totalWins = template.queryForObject(SQL, Integer.class, teamId);
		
		String totalGamesSQL = "SELECT COUNT(*) FROM t_score WHERE teamId=?";
		int totalGames = template.queryForObject(totalGamesSQL, Integer.class, teamId);
		
		 double rate = (totalGames > 0) ? ((double) totalWins / totalGames) * 100 : 0.0;

		    // 해당 TeamWinning 객체 가져오기
		    TeamWinning teamWinning = readWinningById(teamId);

		    // 가져온 TeamWinning 객체에 winningRate 저장
		    if (teamWinning != null) {
		        teamWinning.setRate(Math.round(rate * 1000.0) / 1000.0);
		    }

		    return Math.round(rate * 1000.0) / 1000.0;
		}

	@Override
	public int totalGames(String teamId) {
		String SQL = "SELECT COUNT(*) FROM t_score WHERE teamId=?";
		int matches = template.queryForObject(SQL, Integer.class, teamId);
	
	    TeamWinning teamWinning = readWinningById(teamId);

	    // 가져온 TeamWinning 객체에 matches 저장
	    if (teamWinning != null) {
	        
	        teamWinning.setTotalWins(matches);
	    }

	    return matches;
	}

	@Override
	public List<TeamWinning> calAndSortWinningRate(){
		  List<TeamWinning> allWinningList = readAllWinningList();

		    // 중복된 teamId를 제거하기 위한 Set
		    Set<String> uniqueTeamIds = new HashSet<>();

		    // 중복을 제거하고 계산한 결과를 저장할 List
		    List<TeamWinning> uniqueWinningList = new ArrayList<>();

		    // 팀별 계산한 것들 저장
		    for (TeamWinning teamWinning : allWinningList) {
		        String teamId = teamWinning.getTeamId();

		        // 중복된 teamId인 경우 스킵
		        if (uniqueTeamIds.contains(teamId)) {
		            continue;
		        }

		        // 중복 제거된 teamId를 Set에 추가
		        uniqueTeamIds.add(teamId);
		
		        
		        // TeamWinning에서 팀 이름을 가져오기 위해 Repository 또는 Service를 이용하여 Team 객체를 조회
		        Team team = teamRepository.readTeamById(teamId);
		        
				/* Team team = new Team(); */
		        int totalWins = totalWins(teamId);
		        int totalLose = totalLose(teamId);
		        int totalTie = totalTie(teamId);
		        double winningRate = calculateWinningRate(teamId);
		        int totalGames = totalGames(teamId);
		        String recent = teamWinningService.getRecentMatchesResult(teamId);
		        String teamName = team.getTeamName();
		        String fileName = team.getFileName();
		        
		        // 새로운 TeamWinning 객체에 값 설정
		        TeamWinning uniqueTeamWinning = new TeamWinning();
		        uniqueTeamWinning.setTeamId(teamId);
		        uniqueTeamWinning.setTotalWins(totalWins);
		        uniqueTeamWinning.setTotalLose(totalLose);
		        uniqueTeamWinning.setTotalTie(totalTie);
		        uniqueTeamWinning.setRate(winningRate);
		        uniqueTeamWinning.setMatches(totalGames);
		        uniqueTeamWinning.setRecent(recent);
		        uniqueTeamWinning.setTeamName(teamName);
		        uniqueTeamWinning.setFileName(fileName);
		        System.out.println(teamName);
		        System.out.println(fileName);
		        // Team이 null이 아닌 경우에만 팀 이름 설정
		        if (team != null) {
		            uniqueTeamWinning.setTeamName(team.getTeamName());
		            System.out.println(team.getTeamName());
		        }
		        
		        // 중복을 제거하고 계산한 결과를 저장
		        uniqueWinningList.add(uniqueTeamWinning);
		        
		    }

		    // 승률을 기준으로 내림차순으로 정렬
		    Collections.sort(uniqueWinningList, Comparator.comparingDouble(TeamWinning::getRate).reversed());

		 // 순위 부여 및 출력
		    int rank = 1;
		    for (TeamWinning teamWinning : uniqueWinningList) {
		        teamWinning.setRank(rank++);
		    }


		    
		    return uniqueWinningList;
	}
}

 

 

 

 

 

뷰페이지

 

board.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>    
<!DOCTYPE html>
<html lang="KR">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-4bw+/aepP/YC94hEpVNVgiZdgIC5+VKNBQNGCHeKRQN+PtmoHDEXuppvnDJzQIu9" crossorigin="anonymous">
  <link rel="icon" href="img/Fevicon.png" type="image/png">

	<link rel="stylesheet" href="<c:url value='/resources/vendors/bootstrap/bootstrap.min.css' />">
	<link rel="stylesheet" href="<c:url value='/resources/vendors/fontawesome/css/all.min.css' />">
	<link rel="stylesheet" href="<c:url value='/resources/vendors/themify-icons/themify-icons.css' />">
	<link rel="stylesheet" href="<c:url value='/resources/vendors/linericon/style.css' />">
	<link rel="stylesheet" href="<c:url value='/resources/vendors/owl-carousel/owl.theme.default.min.css' />">
	<link rel="stylesheet" href="<c:url value='/resources/vendors/owl-carousel/owl.carousel.min.css' />">
	<link rel="stylesheet" href="<c:url value='/resources/vendors/nice-select/nice-select.css' />">
	<link rel="stylesheet" href="<c:url value='/resources/vendors/nouislider/nouislider.min.css' />">
	<script src="https://kit.fontawesome.com/c3566586b6.js" crossorigin="anonymous"></script>
	<link rel="stylesheet" href="<c:url value='/resources/css/style.css' />">

</head>
<style>
    /* *{border: 1px solid black;} */
    td
    {
        font-size: rem;
    }
    td img
    {
       width: 32px;
    }
    .shadow-md 
    {
        
        padding: 1rem;
        box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
    }

    .card i
    {
        /* border: 1px solid black; */
        background-color:rgb(192, 212, 255);
        padding: 17%;
        border-radius: 50%;
        transform: translatex(-10%);
        transform: translatey(10%);
    }
    .table-sm td
    {
        padding: 0.875rem !important ;
        
    }
    td:last-child, th:last-child
    {
        /* border: 1px solid red; */
        padding: 0px !important;
        width: 5%;
    }

    /* #sec
    {
        background-color: rgb(250, 196, 116) !important;
    }
    #thir
    {
        background-color: rgb(144, 194, 144);
    } */
</style>
<body>
     <!--================ Start Header Menu Area =================-->
	<header class="header_area">
        <div class="main_menu">
          <nav class="navbar navbar-expand-lg navbar-light">
            <div class="container">
              <a class="navbar-brand logo_h" href="index.html"><img src="img/logo.png" alt=""></a>
              <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
                aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              <div class="collapse navbar-collapse offset" id="navbarSupportedContent">
                <ul class="nav navbar-nav menu_nav ml-auto mr-auto">
                  <li class="nav-item"><a class="nav-link" href="index.html">홈</a></li>
                  <li class="nav-item"><a class="nav-link" href="index.html">쇼핑</a></li>
                  <li class="nav-item active submenu dropdown">
                    <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                      aria-expanded="false">구단</a>
                    <ul class="dropdown-menu">
                      <li class="nav-item"><a class="nav-link" href="category.html">구단등록</a></li>
                      <li class="nav-item"><a class="nav-link" href="single-product.html">구단목록</a></li>
                      <li class="nav-item"><a class="nav-link" href="checkout.html">구단랭킹</a></li>
                      <li class="nav-item"><a class="nav-link" href="confirmation.html">나의구단</a></li>
                    </ul>
                                </li>
                  <li class="nav-item submenu dropdown">
                    <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                      aria-expanded="false">클래스</a>
                    <ul class="dropdown-menu">
                      <li class="nav-item"><a class="nav-link" href="blog.html">클래스?</a></li>
                      <li class="nav-item"><a class="nav-link" href="single-blog.html">클래스목록</a></li>
                    </ul>
                                </li>
                  <li class="nav-item submenu dropdown">
                    <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                      aria-expanded="false">경기장</a>
                    <ul class="dropdown-menu">
                      <li class="nav-item"><a class="nav-link" href="blog.html">경기장목록</a></li>
                      <li class="nav-item"><a class="nav-link" href="single-blog.html">경기장예약</a></li>
                    </ul>
                                </li>
                  <li class="nav-item submenu dropdown">
                    <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                      aria-expanded="false">관광</a>
                    <ul class="dropdown-menu">
                      <li class="nav-item"><a class="nav-link" href="blog.html">맛집</a></li>
                      <li class="nav-item"><a class="nav-link" href="single-blog.html">둘러볼곳</a></li>
                    </ul>
                                </li>
                                <li class="nav-item submenu dropdown">
                    <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                      aria-expanded="false">의료</a>
                    <ul class="dropdown-menu">
                      <li class="nav-item"><a class="nav-link" href="login.html">병원목록</a></li>
                      <li class="nav-item"><a class="nav-link" href="register.html">병원예약</a></li>
                      <li class="nav-item"><a class="nav-link" href="tracking-order.html">재활추천</a></li>
                    </ul>
                  </li>
                </ul>
    
                <ul class="nav-shop">
                  <li class="nav-item"><button><i class="ti-search"></i></button></li>
                  <li class="nav-item"><button><i class="ti-shopping-cart"></i><span class="nav-shop__circle">3</span></button> </li>
                  <li class="nav-item"><button><i class="fas fa-user"></i></button></li>
                </ul>
              </div>
            </div>
          </nav>
        </div>
      </header>
        <!--================ End Header Menu Area =================-->
    
    	<!-- ================ start banner area ================= -->	
	<section  class="blog-banner-area" id="category">
		<div class="container h-100" style="background: url(/img/board.jpg) bottom /100% no-repeat; ">
			<div class="blog-banner">
				<div class="text-center">
					<h1>Team Lanking</h1>
					<nav aria-label="breadcrumb" class="banner-breadcrumb">
            <ol class="breadcrumb">
              <li class="breadcrumb-item"><a href="#">Home</a></li>
              <li class="breadcrumb-item active" aria-current="page">Checkout</li>
            </ol>
          </nav>
				</div>
			</div>
    </div>
	</section>
    <!-- ================ end banner area ================= -->
    
    <!-- ================ start view-div ================= -->	
    <div  class="container shadow-md text-bg-primary p-3 rounded my-3 ">
        <a>
            <div >
            <span>Star this project on GitHub</span>
            </div>
            <span>View more →</span>
        </a>
    </div>
     <!-- ================ end view-div ================= -->

      <!-- ================ start Cards section ================= -->	
    <section class="mt-3  container d-flex justify-content-between">
       <!-- card-->
        <div class="card mb-3 " style="width: 30%; ">
            <div class="row g-0">
                <div class="col-md-4">
                    <!-- <img src="..." class="img-fluid rounded-start" alt="..."> -->
                    <i id="fir" class="m-4 fa-solid fa-users"></i>
                </div>
                <div class="col-md-8">
                    <div class="card-body">           
                    <p class="card-text">Total clients</p>
                    <span class="fw-semibold">6389</span>
                    </div>
                </div>
            </div>
        </div>
         <!-- card-->
        <div class="card mb-3" style="width: 30%;">
            <div class="row g-0">
            <div class="col-md-4 ">
                <!-- <img src="..." class="img-fluid rounded-start" alt="..."> -->
                <i id="sec" class="m-4 fa-solid fa-medal"></i>
            </div>
            <div class="col-md-8">
                <div class="card-body">           
                <p class="card-text">Total clients</p>
                <span class="fw-semibold">6389</span>
                </div>
            </div>
            </div>
        </div>
         <!-- card-->
        <div class="card mb-3" style="width: 30%;">
            <div class="row g-0">
            <div class="col-md-4">
                <!-- <img src="..." class="img-fluid rounded-start" alt="..."> -->
                <i id="thir" class="m-4 fa-solid fa-baseball"></i>
            </div>
            <div class="col-md-8">
                <div class="card-body">           
                <p class="card-text">Total clients</p>
                <span class="fw-semibold">6389</span>
                </div>
            </div>
            </div>
        </div>
    </section>
    <!-- ================ end Cards section ================= -->	

    <div class=" container table-responsive" >
        <table  class="table table-sm">
            <thead class="table-light">
              <tr>
                
                <th scope="col">#</th>
                <th scope="col"></th>                                                      
                <th scope="col">팀명</th>
                <th scope="col">경기수</th>
                <th scope="col">승</th>
                <th scope="col">무</th>
                <th scope="col">패</th>
                <th scope="col">승률</th>
                <th scope="col">연속</th>
                <th scope="col">최근 10 경기</th>
                <th scope="col"></th>
                
              </tr>
            </thead>
            <tbody>
             <c:forEach var="teamWinning" items="${winningList}">
              <tr>
                <th scope="row">${teamWinning.rank}</th>
                <td>
                    <img src="<c:url value='/resources/images/${teamWinning.fileName}'/>" alt="${teamWinning.teamName} Image"  />
                </td> 
                <td>${teamWinning.teamName}</td>
                <td>${teamWinning.matches}</td>
                <td>${teamWinning.totalWins}</td>
                <td>${teamWinning.totalTie}</td>
                <td>${teamWinning.totalLose}</td>
                <td>${teamWinning.rate}</td>
                <td>2</td>
                <td>${teamWinning.recent}</td>
                <td>
                    <button  type="button" class="btn-sm btn btn-outline-warning">상세보기</button>
                </td>
              </tr>           
              </c:forEach>
            </tbody>
            <caption>
                <div  class="d-flex justify-content-between" >
                <p>List of users</p>
                <nav  aria-label="Page navigation example">
                    <ul class="pagination " style="justify-content: center;">
                      <li class="page-item">
                        <a class="page-link" href="#" aria-label="Previous">
                          <span aria-hidden="true">&laquo;</span>
                        </a>
                      </li>
                      <li class="page-item"><a class="page-link" href="#">1</a></li>
                      <li class="page-item"><a class="page-link" href="#">2</a></li>
                      <li class="page-item"><a class="page-link" href="#">3</a></li>
                      <li class="page-item">
                        <a class="page-link" href="#" aria-label="Next">
                          <span aria-hidden="true">&raquo;</span>
                        </a>
                      </li>
                    </ul>
                  </nav>
                </div>
            </caption>
            
          </table>
    </div>
</body>
</html>

 

 

 

 

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday