Record learning every day, have a good mood every day. * ^ _ ^ *
Today, a friend and together to complete a pet hospital management information system project, we use in the development of the framework is SSM (MYECLIPSE) framework. Limited knowledge of my friend, only this framework, ha ha, is designed to facilitate him. As usual selection of simple and convenient MYECLIPSE as a development tool, which is a background program. Introduction of this system is this: With the development of the industry and increased hospital demand, the popularity of Internet applications, more and more pet hospital introduced the pet hospital information management system, the introduction of such systems greatly facilitate the pets the hospital's daily operations, improve efficiency and overall revenue of the hospital, the rapid development of pet health care industry has played a role in promoting the current number of pet hospitals in our country is still growing rapidly, the size varied widely, varying levels of medical, simple can be divided into small pet clinic, medium and large animal hospitals, large referral centers and hospital chains. in addition to the small pet clinic, hospital medical records are essential, especially in the pet hospital chain, the more the amount of cases., a pet hospital management information system should include user roles administrator, customers. In order to allow the user a smooth landing system to complete the related operations, landing roles you need to set up an account and password for each field.
Pet contacted customers by making association established contact between customers and strengthen the practicality and convenience of the system. Enhancing the user experience. Relationship between them is pet customers and clients mingzi corresponding field, correspond pets customer id and customer id field.
The summary results of all system data: administrator (admin), customer (kehu), pets (chongwu)
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
Customer table
Field Name | Type | property | describe the above mentioned id | INT ( 11 ) | PRIMARY KEY | client the above mentioned id mingzi | VARCHAR ( 255 ) | | name username | VARCHAR ( 255 ) | | account password | VARCHAR ( 255 ) | | password
Pet table
Field Name | Type | property | describe the above mentioned id | INT ( 11 ) | PRIMARY KEY | pet the above mentioned id mingcheng | VARCHAR ( 255 ) | | name leixing | VARCHAR ( 255 ) | | type kehu | VARCHAR ( 255 ) | | Customer kehuid | VARCHAR ( 255 ) | |Customer the above mentioned id bingqing | VARCHAR ( 255 ) | | condition Chuli | VARCHAR ( 255 ) | | processing Shijian | VARCHAR ( 255 ) | | Time
SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- ---------------------------- -- Table structure for ggchongwuyiyuan -- ---------------------------- 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_kehu`; CREATE TABLE `t_kehu` (`id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '客户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 ' , PRIMARY KEY (` id`) ) ENGINE = MyISAM the DEFAULT the CHARSET = UTF8 the COMMENT = ' customer ' ; -- ---------------------------- DROP TABLE IF EXISTS `t_chongwu`; CREATE TABLE `t_chongwu` (`id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '宠物id',`mingcheng` VARCHAR(255) DEFAULT NULL COMMENT '名称',`leixing` VARCHAR(255) DEFAULT NULL COMMENT '类型',`kehu` VARCHAR(255) The DEFAULT NULL the COMMENT ' client ' , `kehuid` the INT ( . 11 ) the DEFAULT NULL the COMMENT ' customer ID ' ,` bingqing` VARCHAR ( 5000 ) the DEFAULT NULL the COMMENT ' condition ' , `chuli` VARCHAR ( 5000 ) the DEFAULT NULL the COMMENT ' Processing ' , `shijian` VARCHAR ( 255 ) the DEFAULT NULL the COMMENT 'Time ' , a PRIMARY KEY ( `id`) ) ENGINE = MyISAM the DEFAULT the CHARSET = UTF8 the COMMENT = ' pets ' ;
Add Pet modules:
Module by adding pet, pet add operation can be completed. Jump all the information on the page to add a pet page, enter your pet, click the Add operation, the pet can post data to submit to chongwuController in. Information contained in the pet field including name, type, customer, client the above mentioned id , condition, treatment, time. In all the pets chongwuController accept parameters defined chongwu. Using the insert method chongwudao chongwu entities into the database. The process of adding data corresponding to the matching chongwuxml complete the insertion operation is performed in the sql statement in chongwuMapper. The part of the core code is as follows:
The transmission of pages by adding pet chongwudao insert method into the database chongwudao.insert (chongwu);
Add the successful pet information, saved to the message request, the user is given prompt request.setAttribute in the page ( "message", "add pet Success");
Return to pet Management Interface
return "forward:/tianjiachongwu.action";
Pet query module:
When entering a pet query page in a browser, then the browser address bar is chongwuguanli.action, the address will respond chongwuController class chongwuguanli, in the process, get all pet information selectByexample method, and the information save the request, make cycle through the pages. The part of the core code is as follows:
Generating sample pet class, query by example defined ChongwuExample example = new ChongwuExample ();
Query all pet information List chongwuall = chongwudao.selectByExample (example) by the method chongwudao of selectByExample;
The pet information stored in the request, on display request.setAttribute ( "chongwuall", chongwuall) page by foreach method;
Return to pet Management Interface
return "forward:/chongwuguanli.action";
Pet modification module:
Upon completion of the pet information to fill the page modification, the portion of the data into xiugaichongwu.action address, and submit by post. After receiving submitted by xiugaichongwu in chongwuController in all fields of a packaged pet entity. And the entity in the incoming updateByPrimaryKeySelective chongwudao method, it is defined by the rest of the pet a pet updating id field of the method, the portion includes a field name, type, customer, customer id, condition, treatment time, the part of the core code as follows:
Corresponding modified pet chongwudao.updateByPrimaryKeySelective (chongwu) by modifying the method according to the id of chongwudao;
The successful pet modify information stored in the message request, give the user prompt request.setAttribute in the page ( "message", "modify pet information successfully");
Return to pet Management Interface
return "forward:/chongwuguanli.action";
Delete pets modules:
By a label on the page, shanchuchongwu? Id = id will be passed to the background, receiving pet id by shanchuchongwu. Use of deleteByid
Remove the pet, complete the deletion. Delete the definition of a successful message, delete pets successful, and saved to the request, the part of the code is as follows:
Deletes the corresponding pet chongwudao.deleteByPrimaryKey (id) id by removing method according to the chongwudao;
Pets will be deleted success information stored in the message request, give the user prompt request.setAttribute in the page ( "message", "delete pet Success");
Return to pet Management Interface
return "forward:/chongwuguanli.action";