JAVA-B / S laboratory-based reservation system

Record learning every day, have a good mood every day. * ^ _ ^ *

Thinking today, a complete laboratory reservation system project, which features need to achieve?
Such common items are described below:
In the development environment JAVA, MYSQL Based database, three-tier architecture of the B / S model, and connecting a plurality of databases in the data access layer, constructed based on the B / S mode Laboratory reservation system, which greatly improved the efficiency and quality of university laboratory management.
the SSM (MYECLIPSE) for this framework and its projects, reduce duplication of effort using the MVC idea to a great extent. And SSM (MYECLIPSE) framework with the best development tools is MYECLIPSE. MYECLIPSE integrates a large number of plug-ins, you can better use the SSM (MYECLIPSE) for development projects, while making more effective project development.
Through careful analysis of the laboratory system reservation system, you can obtain an appointment system laboratory system is a background program.
In such a project, the system login role is essential for each login role is set account and password. To ensure the system can log in normal use. SSM (MYECLIPSE) contained in the project administrator login role, students.
System school students, there is a relationship between the lab, we will save their relationship in the reservation table. Nicheng field corresponds to their relationship is such appointment student-student, student id reservation id field corresponds with students, mingzi field corresponds to the laboratory and laboratory appointments, appointments and lab laboratory id id the corresponding field
.

The summary results for all data systems: the administrator (admin), students (xuesheng), reservation (yuyue), laboratory (shiyanshi)

Administrators table

Field Name | Type | property | describe 
the above mentioned id |  INT ( 11 ) |  PRIMARY  KEY  | administrator the above mentioned id 
username |  VARCHAR ( 255 ) |  | account 
password |  VARCHAR ( 255 ) |  | password

 

Student Table

Field Name | Type | property | describe 
the above mentioned id |  INT ( 11 ) |  PRIMARY  KEY  | student the above mentioned id 
nicheng |  VARCHAR ( 255 ) |  | nickname 
username |  VARCHAR ( 255 ) |  | account 
password |  VARCHAR ( 255 ) |  | password 
zhuanye |  VARCHAR ( 255 ) |  | profession

 

Table reservation

Field Name | Type | property | describe 
the above mentioned id |  INT ( 11 ) |  PRIMARY  KEY  | reservation the above mentioned id 
xuesheng |  VARCHAR ( 255 ) |  | Student 
xueshengid |  VARCHAR ( 255 ) |  | students the above mentioned id 
shiyanshi |  VARCHAR ( 255 ) |  | Laboratory 
shiyanshiid |  VARCHAR ( 255 ) |  |Laboratory of the above mentioned id 
yuyueshijian |  VARCHAR ( 255 ) |  | appointment

 

Laboratory table

Field Name | Type | property | describe 
the above mentioned id |  INT ( 11 ) |  PRIMARY  KEY  | Laboratory of the above mentioned id 
mingzi |  VARCHAR ( 255 ) |  | name 
Jieshao |  VARCHAR ( 255 ) |  | Introduction 
didian |  VARCHAR ( 255 ) |  | Location 
fuzeren |  VARCHAR ( 255 ) |  |Head of 
lianxifangshi |  VARCHAR ( 255 ) |  | Contact

 

 

 

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------

-- ----------------------------

-- Table structure for ggshiyanshiyuyue

-- ----------------------------

DROP TABLE IF EXISTS `t_admin`;

CREATE TABLE `t_admin` (`id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '管理员id',`username` VARCHAR(255) DEFAULT NULL COMMENT '账号',`password` VARCHAR(255) DEFAULT NULL COMMENT '密码',PRIMARY KEY (`id`)

) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='管理员';

-- ----------------------------

DROP TABLE IF EXISTS `t_xuesheng`;

CREATE TABLE `t_xuesheng` (`id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '学生id' , `Nicheng` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' nickname ' ,` username` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' account number ' , `password` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' password ' ,` zhuanye` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' professional ' , a PRIMARY  KEY ( `id`)

) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='学生';

-- ----------------------------

DROP TABLE IF EXISTS `t_yuyue`;

