[Hotel Management System] (2) Table Design

With the basic requirements, the next step is to sort out the data structure in the system and build the relationship between these entities. The final form of expression is the table design.

1. Class diagram

Let's take a brief look at a class diagram first, sort out the structure in our system, and look at the physical relationship in the class.

staff

Fields included in the employee class:

1) Login account information, used to log in to the management background

2) Employee name

3) Employee types, which are divided into front-end employees, back-end employees, and managers. Different types correspond to different operation permissions

4) Employee mobile phone number

Room

The fields included in the room class:

1) Room name

2) Room number, uniqueness, one room number corresponds to one room

3) Room type, divided into single room, double room, luxury suite, which can be added later

4) Status, divided into free, appointment, checked in

5) The room price, the unit is yuan, supports two decimal places, that is accurate to minutes

Status description:

1. Free, that is, the current room can be reserved

2. In the process of making a reservation, that is, a tenant has already made a reservation for this room

3. Checked in, that is, the reserved tenant has successfully checked in

tenant

Fields included in the tenant class:

1) Reservation id

2) Tenant name

3) The gender of the tenant

4) Tenant's mobile phone number

5) Tenant ID number

Reservation id description:

Associating each appointment, this is equivalent to supplementing the information of the person who made the appointment, that is, after the tenant checks in at the front desk, a corresponding tenant information should be recorded here

reserve

Fields included in the reservation class:

1) room id

2) The tenant's mobile phone number, which is mainly used for inquiries when the tenant arrives at the front desk

3) The name of the tenant, which is mainly used by the front desk staff to check the reservation user information

4) Handle the employee id, which is mainly used to record the employee with the order

5) Status, divided into appointment effective, appointment completed

Status description:

1. The reservation takes effect, that is, the initial state after the tenant makes a successful reservation by phone. At this time, the corresponding room status is under reservation

2. The reservation is completed, that is, the state after the tenant checks in at the front desk. At this time, the corresponding room state is checked in

Order

Fields included in the order class:

1) Reservation id

2) Handle employee id

3) Fees

2. Create a data table

The next chapter will provide the project code and sql files.

employee form

room table

tenant table

appointment form

order form

3. Write at the end

So far, the table design of this system has been basically completed, and the relationship between entity objects has been basically clarified. Next, the actual function development begins.

Guess you like

Origin blog.csdn.net/lrb0677/article/details/125613783