技术介绍
结合当今技术研究的潮流,综合ssm框架、jsp技术、、MySQL数据库等关键技术,构建了一个基于ssm的个人健康信息管理系统。首先对个人健康信息管理系统涉及到的理论与相关技术进行了全面的分析。随后,通过对个人健康信息定义的理解和对管理系统可能的运行场景的分析,给出了个人健康信息管理系统的需求分析。
数据库
部分数据库表结构
CREATE TABLE `jiankangjiance` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`yonghuming` varchar(50) DEFAULT NULL,
`xingming` varchar(50) DEFAULT NULL,
`xingbie` varchar(50) DEFAULT NULL,
`nianling` varchar(50) DEFAULT NULL,
`shengao` varchar(50) DEFAULT NULL,
`tizhong` varchar(50) DEFAULT NULL,
`yaowei` varchar(50) DEFAULT NULL,
`kongfuxuetang` varchar(50) DEFAULT NULL,
`canhouxuetang` varchar(50) DEFAULT NULL,
`tiwen` varchar(50) DEFAULT NULL,
`qita` varchar(50) DEFAULT NULL,
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=gb2312;
CREATE TABLE `pinggubaogao` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`yonghuming` varchar(50) DEFAULT NULL,
`xingming` varchar(50) DEFAULT NULL,
`xingbie` varchar(50) DEFAULT NULL,
`chushengriqi` varchar(50) DEFAULT NULL,
`baogaoneirong` text,
`baogao` varchar(50) DEFAULT NULL,
`tianjiaren` varchar(50) DEFAULT NULL,
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=gb2312;
代码?
controller层控制
// 处理编辑
@RequestMapping("doUpdateJiankangtinan.do")
public String doUpdateJiankangtinan(int id,ModelMap map,Jiankangtinan jiankangtinan){
jiankangtinan=jiankangtinanService.getById(id);
map.put("jiankangtinan", jiankangtinan);
return "jiankangtinan_updt";
}
// 后台详细
@RequestMapping("jiankangtinanDetail.do")
public String jiankangtinanDetail(int id,ModelMap map,Jiankangtinan jiankangtinan){
jiankangtinan=jiankangtinanService.getById(id);
map.put("jiankangtinan", jiankangtinan);
return "jiankangtinan_detail";
}
// 前台详细
@RequestMapping("jktnDetail.do")
public String jktnDetail(int id,ModelMap map,Jiankangtinan jiankangtinan){
jiankangtinan=jiankangtinanService.getById(id);
map.put("jiankangtinan", jiankangtinan);
return "jiankangtinandetail";
}
//
@RequestMapping("updateJiankangtinan.do")
public String updateJiankangtinan(int id,ModelMap map,Jiankangtinan jiankangtinan,HttpServletRequest request,HttpSession session){
jiankangtinanService.update(jiankangtinan);
session.setAttribute("backxx", "修改成功");
session.setAttribute("backurl", request.getHeader("Referer"));
return "redirect:postback.jsp";
//String url = request.getHeader("Referer");
//return "redirect:"+url;
//return "redirect:jiankangtinanList.do";
}
// 分页查询
@RequestMapping("jiankangtinanList.do")
public String jiankangtinanList(@RequestParam(value="page",required=false)String page,
ModelMap map,HttpSession session,Jiankangtinan jiankangtinan, String biaoti, String jianjie, String neirong, String tianjiayao){
if(page==null||page.equals("")){
page="1";
}
PageBean pageBean=new PageBean(Integer.parseInt(page), 15);
Map<String, Object> pmap=new HashMap<String,Object>();
pmap.put("pageno", pageBean.getStart());
pmap.put("pageSize", 15);
if(biaoti==null||biaoti.equals("")){pmap.put("biaoti", null);}else{pmap.put("biaoti", biaoti);}
if(jianjie==null||jianjie.equals("")){pmap.put("jianjie", null);}else{pmap.put("jianjie", jianjie);}
if(neirong==null||neirong.equals("")){pmap.put("neirong", null);}else{pmap.put("neirong", neirong);}
if(tianjiayao==null||tianjiayao.equals("")){pmap.put("tianjiayao", null);}else{pmap.put("tianjiayao", tianjiayao);}
int total=jiankangtinanService.getCount(pmap);
pageBean.setTotal(total);
List<Jiankangtinan> list=jiankangtinanService.getByPage(pmap);
map.put("page", pageBean);
map.put("list", list);
session.setAttribute("p", 1);
return "jiankangtinan_list";
}
运行效果
?
?
?
?
|