CREATE TABLE `t_yuyue` (`id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '预约id',`xuesheng` VARCHAR(255) DEFAULT NULL COMMENT '学生',`xueshengid` INT(11 ) the DEFAULT  NULL the COMMENT ' students the above mentioned id ' , `shiyanshi` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' laboratory ' ,` shiyanshiid` INT ( 11 ) the DEFAULT  NULL the COMMENT ' lab the above mentioned id ' , `yuyueshijian` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' appointment ' , a PRIMARY  KEY ( `id`) 

) ENGINE = MyISAMDEFAULT CHARSET=utf8 COMMENT='预约';

-- ----------------------------

DROP TABLE IF EXISTS `t_shiyanshi`;

CREATE TABLE `t_shiyanshi` (`id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '实验室id',`mingzi` VARCHAR(255) DEFAULT NULL COMMENT '名字',`jieshao` VARCHAR(255) DEFAULT NULL the COMMENT ' introduction ' , `didian` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' place ' ,` fuzeren` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' responsible person ' , `lianxifangshi` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' Contact ' , a PRIMARY  KEY ( `id`) 

) ENGINE = MyISAM the DEFAULT the CHARSET =the COMMENT UTF8 = ' Lab ' ;

 

 

Adding laboratory modules:

By adding laboratory module, can be added to complete the operation of the laboratory. Jump all the information on the page to add lab page, enter the lab, click the Add operation, laboratory data can be submitted to the shiyanshiController in to post. Information contained field lab, including name, description, location, responsible person, contact information. In shiyanshiController accept all laboratory parameters by defining shiyanshi. Using the insert method shiyanshidao shiyanshi entities into the database. The process of adding data corresponding to the matching shiyanshixml complete the insertion operation is performed in the sql statement in shiyanshiMapper. The part of the core code is as follows:

The page transmitted by the insert method shiyanshidao laboratory added to the database shiyanshidao.insert (shiyanshi);

Add the successful laboratory information saved to the message request, the user is given the page prompt request.setAttribute ( "message", "add the laboratory success");

Return Laboratory Management Interface

return "forward:/tianjiashiyanshi.action";

Query laboratory module:

When entering the laboratory query page in a browser, then the browser address bar is shiyanshiguanli.action, the address will respond shiyanshiController class shiyanshiguanli, in the process, get all the information selectByexample laboratory methods, and save the information to the request, make cycle through the pages. The part of the core code is as follows:

Generating a laboratory sample classes, ShiyanshiExample example = new ShiyanshiExample () define the query by example;

Check out all the laboratory information List shiyanshiall = shiyanshidao.selectByExample (example) by selectByExample method of shiyanshidao;

The laboratory information stored in the request, on display request.setAttribute ( "shiyanshiall", shiyanshiall) page by foreach method;

Return Laboratory Management Interface

return "forward:/shiyanshiguanli.action";

Modify laboratory modules:

After filling out the page modify information, click the Modify button to submit data to xiugaishiyanshi, the package as a laboratory

Use update methods to modify the laboratory information, synchronize data to the database, to complete the modification operation.

Modify the definition of a successful message, modify laboratory success, and save it to request specific code is as follows:

Corresponding modified laboratory shiyanshidao.updateByPrimaryKeySelective (shiyanshi) by modifying the method according to the id of shiyanshidao;

The laboratory successfully modify information stored in the message request, give the user prompt request.setAttribute in the page ( "message", "Modify laboratory information successfully");

Return Laboratory Management Interface

return "forward:/shiyanshiguanli.action";

Delete Laboratory Module:

In the management page, click Delete. Page through the href attribute a label, use the get method the laboratory

Id is uploaded to the server, receiving by shiyanshiController shanchushiyanshi class in the server, after calling deleteByPrimaryKey shiyanshiMapper method according to delete the ID. Save the information to delete the message request, the user is given delete successful message in the page, the part of the core code is as follows:

Delete by deleting the corresponding method according shiyanshidao id laboratory shiyanshidao.deleteByPrimaryKey (id);

The laboratory successfully delete information stored in the message request, give the user prompt request.setAttribute in the page ( "message", "delete the laboratory success");

Return Laboratory Management Interface

return "forward:/shiyanshiguanli.action";

Guess you like

Origin www.cnblogs.com/rt14/p/11598842.html