基于javaweb+jsp的健康体检信息管理系统

基于javaweb+jsp的健康体检信息管理系统,第1张

基于javaweb+jsp的健康体检信息管理系统(JavaWeb JSP MySQL Servlet SSM SpringBoot Bootstrap)

JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap

基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可

开发工具:eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

    <select id="findAllSplit" parameterType="java.util.Map" resultMap="BaseResultMap">
        SELECT <include refid="Base_Column_List" /> FROM `t_notice`
        <where>
            <if test="searchColumn != null and searchColumn != '' and keyword != null and keyword != ''">
                ${searchColumn} LIKE CONCAT('%',#{keyword},'%')  AND
            if>
            1=1
        where>
        ORDER BY id ASC
        <if test="startIndex != null and pageSize != null">
            LIMIT #{startIndex},#{pageSize};
        if>
    select>
    
    <select id="getAllCount" parameterType="java.util.Map" resultType="Integer">
        SELECT COUNT(*) FROM `t_notice`
        <where>
            <if test="searchColumn != null and searchColumn != '' and keyword != null and keyword != ''">
                ${searchColumn} LIKE CONCAT('%',#{keyword},'%')  AND
        pb.setServlet("tijianList");
        pb.setSearchColumn(searchColumn);
        pb.setKeyword(keyword);
        pb.setList(list);
        request.getSession().setAttribute("pageBean", pb);
        request.getSession().setAttribute("list", pb.getList());

        response.sendRedirect("tijian_list.jsp");
    }
}
package com.demo.controller;

