JAVA-based part-time agency management system under the framework of SSM

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

When studying part-time agency management system project, to facilitate future access to timely, record it in this platform in the development process of the project. In the study, when the selection of the SSM (MYECLIPSE), whether this framework is to learn or use are very convenient, simple and approachable. Is a framework that we can focus on learning to learn programming, I chose MYECLIPSE intermediary in the development of part-time project management system time to build SSM (MYECLIPSE) framework, will eventually be a part-time agent management system project development project for a background.
The project has a user role, including the administrator, student, each character contains its own user name and password.

The summary results of all system data: administrator (admin), students (xuesheng), jobs (zhiwei)

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 
mingzi |  VARCHAR ( 255 ) |  | name 
username |  VARCHAR ( 255 ) |  | account 
password |  VARCHAR ( 255 ) |  | password 
xingbie |  VARCHAR ( 255 ) |  |Sex 
nianling |  VARCHAR ( 255 ) |  | Age

 

Jobs Table

Field Name | Type | property | describe 
the above mentioned id |  INT ( 11 ) |  PRIMARY  KEY  | post the above mentioned id 
mingcheng |  VARCHAR ( 255 ) |  | name 
shangbanshijian |  VARCHAR ( 255 ) |  | working hours 
gongzi |  VARCHAR ( 255 ) |  | wages 
Jieshao |  VARCHAR ( 255 ) |  |Introduction 
didian |  VARCHAR ( 255 ) |  | Location

 

 

SET FOREIGN_KEY_CHECKS=0;

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

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

-- Table structure for ggjianzhizhongjieguanli

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

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 'Student the above mentioned id ' , `mingzi` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' name ' ,` username` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' account ' , `password` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' password ' ,` xingbie` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' sex ' , `nianling` VARCHAR (255) DEFAULT NULL COMMENT '年龄',PRIMARY KEY (`id`)

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

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

DROP TABLE IF EXISTS `t_zhiwei`;

CREATE TABLE `t_zhiwei` (`id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '职位id',`mingcheng` VARCHAR( 255 ) the DEFAULT  NULL the COMMENT ' name ' , `shangbanshijian` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' business hours ' ,` gongzi` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' salary ' , `jieshao` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' introduction ' , `didian` VARCHAR ( 255 ) the DEFAULT  NULLThe COMMENT ' Location ' , a PRIMARY  KEY ( `id`) 

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

 

 

 

Adding Jobs module:

By adding jobs modules can be added to complete the operation positions. Jump to page positions added in page, enter all the information posts, click the Add operation, you can post to post data submitted to the zhiweiController in. Field position information contained including name, working hours, wages, description, location. In zhiweiController accepted by all definitions zhiwei position parameters . Using the insert method zhiweidao zhiwei entities into the database. The process of adding data corresponding to the matching zhiweixml complete the insertion operation is performed in the sql statement in zhiweiMapper. The part of the core code is as follows:

Zhiweidao by the insert method to add a page to the transmitted job database zhiweidao.insert (zhiwei);

Add the information office success, to save the message request, the user is given the page prompt request.setAttribute ( "message", "add jobs successfully");

Jobs return to management interface

return "forward:/tianjiazhiwei.action";

Search jobs modules:

In the browser when entering the job search, now the browser's address bar is zhiweiguanli.action, the address will respond zhiweiController class zhiweiguanli, in the process, get all the jobs by selectByexample method, and the information save the request, make cycle through the pages. The part of the core code is as follows:

Generating position-based sample, ZhiweiExample example = new ZhiweiExample () define the query by example;

Check out all the jobs List zhiweiall = zhiweidao.selectByExample (example) by selectByExample method of zhiweidao;

The position information is saved to the request, on display request.setAttribute ( "zhiweiall", zhiweiall) page by foreach method;

Jobs return to management interface

return "forward:/zhiweiguanli.action";

Edit job module:

Of jobs have been uploaded can be modified operation, this part of the operation in the position management interface, click the Modify button to jump to the position of the modified pages. In the modified page will initialize all the jobs field information, field information including name, working hours, wages, description, location. Field information content acquisition through post id. The modified information is passed to the receiving zhiweiController zhiwei. There is contained in zhiweiController advance defined zhiweidao, the parameter is zhiweiMapper is achieved. zhiweiMapper defined modification method, modify the method used here is updateByPrimaryKeySelective, the method can be modified after the synchronization information to the database, the information will eventually be modified successfully returned the page. The part of the code as follows:

The corresponding positions zhiweidao.updateByPrimaryKeySelective modified by modifying the method zhiweidao id's (Zhiwei);

The position information is modified successfully, save the message request, the user is given prompt request.setAttribute in the page ( "message", "Edit job success");

Jobs return to management interface

return "forward:/zhiweiguanli.action";

Delete jobs modules:

By a label on the page, shanchuzhiwei? Id = id will be passed to the background, the receiving position id by shanchuzhiwei. Use of deleteByid

Delete the post, complete the deletion. Delete the definition of a successful message, delete the job successfully, and saved to the request, the part of the code is as follows:

Delete by deleting the corresponding method according zhiweidao job id zhiweidao.deleteByPrimaryKey (id);

The position information is deleted successfully, save the message request, the user is given prompt request.setAttribute in the page ( "message", "delete posts success");

Jobs return to management interface

return "forward:/zhiweiguanli.action";

Guess you like

Origin www.cnblogs.com/lqs11/p/11599029.html