IDEA+Spring + Spring MVC + MyBatis+Bootstrap+Mysql酒店管理系统源码
一、系统介绍
本系统实现了酒店管理系统源码,管理端实现了管理员登录、会员信息管理、客房信息类型管理、客房信息管理、客房信息添加
、预定信息管理、入住信息管理、入住信息添加
1.环境配置
JDK版本:1.8
Mysql:5.7
二、系统展示
1. 管理员登录
账号:admin 密码:123456
2.会员信息管理
3.客房信息类型管理
4.客房信息管理
5.客房信息添加
6.预定信息管理
7.入住信息管理
8.入住信息添加
三、部分代码
UserMapper.java
package cn.edu.dao;
import cn.edu.entity.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface UserMapper {
boolean deleteByPrimaryKey(Integer userId);
boolean insert(User record);
User selectByPrimaryKey(Integer userId);
List<User> selectAll();
boolean updateByPrimaryKey(User record);
User selectUser(@Param("userName") String userName, @Param("userPwd") String userPwd);
int selectUserByName(String userName);
boolean deleteByName(String userName);
}
UserController.java
package cn.edu.controller;
import cn.edu.entity.Notice;
import cn.edu.entity.Room;
import cn.edu.entity.RoomType;
import cn.edu.entity.User;
import cn.edu.service.*;
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.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import java.util.HashMap;
import java.util.List;
@Controller
public class UserController {
@Autowired
private RoomTypeService roomTypeService;
@Autowired
private ReserveService reserveService;
@Autowired
private RoomService roomService;
@Autowired
private NoticeService noticeService;
@Autowired
private UserService userService;
@RequestMapping("user_main.html")
public ModelAndView userMain(){
List<RoomType> roomTypeList = roomTypeService.selectAll();
ModelAndView mav = new ModelAndView("user_main");
mav.addObject("roomTypeList", roomTypeList);
List<Room> roomList = roomService.selectAll();
mav.addObject("roomList", roomList);
List<Notice> noticeList = noticeService.selectAll();
mav.addObject("noticeList", noticeList);
return mav;
}
@RequestMapping(value = "room_type.html", method = RequestMethod.GET)
public ModelAndView roomType(@RequestParam(value = "typeId") int typeId, @RequestParam(value = "type") String type){
List<Room> roomList = reserveService.selectByRoomType(type);
ModelAndView mav = new ModelAndView("user_main");
mav.addObject("roomList", roomList);
return mav;
}
@RequestMapping("deleteUser")
@ResponseBody
public Object deleteUser(@RequestParam("userName") String userName){
HashMap<String, String> res = new HashMap<>();
if (userService.deleteUser(userName)){
res.put("stateCode", "1");
} else {
res.put("stateCode", "0");
}
return res;
}
@RequestMapping("user_management.html")
public ModelAndView toUserInfoManagement(){
List<User> userList = userService.selectAll();
ModelAndView mav = new ModelAndView("user_management");
mav.addObject("userList", userList);
return mav;
}
}
User.java
package cn.edu.entity;
public class User {
private Integer userId;
private String userName;
private String userPwd;
private String address;
private String phone;
private String email;
private String qq;
private String photoUrl;
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName == null ? null : userName.trim();
}
public String getUserPwd() {
return userPwd;
}
public void setUserPwd(String userPwd) {
this.userPwd = userPwd == null ? null : userPwd.trim();
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address == null ? null : address.trim();
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone == null ? null : phone.trim();
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email == null ? null : email.trim();
}
public String getQq() {
return qq;
}
public void setQq(String qq) {
this.qq = qq == null ? null : qq.trim();
}
public String getPhotoUrl() {
return photoUrl;
}
public void setPhotoUrl(String photoUrl) {
this.photoUrl = photoUrl == null ? null : photoUrl.trim();
}
}
四、其他
获取源码
点击以下链接获取源码。
IDEA+Spring + Spring MVC + MyBatis+Bootstrap+Mysql酒店管理系统源码
IDEA+spring boot+mybatis+spring mvc+bootstrap+Mysql停车位管理系统源码
IDEA+Spring Boot+MyBatis+shiro+Layui+Mysql智能平台管理系统
Java+Swing+Mysql实现学生宿舍管理系统