import com.demo.util.Util;
import com.demo.service.UserService;
    @RequestMapping("noticeList")
    public void list(HttpServletResponse response, HttpServletRequest request) throws IOException {
        this.redirectList(request, response);
    }

    /**
     * 跳转到列表页面
     *
     * @param request
     * @param response
     */
    private void redirectList(HttpServletRequest request, HttpServletResponse response) throws IOException {
        //查询列和关键字
        String searchColumn = Util.decode(request, "searchColumn");
        String keyword = Util.decode(request, "keyword");
        Map<String, Object> params = new HashMap();//用来保存控制层传进来的参数(查询条件)
        params.put("searchColumn", searchColumn);//要查询的列
        params.put("keyword", keyword);//查询的关键字
        Map<String, Object> map = noticeService.list(params);
        request.getSession().setAttribute("list", map.get("list"));

        Integer totalRecord = (Integer) map.get("totalCount");//根据查询条件取出对应的总记录数,用于分页
        String pageNum = Util.decode(request, "pageNum");//封装分页参数
        com.demo.util.PageBean<Object> pb = new com.demo.util.PageBean(Integer.valueOf(pageNum != null ? pageNum : "1"), totalRecord);
        params.put("startIndex", pb.getStartIndex());
        params.put("pageSize", pb.getPageSize());
        List list = (List) noticeService.list(params).get("list");//根据分页参数startIndex、pageSize查询出来的最终结果list
import java.text.SimpleDateFormat;

/**
 * 该方法为通用的工具类,放置一些共用的方法
 */
public class Util {
    /**
     * 获取系统当前时间并格式化为字符串
     *
     * @return
     */
    public static String getTime() {
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(System.currentTimeMillis());
    }
    /**
     * 判断字符串是不是中文
     *
     * @param c
    public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception {

    }

	//@Override
    public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception {

    }
}
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>用户编辑title>
    <%@ include file="include/head.jsp" %>
head>
<body>
<div class="container-fluid">
    <ul class="nav nav-tabs">
        <li><a href="userList">用户列表a>li>
        <li class="active"><a href="#">编辑a>li>
    ul>
    <br/>
        StringBuilder validationCode = new StringBuilder();
        //  验证码的随机字体
        String[] fontNames = {"Times New Roman", "Book antiqua", "Arial"};
        for (int i = 0; i < 4; i++) {
            //  随机设置当前验证码的字符的字体
            g.setFont(new Font(fontNames[random.nextInt(3)], Font.ITALIC, height));
            //  随机获得当前验证码的字符
            char codeChar = codeChars.charAt(random.nextInt(charsLength));
            validationCode.append(codeChar);
            //  随机设置当前验证码字符的颜色
            g.setColor(getRandomColor(10, 100));
            //  在图形上输出验证码字符,x和y都是随机生成的
            g.drawString(String.valueOf(codeChar), 16 * i + random.nextInt(7), height - random.nextInt(6));
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>健康档案编辑title>
    <%@ include file="include/head.jsp" %>
head>
<body>
<div class="container-fluid">
    <ul class="nav nav-tabs">
        <li><a href="jiancheList">健康档案列表a>li>
        <li class="active"><a href="#">编辑a>li>
    ul>
    <br/>
    <form class="form-horizontal" role="form" action="jiancheEdit" method="post" onsubmit="return check()">
        <input type="hidden" class="form-control" id="id" name="id" value="${vo.id}"/>
        
            <div class="form-group">
                <label class="col-sm-3 control-label">姓名:label>
                <div class="col-sm-5">
                    <input type="text" class="form-control" id="jiancheName" name="jiancheName" value="${vo.jiancheName}">
                div>
            div>
        <div class="form-group">
            <label class="col-sm-3 control-label">性别:label>
    <insert id="doCreate" useGeneratedKeys="true" keyColumn="id" keyProperty="id" parameterType="com.demo.vo.Tijian">
        INSERT INTO `t_tijian`
        <trim prefix="(" suffix=")" suffixOverrides=",">
                    <if test ='id != null'>`id`,if>
                    <if test ='tijianName != null'>`tijian_name`,if>
                    <if test ='tijianTime != null'>`tijian_time`,if>
                    <if test ='tijianYiyuan != null'>`tijian_yiyuan`,if>
                    <if test ='tijianMing != null'>`tijian_ming`,if>
                    <if test ='tijianJieguo != null'>`tijian_jieguo`,if>
                    <if test ='tijianStatus != null'>`tijian_status`,if>
                    <if test ='tijianText != null'>`tijian_text`if>
        trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                    <if test ='id != null'>#{id},if>
                    <if test ='tijianName != null'>#{tijianName},if>
                    <if test ='tijianTime != null'>#{tijianTime},if>
                    <if test ='tijianYiyuan != null'>#{tijianYiyuan},if>
                    <if test ='tijianMing != null'>#{tijianMing},if>
                    <if test ='tijianJieguo != null'>#{tijianJieguo},if>
                    <if test ='tijianStatus != null'>#{tijianStatus},if>
                    <if test ='tijianText != null'>#{tijianText}if>
        trim>
    insert>

     * 删除健康档案
     *
     * @param response
     * @param request
     * @throws IOException
     */
    @RequestMapping("jiancheDelete")
    public void delete(HttpServletResponse response, HttpServletRequest request) throws IOException {
        Serializable id = Util.decode(request, "id");
        jiancheService.delete(Arrays.asList(id));
        this.redirectList(request, response);
    }

    /**
     * 编辑健康档案
            <div class="col-sm-5">
                <textarea rows="3" class="form-control" id="jiancheText" name="jiancheText" placeholder="请输入内容......">${vo.jiancheText}textarea>
            div>
        div>
        <div class="form-group">
            <label class="col-sm-3 control-label">label>
            <div class="col-sm-5">
                <input type="submit" class="btn btn-line btn-rect btn-danger btn-sm" value="保存">
                <input type="button" class="btn btn-line btn-rect btn-default btn-sm" value="返回" onclick="javascript:history.back(-1);">
            div>
        div>
    form>
div>
body>
<script type="text/javascript">
    //提交之前进行检查,如果return false,则不允许提交
    function check() {
    <select id="getAllCount" parameterType="java.util.Map" resultType="Integer">
        SELECT COUNT(*) FROM `t_notice`
        <where>
            <if test="searchColumn != null and searchColumn != '' and keyword != null and keyword != ''">
                ${searchColumn} LIKE CONCAT('%',#{keyword},'%')  AND
            if>
            1=1
        where>
    select>
mapper>


运行环境

Java≥6、Tomcat≥7.0、MySQL≥5.5

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

技术框架

JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript Bootstrap

基础JSP+Servlet或JSP+SSM(Spring、SpringMVC、MyBatis)框架或JSP+SSM+Maven(pom.xml)框架或SpringBoot…均可

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

登录、注册、退出、用户模块、公告模块、健康档案模块、体检记录模块的增删改查管理

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/729580.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-27
下一篇 2022-04-27

发表评论

登录后才能评论

评论列表(0条)