web smart nutrition, catering and evaluation system

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

Today, a friend and together to complete a web-based intelligent nutritious meals and evaluation 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, web intelligence nutritious meals and evaluation system is based on a background item. With very popular B / S architecture of current to develop as JAVA technology relying on SSM technical framework, mysql database to establish the system.
A web-based intelligent nutritious meals and evaluation system should include user roles administrator, user, age group. 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.

We summarize the results of intelligent web nutritious meals and evaluation system based on all project data: administrator (admin), user (yonghu), age (nianlingduan), the classification of units (danweifenlei)

Based administrator table nutritious meals and evaluation systems of intelligent web

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 user tables nutritious meals and evaluation systems of intelligent web

Field Name  | Type  | property  | describe
the above mentioned id  INT ( 11 PRIMARY  KEY  | user the above mentioned id
Xingming  VARCHAR ( 255 | Name
xingbie  VARCHAR ( 255 | Sex
nianling  VARCHAR ( 255 | Age
quanxian  VARCHAR ( 255 | rights
username  VARCHAR (255 | account
password  VARCHAR ( 255 | password

Table nutritious meals based on age and evaluation systems of intelligent web

Field Name  | Type  | property  | describe
the above mentioned id  INT ( 11 PRIMARY  KEY  | ages the above mentioned id
yinger  VARCHAR ( 255 | Baby
youer  VARCHAR ( 255 | children
qingshaonian  VARCHAR ( 255 | Teen
chengnianren  VARCHAR ( 255 | adult
zhongnianren  VARCHAR (255 | middle-aged
laonianren  VARCHAR ( 255 | elderly

Based on nutrition, catering units and evaluation system of intelligent web-classification

Field Name  | Type  | property  | describe
the above mentioned id  INT ( 11 PRIMARY  KEY  | units classified the above mentioned id
xueshengshitang  VARCHAR ( 255 | student cafeteria
kuaicangongsi  VARCHAR ( 255 | fast-food company
peicangongsi  VARCHAR ( 255 | catering The company
gongzhongshitang  VARCHAR ( 255 | public canteens
jiating  VARCHAR ( 255 | Family

 

 

SET FOREIGN_KEY_CHECKS=0;

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

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

-- Table structure for ggjywebdznyypchpgxt

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

DROP TABLE IF EXISTS `t_admin`;

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

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

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

DROP TABLE IF EXISTS `t_yonghu`;

CREATE TABLE `t_yonghu` (`id` INT(11NOT NULL AUTO_INCREMENT COMMENT '用户id',`xingming` VARCHAR(255DEFAULT NULL COMMENT '姓名', `Xingbie`  VARCHAR ( 255 the DEFAULT  NULL the COMMENT  'sex' , ` nianling`  VARCHAR ( 255 the DEFAULT  NULL the COMMENT  'Age' , `quanxian`  VARCHAR ( 255 the DEFAULT  NULL the COMMENT  'rights' , ` username`  VARCHAR ( 255 the DEFAULT  NULL the COMMENT  'account number' , `password`  VARCHAR ( 255 the DEFAULT  NULL the COMMENT  'password' ,PRIMARY KEY (`id`)

) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='用户';

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

DROP TABLE IF EXISTS `t_nianlingduan`;

CREATE TABLE `t_nianlingduan` (`id` INT(11NOT NULL AUTO_INCREMENT COMMENT '年龄段id',`yinger` VARCHAR(255DEFAULT NULL COMMENT '婴儿',`youer` VARCHAR(255The DEFAULT  NULL the COMMENT  'children' , `qingshaonian`  VARCHAR ( 255 the DEFAULT  NULL the COMMENT  'teenagers' , ` chengnianren`  VARCHAR ( 255 the DEFAULT  NULL the COMMENT  ' adult ' , `zhongnianren`  VARCHAR ( 255 the DEFAULT  NULL the COMMENT  ' middle-aged people ' , `laonianren`  VARCHAR ( 255 the DEFAULT  NULL the COMMENT  ' elderly ' , a PRIMARY  KEY  ( ` id`)

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

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

the DROP  TABLE  the IF  EXISTS  t_danweifenlei` `;

the CREATE  TABLE  ` t_danweifenlei`  ( `id`  the INT ( . 11 the NOT  NULL  the AUTO_INCREMENT the COMMENT  'unit classification ID' , ` xueshengshitang`  VARCHAR ( 255 the DEFAULT  NULL the COMMENT  'canteen' , `kuaicangongsi`  VARCHAR ( 255 the DEFAULT The COMMENT NULL  'fast-food company' , `peicangongsi`  VARCHAR ( 255 the DEFAULT  NULL the COMMENT  'catering company' , ` gongzhongshitang`  VARCHAR ( 255 the DEFAULT  NULL the COMMENT  'public canteens' , `jiating`  VARCHAR ( 255 the DEFAULT  NULL the COMMENT  'family' , a PRIMARY  KEY  ( `id` )

) ENGINE = MyISAM  the DEFAULT the CHARSET = UTF8 the COMMENT = 'classification unit';

 

Add Unit Category modules:

Present classification units added to the system by clicking adding unit classification can jump to the functional module, the functional module, the classification information to fill in the corresponding unit. Units classified information contained student canteens, fast-food companies, catering companies, public canteens, home, after all the information filled out by the post method to submit data to tianjiadanweifenlei.action, the address will be in the server tianjiadanweifenleiact method danweifenleiController class in response. In response to a result, all the unit classification information acquired, a package danweifenlei class, using the insert method danweifenleidao danweifenleiController defined in the class, classification data units to be inserted danweifenlei database table. And gives the user prompts, add the classification of units successfully, save the information to the message request, this information will be shown on the page. The part of the core code is as follows:

The transmission of pages by adding the unit classification method danweifenleidao insert into the database danweifenleidao.insert (danweifenlei);

Add the units classified information successfully, save the message request, the user is given the page prompt request.setAttribute ( "message", "add the classification of units successfully");

Return to the unit classification management interface

return "forward:/tianjiadanweifenlei.action";

Queries unit classification module:

Classification of units for the implementation of the query module, launched danweifenleiguanli.action request page. By this request, the server response danweifenleiController class danweifenleiguanli, query data by selectByexample operation in the process. After all of the units classified information query, save it to request the danweifenleiall in, on display in the page and return danweifenleiguanli.jsp, the part of the core code is as follows:

Sample generating unit classification category, query by example defined DanweifenleiExample example = new DanweifenleiExample ();

Check out all the units classified information List danweifenleiall = danweifenleidao.selectByExample (example) by selectByExample method of danweifenleidao;

The units classified information, saved to the request, make the show request.setAttribute ( "danweifenleiall", danweifenleiall) page by foreach method;

Return to the unit classification management interface

return "forward:/danweifenleiguanli.action";

Modify Unit Category modules:

After the completion of the classification of units page modify information to fill, the incoming xiugaidanweifenlei.action address part of the data, and submit it by post. After receiving submitted by xiugaidanweifenlei in danweifenleiController in all fields packaged as a unit classification entity. And the entity in the incoming updateByPrimaryKeySelective method danweifenleidao, the definition of the units classified by remaining id updated classification of units in the field this method, the part of the field including student canteens, fast-food companies, catering companies, public canteens, family, the part core code is as follows:

Modified by modifying the corresponding danweifenleidao method according to the classification unit id danweifenleidao.updateByPrimaryKeySelective (danweifenlei);

The modification unit classification successful information request to save the message, the user is given prompt request.setAttribute in the page ( "message", "modify the unit classified information successfully");

Return to the unit classification management interface

return "forward:/danweifenleiguanli.action";

Delete Unit Category modules:

Delete unit classification function is implemented in danweifenleiController, the implementation is shanchudanweifenlei. shanchudanweifenlei.action the page by the get method? Id form will need to remove the unit classification id uploaded to the server in response to a corresponding method, call deleteByPrimaryKey method danweifenleidao in complete deletion. Will delete successful message is returned to the page, complete the operation to delete data. The part of the core code:

Delete by deleting the corresponding danweifenleidao method according to the classification unit id danweifenleidao.deleteByPrimaryKey (id);

Units classified information will be deleted successfully saved to the message request, the user is given prompt request.setAttribute in the page ( "message", "delete the unit Successful");

Return to the unit classification management interface

return "forward:/danweifenleiguanli.action";

address

Guess you like

Origin www.cnblogs.com/yyqsy/p/11694099.html