——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Node.js≥14
开发工具
后端:eclipse/idea/myeclipse/sts等均可配置运行
前端:WebStorm/VSCode/HBuilderX等均可
❗没学过node.js的不要搞前后端分离项目
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明






基于javaweb的SpringBoot校园运动会管理系统(java+springboot+vue+elementui+mysql+maven)
1 2 3 4 5 6 7
| 管理员 admin 123456
学生 201234567892 123456
|
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 4.数据库:MySql 5.7/8.0版本均可; 5.是否Maven项目:是;
技术栈
1.后端:SpringBoot+Mybaits 2.前端:Vue +ElementUI +HTML+CSS+JS
使用说明
项目运行: 1. 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| LambdaQueryWrapper<Competition> wrapper = Wrappers.<Competition>lambdaQuery(); if (StrUtil.isNotBlank(search)) { wrapper.like(Competition::getCompetitionNb, search); } Page<Competition> competitionPage = competitionMapper.selectPage(new Page<>(PageNum, PageSize), wrapper); return Result.success(competitionPage); }
@GetMapping("/selectByNb") public Result<?> selectByNb(@RequestParam(defaultValue = "1") Integer PageNum, @RequestParam(defaultValue = "20") Integer PageSize, String competitionNe, String competitionStart, String competitionEnd) {
Page<Competition> competitionPage = competitionService.selectByNb(new Page<>(PageNum, PageSize), competitionNe, competitionStart, competitionEnd); return Result.success(competitionPage);
}
@PostMapping("/insertCompetition") public Result<?> insert(@RequestBody Competition competition) { Competition competitionN = competitionMapper.selectOne(Wrappers.<Competition>lambdaQuery().eq(Competition::getCompetitionNb, competition.getCompetitionNb())); if (competitionN != null) { return Result.error("-1", "比赛编号已存在"); } else { Competition icompetition = new Competition();
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
@Api @RestController @RequestMapping("/role") public class RoleController {
@Autowired RoleService roleService;
@Resource RoleMapper roleMapper;
@GetMapping("/search") public Result<?> selectEnroll(@RequestParam(defaultValue = "1") Integer PageNum, @RequestParam(defaultValue = "100") Integer PageSize, String usersStnumber, String usersName) {
Page<Role> rolePage = roleService.selectEnroll(new Page<>(PageNum, PageSize),usersStnumber,usersName); return Result.success(rolePage); }
@PostMapping("/addR") public Result<?> addR(Role role) { roleService.addR(role); return Result.success("成功"); }
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| @Autowired CompetitionService competitionService;
@Autowired EnrollService enrollService;
@Autowired ApplicationformService applicationformService;
@Autowired UsersService usersService;
@Resource CompetitionMapper competitionMapper;
@GetMapping("/search") public Result<?> findPage(@RequestParam(defaultValue = "1") Integer PageNum, @RequestParam(defaultValue = "100") Integer PageSize, @RequestParam(defaultValue = "") String search) { LambdaQueryWrapper<Competition> wrapper = Wrappers.<Competition>lambdaQuery(); if (StrUtil.isNotBlank(search)) { wrapper.like(Competition::getCompetitionNb, search); } Page<Competition> competitionPage = competitionMapper.selectPage(new Page<>(PageNum, PageSize), wrapper); return Result.success(competitionPage); }
@GetMapping("/selectByNb") public Result<?> selectByNb(@RequestParam(defaultValue = "1") Integer PageNum, @RequestParam(defaultValue = "20") Integer PageSize,
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| draft.setDraftState(draftState); draftService.updateState(draft); return Result.success(); }
@DeleteMapping("/delete") public Result<?> delete(Integer draftId) { draftMapper.deleteById(draftId); return Result.success(); }
@PostMapping("/insertDraft") public Result<?> insert(@RequestBody Draft draft) { draftMapper.insert(draft); return Result.success(); }
}
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| @GetMapping("/search") public Result<?> findPage(@RequestParam(defaultValue = "1") Integer PageNum, @RequestParam(defaultValue = "100") Integer PageSize, @RequestParam(defaultValue = "") String search) { LambdaQueryWrapper<College> wrapper = Wrappers.<College>lambdaQuery(); if (StrUtil.isNotBlank(search)) { wrapper.like(College::getCollegeNumber, search);
}
Page<College> collegePage = collegeMapper.selectPage(new Page<>(PageNum, PageSize), wrapper); return Result.success(collegePage); }
@PostMapping("/insertCollege") public Result<?> insert(College college) { College collegeNb = collegeMapper.selectOne(Wrappers.<College>lambdaQuery().eq(College::getCollegeNumber, college.getCollegeNumber())); College collegeNe = collegeMapper.selectOne(Wrappers.<College>lambdaQuery().eq(College::getCollegeName, college.getCollegeName())); if (collegeNb != null) { return Result.error("-1", "学院编号已存在"); } if (collegeNe != null) { return Result.error("-2", "学院名称已存在"); } collegeMapper.insert(college); System.out.println("222"); return Result.success(); }
@GetMapping("/deleteCollege") public Result<?> delete(String collegeName) {
List<Users> iusers = usersService.selectUsersCollege(collegeName); collegeService.deleteCollege(collegeName); for (int i=0;i<iusers.size();i++){ System.out.println(i+" "+iusers.get(i).getUsersStnumber()); usersService.delete(iusers.get(i).getUsersStnumber()); roleService.deleteByUsersStnumber(iusers.get(i).getUsersStnumber());
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| */ @PostMapping("/insertCompetition") public Result<?> insert(@RequestBody Competition competition) { Competition competitionN = competitionMapper.selectOne(Wrappers.<Competition>lambdaQuery().eq(Competition::getCompetitionNb, competition.getCompetitionNb())); if (competitionN != null) { return Result.error("-1", "比赛编号已存在"); } else { Competition icompetition = new Competition(); icompetition.setCompetitionNb(competition.getCompetitionNb()); icompetition.setCompetitionNe(competition.getCompetitionNe()); icompetition.setCompetitionSite(competition.getCompetitionSite()); icompetition.setCompetitionPe(competition.getCompetitionPe()); icompetition.setCompetitionTnor(competition.getCompetitionPe()); icompetition.setCompetitionStart(competition.getCompetitionStart()); icompetition.setCompetitionEnd(competition.getCompetitionEnd()); icompetition.setApplyStart(competition.getApplyStart()); icompetition.setApplyEnd(competition.getApplyEnd()); competitionService.addCompetition(icompetition);
System.out.println("222"); return Result.success(); } }
@PutMapping("/updateScore") public Result<?> update(Competition cn) { competitionMapper.updateById(cn); return Result.success(); }
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=180023061907201bc
https://javayms.pages.dev?id=180023061907201bc