We should seriously study a day to more progress. └ (^ o ^) ┘
in the work and the process of learning to be good at thinking, eager to learn. And make the appropriate records, can be most quickly learn and master one knowledge. And we hope to grow together in this platform together, and share a SSM (MYECLIPSE) project, which is based on the name javaee online electronic reimbursement system. With very popular B / S architecture of current, as JAVAEE to develop technology relying on SSM technical framework, mysql database to establish the system. This article is in an online travel reimbursement system application on J2EE technology development process. In today's highly competitive market, software developers are faced with a difficult challenge: it is necessary to reduce costs in the development cycle has been shortened, but also offers a wide range of e-commerce services.
We write SSM (MYECLIPSE) in the framework of the project study is often the choice of development tools MYECLIPSE, project from the above background, we could have come back online electronic reimbursement system based javaee. To allow users to use the complete project.
Log role javaee online electronic reimbursement system based on a project administrator, employees, the system has all of the user accounts are password field. Where the administrator can only be added in the background and databases. The rest of the login role can have a successful system by registering the account password.
In the function of the system, the reimbursement is an important table. This table makes up the staff association. Reimbursement in the reimbursement table mingzi employees and employees of the corresponding field, id id field reimbursement of staff and employees of correspondence
, they have a relationship.
Summary drawn javaee online electronic claims system project based on all the data: the administrator (admin), employees (yuangong), reimbursement (baoxiao)
Based administrator table online electronic system of reimbursement of javaee
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
Based on the employee table online electronic system of reimbursement of javaee
Field Name | Type | property | describe the above mentioned id | INT ( 11 ) | PRIMARY KEY | staff of the above mentioned id username | VARCHAR ( 255 ) | | account password | VARCHAR ( 255 ) | | password gonghao | VARCHAR ( 255 ) | | job number mingzi | VARCHAR ( 255 ) | |Name bumen | VARCHAR ( 255 ) | | department gangwei | VARCHAR ( 255 ) | | post
Table-based reimbursement system of online electronic reimbursement of javaee
Field Name | Type | property | describe the above mentioned id | INT ( 11 ) | PRIMARY KEY | reimbursement of the above mentioned id biaoti | VARCHAR ( 255 ) | | title neirong | VARCHAR ( 255 ) | | Content Zhengming | VARCHAR ( 255 ) | | prove yuangong | VARCHAR ( 255 ) | |Staff yuangongid | VARCHAR ( 255 ) | | staff of the above mentioned id Shijian | VARCHAR ( 255 ) | | Time
SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- ---------------------------- -- Table structure for ggjyjavaeedzxdzbxxt -- ---------------------------- 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 ) the DEFAULT NULL the COMMENT ' password ' , a PRIMARY KEY (` id`) ) ENGINE = MyISAM the DEFAULT the CHARSET = UTF8 the COMMENT = ' Administrators ' ; - ----------- ----------------- the DROP TABLE the IF EXISTS `t_yuangong`; the CREATE TABLE ` t_yuangong` ( `id` the INT ( . 11 ) the NOT NULL the AUTO_INCREMENT the COMMENT ' employee id' , `Username` VARCHAR ( 255 ) the DEFAULT NULL the COMMENT ' account number ' ,` password` VARCHAR ( 255 ) the DEFAULT NULL the COMMENT ' password ' , `gonghao` VARCHAR ( 255 ) the DEFAULT NULL the COMMENT ' job number ' ,` mingzi` VARCHAR ( 255 ) the DEFAULT NULL the COMMENT ' name ' , `bumen` VARCHAR ( 255) DEFAULT NULL COMMENT '部门',`gangwei` VARCHAR(255) DEFAULT NULL COMMENT '岗位',PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='员工'; -- ---------------------------- DROP TABLE IF EXISTS `t_baoxiao`; CREATE TABLE `t_baoxiao` (`id` INT(11) The NOT NULL the AUTO_INCREMENT the COMMENT ' reimbursement ID ' , `biaoti` VARCHAR ( 255 ) the DEFAULT NULL the COMMENT ' title ' ,` neirong` VARCHAR ( 255 ) the DEFAULT NULL the COMMENT ' content ' , `zhengming` VARCHAR ( 255 ) the DEFAULT NULL the COMMENT ' proof ' , `yuangong` VARCHAR ( 255 ) the DEFAULT NULL the COMMENT' Employee ' , `yuangongid` the INT ( . 11 ) the DEFAULT NULL the COMMENT ' employee ID ' ,` shijian` VARCHAR ( 255 ) the DEFAULT NULL the COMMENT ' time ' , a PRIMARY KEY ( `id`) ) ENGINE = MyISAM the DEFAULT the CHARSET = UTF8 the COMMENT = ' reimbursement ' ;
Add Reimbursement module:
Defined tianjiabaoxiaoact page to receive reimbursement parameters passed in baoxiaoController, define as baoxiao. Baoxiao which contains fields: title, content, proof, employees, employee id, time, using the reimbursement tianjiabaoxiaoact objects stored in the database, insert method defined in baoxiaoMapper, the matching database insert into baoxiao statement will be reimbursed to achieve data store the operation of the database. The part of the core code is as follows:
Baoxiaodao by the insert method to add a page transmitted to the database claims baoxiaodao.insert (baoxiao);
Add the successful reimbursement information, save it to a message request, the user is given prompt request.setAttribute in the page ( "message", "add reimbursement success");
Return to reimbursement management interface
return "forward:/tianjiabaoxiao.action";
Query reimbursement module:
In the background baoxiaoguanli 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 reimbursement queries. Specific code as follows:
Sample Class generating claims, query by example defined BaoxiaoExample example = new BaoxiaoExample ();
All inquiries reimbursement information List baoxiaoall = baoxiaodao.selectByExample (example) by the method baoxiaodao of selectByExample;
Will be reimbursed information stored in the request, on display request.setAttribute ( "baoxiaoall", baoxiaoall) page by foreach method;
Return to reimbursement management interface
return "forward:/baoxiaoguanli.action";
Modify reimbursement module:
After filling out the page modify information, click the Modify button to submit data to xiugaibaoxiao, the package as a reimbursement
Modifying the update method using the reimbursement information, synchronize data to the database, to complete the modification operation.
Modify the definition of the success message, the success reimbursement modified, and stores the request code would read:
Corresponding to claims baoxiaodao.updateByPrimaryKeySelective modified by modifying the method according to the id of baoxiaodao (baoxiao);
The reimbursement successfully modify information stored in the message request, give the user prompt request.setAttribute in the page ( "message", "modify the reimbursement information successfully");
Return to reimbursement management interface
return "forward:/baoxiaoguanli.action";
Delete reimbursement module:
Delete function implementations for the reimbursement, reimbursement by clicking the Delete button to get to the server to initiate the request. Id reimbursement request includes information using the accepted int id, and the id of incoming deleteByPrimaryKey method baoxiaodao in the baoxiaoController. The effect is to delete the corresponding method according to claims id. Finally, information will be deleted reimbursement successful return to the page, the part of the core code is as follows:
Deletes the corresponding claims baoxiaodao.deleteByPrimaryKey (id) id by removing method according to the baoxiaodao;
Reimbursement will be deleted success information stored in the message request, give the user prompt request.setAttribute in the page ( "message", "Delete reimbursement success");
Return to reimbursement management interface
return "forward:/baoxiaoguanli.action";