请选择 进入手机版 | 继续访问电脑版
MSIPO技术圈 首页 IT技术 查看内容

IDEA+spring+spring mvc+mybatis+bootstrap+jquery+Mysql运动会管理系统

2023-07-13


一、系统介绍

本系统实现了运动会管理系统,管理端实现了管理员登录、修改密码、 运动会开幕信息、 运动会广播信息、 比赛项目信息、 比赛成绩信息、 运动器材信息、学生信息、 教师信息、 班级信息、 院系信息、 开幕管理、 广播管理、 项目管理、 成绩管理、 器材管理、用户管理

1.环境配置

JDK版本:1.8
Mysql:5.7

二、系统展示

1. 管理员登录

在这里插入图片描述

账号:admin 密码:admin

2.修改密码

在这里插入图片描述

3.运动会开幕信息

在这里插入图片描述

4.运动会广播信息

在这里插入图片描述

5. 比赛项目信息

在这里插入图片描述

6.比赛成绩信息

在这里插入图片描述

7.运动器材信息

在这里插入图片描述

8.学生信息

在这里插入图片描述

9.教师信息

在这里插入图片描述

10.班级信息

在这里插入图片描述

11. 院系信息

在这里插入图片描述

12.开幕管理

在这里插入图片描述

13.广播管理

在这里插入图片描述

14.项目管理

在这里插入图片描述

15. 成绩管理

在这里插入图片描述

16、器材管理

在这里插入图片描述

17、用户管理

在这里插入图片描述

三、部分代码

UserMapper.java

package com.handy.dao;

import com.handy.domain.Role;
import com.handy.domain.User;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.FetchType;

import java.util.List;

@Mapper
public interface UserMapper {

    @Select("select * from user where u_id = #{uId} ")
    @Results(value = {
            @Result(id = true, column = "u_id", property = "uId"),
            @Result(column = "u_password", property = "uPassword"),
            @Result(column = "u_status", property = "uStatus"),
            @Result(column = "u_id", property = "matches", many = @Many(select = "com.handy.dao.MatchesMapper.selectBymNo", fetchType = FetchType.EAGER)),
            @Result(column = "u_id", property = "borrow", many = @Many(select = "com.handy.dao.BorrowMapper.selectBybNo", fetchType = FetchType.LAZY))
    })
    User selectByPK(String uId);

    @Select("select * from user where u_id=#{uId} ")
    @Results(value = {
            @Result(id = true, column = "u_id", property = "uId"),
            @Result(column = "u_password", property = "uPassword"),
            @Result(column = "u_status", property = "uStatus"),
    })
    User selectByPKToLogin(String uId);

    @Select("select * from user where u_id = #{uId} ")
    @Results(value = {
            @Result(id = true, column = "u_id", property = "uId"),
            @Result(column = "u_password", property = "uPassword"),
            @Result(column = "u_status", property = "uStatus"),
            @Result(column = "u_id", property = "student", one = @One(select = "com.handy.dao.StudentMapper.selectBysNo", fetchType = FetchType.EAGER))
    })
    User selectByPKToS(String uId);


    @Select("SELECT r.*  FROM user u LEFT JOIN role_user ru ON u.u_id = ru.u_id LEFT JOIN role r ON ru.r_id = r.r_id where u.u_id = #{uId} ")
    @Results(value = {
            @Result(id = true, column = "r_id", property = "rId"),
            @Result(column = "r_name", property = "rName"),
            @Result(column = "r_description", property = "rDescription")
    })
    List<Role> selectrNameByuId(String uId);


    @Update("update user set u_password = #{nPassword} where u_id = #{uId}")
    void updatePW(@Param("nPassword") String nPassword, @Param("uId") String uId);

    @Select("select u_password from user where u_id =#{uId} ")
    String selectPW(String uId);

    @Select("select * from user")
    @Results(value = {
            @Result(id = true, column = "u_id", property = "uId"),
            @Result(column = "u_password", property = "uPassword"),
            @Result(column = "u_status", property = "uStatus"),
            @Result(column = "u_id", property = "student", one = @One(select = "com.handy.dao.StudentMapper.selectBysNo", fetchType = FetchType.EAGER)),
            @Result(column = "u_id", property = "teacher", one = @One(select = "com.handy.dao.TeacherMapper.selectBytNo", fetchType = FetchType.EAGER)),
            @Result(column = "u_id", property = "other", one = @One(select = "com.handy.dao.OtherMapper.selectByoNo", fetchType = FetchType.EAGER))
    })
    List<User> findAll();

    @Update("update user set u_status = #{uStatus} where u_id = #{Id}")
    void updateUstatus(@Param("Id") String Id, @Param("uStatus") Boolean uStatus);

    @Update("update user set u_status = true where u_id = #{Id} ")
    void updateUstatusOn(String Id);

    @Update("update user set u_status = false where u_id = #{Id} ")
    void updateUstatusOff(String Id);

    @Insert("insert into user(u_id, u_password, u_status)  value (#{Id},#{newPassword} ,#{Status} )")
    void insert(@Param("Id") String Id, @Param("newPassword") String newPassword, @Param("Status") Boolean Status);

