JSP based personnel management system of the B / S Mode

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

Thinking today, completing a personnel management system project, which features need to achieve?
Such projects commonly described as follows:
the amount of information and type of personnel management information more and more, workflows become increasingly clear division of labor is getting smaller, the original manual processes and stand-alone management system in the traditional can not be more meet the needs of personnel management, personnel management can not meet the needs of enterprises under the new situation. Therefore, it must have used in the Internet age to adapt to the new personnel management system on demand. The new system calls for the traditional C / S model, while effectively managing enterprise personnel information, but with the network society, requiring B / S mode is increasing. B / S model can facilitate the needs of customers and employees to a large extent, in any place, as long as access to Internet, you can obtain business-related personnel information.
SSM (MYECLIPSE) for this framework and its projects, the idea of using the MVC can greatly reduce duplication of effort. 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 system of personnel management system, personnel management system can be drawn is a background system project.
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, employees.
There is any relationship between the system staff, we will save their relationship in the payroll. Their relationship is such that wages and salaries of employees of the corresponding field and mingzi, wages and employee id id field staff of correspondence
. In order to complete the function of the system needs to be sector employees to set tables, records, employee information. It defines the relationship between the two in the employee table, where mingzi field staff of departmental correspondence, id field counterpart id and department employees
.

The summary results for all data systems: the administrator (admin), wages (gongzi), employees (yuangong), department (bumen)

Administrators table

Field Name | Type | property | Description
id |  INT ( 11 ) |  PRIMARY  KEY  | administrator id
username |  VARCHAR ( 255 ) |  | account
password |  VARCHAR ( 255 ) |  | password

 

payroll

Field Name | Type | property | Description
id |  INT ( 11 ) |  PRIMARY  KEY  | wage id
yuangong |  VARCHAR ( 255 ) |  | staff
yuangongid |  VARCHAR ( 255 ) |  | staff id
yuefen |  VARCHAR ( 255 ) |  | month
jichugongzi |  VARCHAR ( 255 ) |  | base salary
Ticheng |  VARCHAR ( 255 ) |  | royalty

 

Employees table

Field Name | Type | property | Description
id |  INT ( 11 ) |  PRIMARY  KEY  | staff id
mingzi |  VARCHAR ( 255 ) |  | name
username |  VARCHAR ( 255 ) |  | account
password |  VARCHAR ( 255 ) |  | password
bumen |  VARCHAR ( 255 ) |  | Sector
bumenid |  VARCHAR ( 255 ) |  | department id

 

Sector Table

Field Name | Type | property | Description
id |  INT ( 11 ) |  PRIMARY  KEY  | department id
mingzi |  VARCHAR ( 255 ) |  | name

 

 

SET FOREIGN_KEY_CHECKS=0;

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

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

-- Table structure for ggrenshiguanli

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

DROP TABLE IF EXISTS `t_admin`;

The CREATE  TABLE `t_admin` (` id` the INT ( . 11 ) the NOT  NULL the AUTO_INCREMENT the COMMENT " administrator ID ' ,` username` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' account number ' , `password` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' password ' , PRIMARY  KEY ( `id`)

) ENGINE = MyISAM the DEFAULT the CHARSET = UTF8 the COMMENT = " Administrator " ;

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

DROP TABLE IF EXISTS `t_gongzi`;

The CREATE  TABLE `t_gongzi` (` id` the INT ( . 11 ) the NOT  NULL the AUTO_INCREMENT the COMMENT ' wages ID ' , `yuangong` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' employee ' ,` yuangongid` the INT ( . 11 ) the DEFAULT  NULL the COMMENT ' employee ID ' , `yuefen` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' month ' ,` jichugongzi`VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' base salary ' , `ticheng` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' royalties ' , a PRIMARY  KEY (` id`)

) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='工资';

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

DROP TABLE IF EXISTS `t_yuangong`;

The CREATE  TABLE `t_yuangong` (` id` INT ( 11 ) the NOT  NULL AUTO_INCREMENT the COMMENT ' staff of 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 ' ,` bumen`VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' sector ' , `bumenid` the INT ( . 11 ) the DEFAULT  NULL the COMMENT ' sector ID ' , a PRIMARY  KEY (` id`)

) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='员工';

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

DROP TABLE IF EXISTS `t_bumen`;

CREATE TABLE `t_bumen` (`id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '部门id',`mingzi` VARCHAR(255) DEFAULT NULL COMMENT '名字',PRIMARY KEY (`id`)

) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='部门';

 

 

Adding payroll module:

By adding module wages, salaries add operation can be completed. Jump all the information on the page to add wages page, enter wage, click the Add operation, the wage data submitted to the gongziController in to post. Field information contained in wages, including employees, employee id, month, base salary, commission. In gongziController by defining gongzi accept all wages parameters. Using the insert method gongzidao gongzi entities into the database. The process of adding data corresponding to the matching gongzixml complete the insertion operation is performed in the sql statement in gongziMapper. The part of the core code is as follows:

Gongzidao by the insert method to add a page to transfer wages database gongzidao.insert (gongzi);

Adding wage a successful information saved to the message request, the user is given prompt request.setAttribute in the page ( "message", "add salary success");

Returns the salary management interface

return "forward:/tianjiagongzi.action";

Query module wages:

In the background gongziguanli method, get all the data through selectByexample method. Save it to your request by foreach method in the page

Circulated to display the table. Complete payroll queries. Specific code as follows:

Generate payroll sample classes, defined query by example GongziExample example = new GongziExample ();

Check out all the salary information List gongziall = gongzidao.selectByExample (example) by selectByExample method of gongzidao;

The salary information, saved to the request, make the show request.setAttribute ( "gongziall", gongziall) page by foreach method;

Returns the salary management interface

return "forward:/gongziguanli.action";

Modify wages modules:

Wage information has been uploaded can be modified operation, this part of the operation in payroll interface, click the Modify button to jump to the salary revision page. In the modified page, wages will initialize all the fields of information, field information including employee, employee id, month, base salary, commission. Field information content acquisition through wage id. The modified information is passed to the receiving gongziController gongzi. There is contained in gongziController advance defined gongzidao, the parameter is gongziMapper is achieved. gongziMapper defined modification method, modify the method used here is updateByPrimaryKeySelective, the method can be modified information synchronized to the database , the information will eventually be modified successfully returned the page. The part of the code as follows:

Modified corresponding pay gongzidao.updateByPrimaryKeySelective (gongzi) by modifying the method according to the id of gongzidao;

The modification wage a successful information saved to the message request, the user is given prompt request.setAttribute in the page ( "message", "modify salary information successfully");

Returns the salary management interface

return "forward:/gongziguanli.action";

Delete wages modules:

Delete function is implemented in gongziController wages, the implementation is shanchugongzi. shanchugongzi.action the page by the get method? Id form will be deleted wage id uploaded to the server in response to a corresponding method, call deleteByPrimaryKey method gongzidao in complete deletion. Will delete successful message is returned to the page, complete the operation to delete data. The part of the core code:

Deletes the corresponding pay gongzidao.deleteByPrimaryKey (id) id by removing method according to the gongzidao;

The deleted wage a successful information saved to the message request, the user is given prompt request.setAttribute in the page ( "message", "delete success wages");

Returns the salary management interface

return "forward:/gongziguanli.action";

Guess you like

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