Web information search platform

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

Today records of the project is a Web-based information search platform, currently very popular B / S system structure to JSP as a development technology relying on SSM technology framework, mysql database to establish the system.
When do Web-based information search platform, we need to use SSM (MYECLIPSE) framework, development tools choose the most adept MYECLIPSE.
Web-based information search platform project is a background program.
When developing the system, needs analysis is an essential part. Web-based information search platform has logged roles include the administrator user.
Set the identity of each account, account number, password is essential, administrators, users are included in these login roles that some field.

We summarize the results of Web-based information search platform for all project data: administrator (admin), user (yonghu), acquisition (caiji), retrieval (jiansuo)

Web-based information search platform administrator of 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

 

Web-based user table of information search platform

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 
username |  VARCHAR ( 255 ) |  |Account 
password |  VARCHAR ( 255 ) |  | password 
quanxian |  VARCHAR ( 255 ) |  | rights

 

Table Web-based collection of information search platform

Field Name | Type | properties | Description 
ID |  the INT ( . 11 ) |  a PRIMARY  KEY  | acquired ID 
neirong |  VARCHAR ( 255 ) |  | Content 
timu |  VARCHAR ( 255 ) |  | Title 
Shijian |  VARCHAR ( 255 ) |  | Time

 

Table Web-based retrieval of information search platform

Field Name | Type | properties | Description 
ID |  the INT ( . 11 ) |  a PRIMARY  KEY  | retrieved ID 
Zhonglei |  VARCHAR ( 255 ) |  | kind 
leixing |  VARCHAR ( 255 ) |  | type 
Shijian |  VARCHAR ( 255 ) |  | Time

 

 

SET FOREIGN_KEY_CHECKS=0;

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

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

-- Table structure for ggjyWebdxxcxpt

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

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_yonghu`; 

the CREATE  TABLE ` t_yonghu` ( `id` the INT ( . 11 ) the NOT  NULL the AUTO_INCREMENT the COMMENT ' user id' , `Xingming` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' name ' ,` xingbie` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' sex ' , `nianling` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' Age ' ,` username` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' account number ' , `password` VARCHAR ( 255) DEFAULT NULL COMMENT '密码',`quanxian` VARCHAR(255) DEFAULT NULL COMMENT '权限',PRIMARY KEY (`id`)

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

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

DROP TABLE IF EXISTS `t_caiji`;

CREATE TABLE `t_caiji` (`id` INT(11) The NOT  NULL the AUTO_INCREMENT the COMMENT ' acquisition ID ' , `neirong` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' content ' ,` timu` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' subject ' , `shijian` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' time ' , a PRIMARY  KEY ( `id`) 

) ENGINE = MyISAM the DEFAULT CHARSET=utf8 COMMENT='采集';

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

DROP TABLE IF EXISTS `t_jiansuo`;

CREATE TABLE `t_jiansuo` (`id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '检索id',`zhonglei` VARCHAR(255) DEFAULT NULL COMMENT '种类',`leixing` VARCHAR(255) DEFAULT NULLThe COMMENT ' Type ' , `shijian` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' time ' , a PRIMARY  KEY (` id`) 

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

 

 

Add search module:

Tianjiajiansuoact define search parameters to receive incoming pages in jiansuoController, define as jiansuo. Wherein jiansuo comprising fields: Category, type, time, the search target using tianjiajiansuoact stored in the database is defined in jiansuoMapper insert method, the matching database and insert into jiansuo implemented statement retrieves data into the database. The part of the core code is as follows:

Jiansuodao by the insert method of transmitting the retrieved pages to add to the database jiansuodao.insert (jiansuo);

Add the successful retrieval of information stored in the message request, the user is given the page prompt request.setAttribute ( "message", "add to retrieve success");

Return to retrieve management interface

return "forward:/tianjiajiansuo.action";

Query module:

When entering the search query page in a browser, then the browser address bar is jiansuoguanli.action, the address will respond jiansuoController class jiansuoguanli, in the process, get all the information retrieved by selectByexample method, and the information save the request, make cycle through the pages. The part of the core code is as follows:

Generating a sample-based retrieval, query by example defined JiansuoExample example = new JiansuoExample ();

Query all the retrieval information List jiansuoall = jiansuodao.selectByExample (example) by the method jiansuodao of selectByExample;

To retrieve information stored in the request, on display request.setAttribute ( "jiansuoall", jiansuoall) foreach method by page;

Return to retrieve management interface

return "forward:/jiansuoguanli.action";

Modify search module:

Click the Edit button, you can jump to retrieve the modified page. Modifying the search page, the search will initialize all the information, and correspondence information corresponding to the edit field is filled. After completion of search information editing page by encapsulating the data post method is a discovery entity, passed into the jiansuoController. In xiugaijiansuo the reception, after reception is completed, the call updateByPrimaryKeySelective method jiansuoMapper modified. The part of the code as follows:

Retrieving jiansuodao.updateByPrimaryKeySelective modified by modifying the id corresponding to the method according to the jiansuodao (jiansuo);

The modification successful retrieval of information stored in the message request, the user is given the page prompt request.setAttribute ( "message", "modify retrieve information successfully");

Return to retrieve management interface

return "forward:/jiansuoguanli.action";

Delete search module:

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

Remove retrieval jiansuodao.deleteByPrimaryKey (id) by removing a corresponding method based on the id of jiansuodao;

The deleted information retrieval success, to save the message request, the user is given prompt request.setAttribute in the page ( "message", "retrieve deleted successfully");

Return to retrieve management interface

return "forward:/jiansuoguanli.action";

 

Source download

Guess you like

Origin www.cnblogs.com/lqby/p/11620118.html