Firstly, the current situation is analyzed XX Current situation of regional epidemic prevention and control . Then the development platform and technology of current software development are introduced , Database and so on , Propose to adopt JSP technology , At the same time Spring
Boot As a framework for development , The data storage adopts the classic method MySQL Open source database , Simple interface , Practical requirements , Based on Spring Boot Campus
Epidemic prevention and control system ; Finally, a login with registration is realized , Manage personal information , Order epidemic prevention materials , Declare personal information , Comment management , And the administrator's user management of the system , Epidemic prevention material management , Order management , Information management and other functions
Campus epidemic prevention and control system . The system can provide schools with personal information declared by students , Provide and order epidemic prevention materials for students , A platform for instant communication with others , So as to improve the efficiency of epidemic prevention and control .

key word : Epidemic prevention and control Spring Boot MySQL


package com.boot.controller; import java.util.ArrayList; import
java.util.List; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import
org.springframework.web.bind.annotation.RequestMapping; import
com.boot.entity.Admin; import com.boot.service.AdminService; import
com.boot.util.PageHelper; import com.boot.util.VeDate; // Define as controller @Controller //
set up path @RequestMapping(value = "/admin" , produces = "text/plain;charset=utf-8")
public class AdminController extends BaseController { // injection Service Due to the existence of labels
So it's not necessary getter setter @Autowired private AdminService adminService; // Administrator preparation
@RequestMapping("index.action") public String index() { return "admin/index"; }
// Administrator login 1 Verify that the user name exists 2 Verify that the password is correct @RequestMapping("login.action") public String
login() { String username = this.getRequest().getParameter("username"); String
password = this.getRequest().getParameter("password"); Admin adminEntity = new
Admin(); adminEntity.setUsername(username); List<Admin> adminlist =
this.adminService.getAdminByCond(adminEntity); if (adminlist.size() == 0) {
this.getRequest().setAttribute("message", " user name does not exist "); return
"redirect:/admin/index.action"; } else { Admin admin = adminlist.get(0); if
(password.equals(admin.getPassword())) {
this.getSession().setAttribute("adminid", admin.getAdminid());
this.getSession().setAttribute("adminname", admin.getUsername());
this.getSession().setAttribute("realname", admin.getRealname()); } else {
this.getRequest().setAttribute("message", " Password error "); return
"redirect:/admin/index.action"; } } return "admin/main"; } // The administrator is ready to change the password
@RequestMapping("prePwd.action") public String prePwd() { return
"admin/editpwd"; } // Change Password @RequestMapping("editpwd.action") public String
editpwd() { String adminid = (String)
this.getSession().getAttribute("adminid"); String password =
this.getRequest().getParameter("password"); String repassword =
this.getRequest().getParameter("repassword"); Admin admin =
this.adminService.getAdminById(adminid); if
(password.equals(admin.getPassword())) { admin.setPassword(repassword);
this.adminService.updateAdmin(admin); } else {
this.getRequest().setAttribute("message", " Old password error "); } return
"redirect:/admin/prePwd.action"; } // Administrator log out @RequestMapping("exit.action")
public String exit() { this.getSession().removeAttribute("adminid");
this.getSession().removeAttribute("realname"); return
"redirect:/admin/index.action"; } // Ready to add data
@RequestMapping("createAdmin.action") public String createAdmin() { return
"admin/addadmin"; } // Add data @RequestMapping("addAdmin.action") public String
addAdmin(Admin admin) { admin.setAddtime(VeDate.getStringDateShort());
this.adminService.insertAdmin(admin); return
"redirect:/admin/createAdmin.action"; } // Delete data through primary key
@RequestMapping("deleteAdmin.action") public String deleteAdmin(String id) {
this.adminService.deleteAdmin(id); return "redirect:/admin/getAllAdmin.action";
} // Batch delete data @RequestMapping("deleteAdminByIds.action") public String
deleteAdminByIds() { String[] ids =
this.getRequest().getParameterValues("adminid"); for (String adminid : ids) {
this.adminService.deleteAdmin(adminid); } return
"redirect:/admin/getAllAdmin.action"; } // Update data
@RequestMapping("updateAdmin.action") public String updateAdmin(Admin admin) {
this.adminService.updateAdmin(admin); return
"redirect:/admin/getAllAdmin.action"; } // Show all data
@RequestMapping("getAllAdmin.action") public String getAllAdmin(String number)
{ List<Admin> adminList = this.adminService.getAllAdmin();
PageHelper.getPage(adminList, "admin", null, null, 10, number,
this.getRequest(), null); return "admin/listadmin"; } // Query data by criteria ( Fuzzy query )
@RequestMapping("queryAdminByCond.action") public String
queryAdminByCond(String cond, String name, String number) { Admin admin = new
Admin(); if(cond != null){ if ("username".equals(cond)) {
admin.setUsername(name); } if ("password".equals(cond)) {
admin.setPassword(name); } if ("realname".equals(cond)) {
admin.setRealname(name); } if ("contact".equals(cond)) {
admin.setContact(name); } if ("addtime".equals(cond)) { admin.setAddtime(name);
} } List<String> nameList = new ArrayList<String>(); List<String> valueList =
new ArrayList<String>(); nameList.add(cond); valueList.add(name);
PageHelper.getPage(this.adminService.getAdminByLike(admin), "admin", nameList,
valueList, 10, number, this.getRequest(), "query"); name = null; cond = null;
return "admin/queryadmin"; } // Query data by primary key @RequestMapping("getAdminById.action")
public String getAdminById(String id) { Admin admin =
this.adminService.getAdminById(id); this.getRequest().setAttribute("admin",
admin); return "admin/editadmin"; } public AdminService getAdminService() {
return adminService; } public void setAdminService(AdminService adminService) {
this.adminService = adminService; } }

©2019-2020 Toolsou All rights reserved,
C++ of string of compare usage Python Study notes ( one )evo Tool usage problems ——Degenerate covariance rank, Umeyama alignment is not possibleRISC-V_GD32VF103-TIMER0 timer interrupt java Array subscript variable _Java Basic grammar : array be based on stm32 Control four-wheel trolley motor drive ( one ) be based on redis Design of liking function Software engineering career planning mysql Query random data by conditions _MySQL Random query of several qualified records centos7 install RabbitMq