    @Update("update user set u_id = #{Id} where u_id = #{oId}")
    void updatePK(@Param("Id") String Id, @Param("oId") String oId);
}


UserController.java

package com.handy.controller;

import com.handy.domain.Other;
import com.handy.domain.Student;
import com.handy.domain.Teacher;
import com.handy.domain.UserPW;
import com.handy.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/user")
public class UserController {


    @Autowired
    private UserService userService;

    /**
     * 用户信息详情,即我的信息页面
     *
     * @param uId
     * @return
     */
    @RequestMapping("/userDetails.do")
    public ModelAndView userDetails(String uId) {
        ModelAndView mv = new ModelAndView();
        Student student = userService.findSDetails(uId);
        Teacher teacher = userService.findTDetails(uId);
        Other other = userService.findODetails(uId);
        mv.addObject("student", student);
        mv.addObject("teacher", teacher);
        mv.addObject("other", other);
        mv.setViewName("user-details");
        return mv;
    }

    /**
     * 修改页面
     *
     * @return
     */
    @RequestMapping("/updatePW.do")
    public ModelAndView updatePW() {
        ModelAndView mv = new ModelAndView();
        mv.setViewName("user-updatepw");
        return mv;
    }

    /**
     * 修改密码功能
     *
     * @param userPW
     * @return
     */
    @RequestMapping(value = "/changePW.do", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    @ResponseBody
    public String changPW(@RequestBody UserPW userPW) {
        try {
            Boolean flag = userService.changePW(userPW);
            if (flag)
                return "200";
            else
                return "400";
        } catch (Exception e) {
            return "400";
        }
    }

    /**
     * 用户状态管理页面
     *
     * @return
     */
    @RequestMapping("/user.do")
    public ModelAndView userSetting() {
        ModelAndView mv = new ModelAndView();
        Map<String, Object> map = userService.findAll();
        List<Student> studentList = (List<Student>) map.get("studentList");
        List<Teacher> teacherList = (List<Teacher>) map.get("teacherList");
        List<Other> otherList = (List<Other>) map.get("otherList");
        mv.addObject("student", studentList);
        mv.addObject("teacher", teacherList);
        mv.addObject("other", otherList);
        mv.setViewName("user-setting");
        return mv;

    }

    /**
     * 修改用户状态
     *
     * @param Id
     * @param uStatus
     * @return
     */
    @RequestMapping("/updateUstatus.do")
    public String updateUstatus(String Id, Boolean uStatus) {
        userService.updateUstatus(Id, uStatus);
        return "redirect:user.do";
    }

    /**
     * 批量修改用户状态为开启
     *
     * @param Id
     * @return
     */
    @RequestMapping("/updateUstatusOn.do")
    public String updateUstatusOn(String[] Id) {
        userService.updateUstatusOn(Id);
        return "redirect:user.do";
    }

    /**
     * 批量修改用户状态为关闭
     *
     * @param Id
     * @return
     */
    @RequestMapping("/updateUstatusOff.do")
    public String updateUstatusOff(String[] Id) {
        userService.updateUstatusOff(Id);
        return "redirect:user.do";
    }


}

User.java

package com.handy.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {
    /**
     * 用户账号
     */
    private String uId;
    /**
     * 密码
     */
    private String uPassword;
    /**
     * 用户状态
     */
    private Boolean uStatus;
    private List<Matches> matches;
    private List<Borrow> borrow;
    private Student student;
    private Teacher teacher;
    private Other other;
    private List<Role> roles;

    public User(String uId, String uPassword, Boolean uStatus) {
        this.uId = uId;
        this.uPassword = uPassword;
        this.uStatus = uStatus;
    }


}

四、其他

获取源码

点击以下链接获取源码。
IDEA+spring+spring mvc+mybatis+bootstrap+jquery+Mysql运动会管理系统源码
IDEA+SpringBoot+mybatis+bootstrap+jquery+Mysql车险理赔管理系统源码
IDEA+Spring Boot + MyBatis + Layui+Mysql垃圾回收管理系统源码
IDEA+SpringBoot+mybatis+SSM+layui+Mysql学生就业信息管理系统源码
IDEA+springboot+jpa+Layui+Mysql销售考评系统源码
IDEA+Spring + Spring MVC + MyBatis+Bootstrap+Mysql酒店管理系统源码
IDEA+spring boot+mybatis+spring mvc+bootstrap+Mysql停车位管理系统源码

Java+Swing+Mysql实现学生宿舍管理系统

Java+Swing+Txt实现自助款机系统

Java+Swing+Mysql自助存取款机系统

Java+Swing+mysql5实现学生成绩管理系统(带分页)

Java+Swing+Mysql实现超市商品管理系统源码

Java+Swing+Mysql实现通讯录管理系统源码

Java+Swing+Mysql实现图书管理系统源码

相关阅读

手机版|MSIPO技术圈 皖ICP备19022944号-2

Copyright © 2023, msipo.com

返回顶部