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实现学生宿舍管理系统

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

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

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

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

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

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

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

reg183

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值