老年人评估项目

基本信息
pojo

package com.stu.pojo;

import java.util.Date;

public class older {
    private String assessId;
    private String date;
    private String assessReason;
    private String name;
    private String sex;
    private String birthday;
    private String idNumber;
    private String socialCard;
    private String nation;
    private String educationLevel;
    private String zongjiao;
    private String hunyin;
    private String jvzhu;
    private String zhifu;
    private String jingjilaiyuan;
    private String jibing;
    private String yiwai;
    private String nameFamily;
    private String guanxi;
    private String namelianxi;
    private String tele;

    public older(String assessId, String date, String assessReason, String name, String sex, String birthday, String idNumber, String socialCard, String nation, String educationLevel, String zongjiao, String hunyin, String jvzhu, String zhifu, String jingjilaiyuan, String jibing, String yiwai, String nameFamily, String guanxi, String namelianxi, String tele) {
        this.assessId = assessId;
        this.date = date;
        this.assessReason = assessReason;
        this.name = name;
        this.sex = sex;
        this.birthday = birthday;
        this.idNumber = idNumber;
        this.socialCard = socialCard;
        this.nation = nation;
        this.educationLevel = educationLevel;
        this.zongjiao = zongjiao;
        this.hunyin = hunyin;
        this.jvzhu = jvzhu;
        this.zhifu = zhifu;
        this.jingjilaiyuan = jingjilaiyuan;
        this.jibing = jibing;
        this.yiwai = yiwai;
        this.nameFamily = nameFamily;
        this.guanxi = guanxi;
        this.namelianxi = namelianxi;
        this.tele = tele;
    }

    public older() {
    }


    public String getAssessId() {
        return assessId;
    }

    public void setAssessId(String assessId) {
        this.assessId = assessId;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getAssessReason() {
        return assessReason;
    }

    public void setAssessReason(String assessReason) {
        this.assessReason = assessReason;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getIdNumber() {
        return idNumber;
    }

    public void setIdNumber(String idNumber) {
        this.idNumber = idNumber;
    }

    public String getSocialCard() {
        return socialCard;
    }

    public void setSocialCard(String socialCard) {
        this.socialCard = socialCard;
    }

    public String getNation() {
        return nation;
    }

    public void setNation(String nation) {
        this.nation = nation;
    }

    public String getEducationLevel() {
        return educationLevel;
    }

    public void setEducationLevel(String educationLevel) {
        this.educationLevel = educationLevel;
    }

    public String getZongjiao() {
        return zongjiao;
    }

    public void setZongjiao(String zongjiao) {
        this.zongjiao = zongjiao;
    }

    public String getHunyin() {
        return hunyin;
    }

    public void setHunyin(String hunyin) {
        this.hunyin = hunyin;
    }

    public String getJvzhu() {
        return jvzhu;
    }

    public void setJvzhu(String jvzhu) {
        this.jvzhu = jvzhu;
    }

    public String getZhifu() {
        return zhifu;
    }

    public void setZhifu(String zhifu) {
        this.zhifu = zhifu;
    }

    public String getJingjilaiyuan() {
        return jingjilaiyuan;
    }

    public void setJingjilaiyuan(String jingjilaiyuan) {
        this.jingjilaiyuan = jingjilaiyuan;
    }

    public String getJibing() {
        return jibing;
    }

    public void setJibing(String jibing) {
        this.jibing = jibing;
    }

    public String getYiwai() {
        return yiwai;
    }

    public void setYiwai(String yiwai) {
        this.yiwai = yiwai;
    }

    public String getNameFamily() {
        return nameFamily;
    }

    public void setNameFamily(String nameFamily) {
        this.nameFamily = nameFamily;
    }

    public String getGuanxi() {
        return guanxi;
    }

    public void setGuanxi(String guanxi) {
        this.guanxi = guanxi;
    }

    public String getNamelianxi() {
        return namelianxi;
    }

    public void setNamelianxi(String namelianxi) {
        this.namelianxi = namelianxi;
    }

    public String getTele() {
        return tele;
    }

    public void setTele(String tele) {
        this.tele = tele;
    }
}

servlet

package com.stu.servlet;

import com.stu.mapper.olderInformationMapper;
import com.stu.pojo.older;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.util.Date;

@WebServlet("/olderInformationInsert")
public class olderInformation extends HttpServlet {

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        String resource = "mybatis-config.xml";
        InputStream inputStream = Resources.getResourceAsStream(resource);
        SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);
        SqlSession sqlSession = sqlSessionFactory.openSession(true);
        olderInformationMapper mapper = sqlSession.getMapper(olderInformationMapper.class);

        String assessId=request.getParameter("assessId");
        String date=request.getParameter("date");
        String assessReason=request.getParameter("assessReason");
        String name=request.getParameter("name");
        String sex=request.getParameter("sex");
        String birthday=request.getParameter("birthday");
        String idNumber=request.getParameter("idNumber");
        String socialCard=request.getParameter("socialCard");
        String nation=request.getParameter("nation");
        String educationLevel=request.getParameter("educationLevel");
        String zongjiao=request.getParameter("zongjiao");
        String hunyin=request.getParameter("hunyin");
        String jvzhu=request.getParameter("jvzhu");
        String zhifu=request.getParameter("zhifu");
        String jingjilaiyuan=request.getParameter("jingjilaiyuan");
        String jibing=request.getParameter("jibing");
        String yiwai=request.getParameter("yiwai");
        String nameFamily=request.getParameter("nameFamily");
        String guanxi=request.getParameter("gunaxi");
        String namelianxi=request.getParameter("namelianxi");
        String tele=request.getParameter("tele");

        older older0=new older(assessId,date,assessReason,name,sex,birthday,idNumber,socialCard,nation,educationLevel,zongjiao,hunyin,jvzhu,zhifu,jingjilaiyuan,jibing,yiwai,nameFamily,guanxi,namelianxi,tele);
        mapper.insert(older0);
        sqlSession.close();

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request, response);
    }


}

前端


<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2025/2/7
  Time: 14:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>新增评估老人信息</title>
</head>
<body>
<form method="post" action="/older/olderInformationInsert">

    <h2>评估基本信息表</h2>
    <label for="assessId">评估编号</label>
    <input type="text" id="assessId" name="assessId"><br>
    <label for="date">评估基准日期</label>
    <input type="text" id="date" name="date"><br>
    <label for="assessReason">评估原因</label>
    <textarea id="assessReason" name="assessReason"></textarea><br>

    <h2>被评估者基本信息表</h2>
    <label for="name">姓名</label>
    <input type="text" id="name" name="name"><br>

    性别:<label for="male">男</label>
    <input type="radio" id="male" name="sex" value="male">
    <label for="female">女</label>
    <input type="radio" id="female" name="sex" value="female"><br>
    <label for="birthday">出生日期</label>
    <input type="text" id="birthday" name="birthday"><br>
    <label for="idNumber">身份证号</label>
    <input type="text" id="idNumber" name="idNumber"><br>
    <label for="socialCard">社保卡号</label>
    <input type="text" id="socialCard" name="socialCard"><br>
<%--    民族:<label for="han">汉</label>--%>
<%--    <input type="radio" id="han" name="nation" value="汉">--%>
<%--    <!-- 第二个单选按钮,代表其他民族 -->--%>
<%--    <label for="other">其他</label>--%>
<%--    <input type="radio" id="other" name="nation" value="少数民族">--%>
<%--    <!-- 用于输入具体民族的输入框,默认隐藏 -->--%>
<%--    <input type="text" id="otherEthnicityInput" placeholder="请输入具体民族">--%>
    <label for="nation">民族</label>
    <input type="text" id="nation" name="nation">
    <label for="educationLevel">文化程度</label>
    <input type="text" id="educationLevel" name="educationLevel"><br>
    <label for="zongjiao">宗教信仰</label>
    <input type="text" id="zongjiao" name="zongjiao"><br>
<%--    婚姻状况--%>
    婚姻状况:
<%--    按钮一未婚--%>
    <label for="weihun">未婚</label>
    <input type="radio" id="weihun" name="hunyin" value="weihun" >
<%--    按钮二已婚--%>
    <label for="yihun">已婚</label>
    <input type="radio" id="yihun" name="hunyin" value="yihun" >
<%--按钮三丧偶--%>
    <label for="sangou">丧偶</label>
    <input type="radio" id="sangou" name="hunyin" value="sangou">
<%--    按钮四离婚--%>
    <label for="lihun">离婚</label>
    <input type="radio" id="lihun" name="hunyin" value="lihun">
<%--    按钮五不明--%>
    <label for="buming">不明</label>
    <input type="radio" id="buming" name="hunyin" value="buming"><br>

    <label for="jvzhu">居住情况</label>
    <input type="text" id="jvzhu" name="jvzhu"><br>
    <label for="zhifu">医疗费用支付方式</label>
    <input type="text" id="zhifu" name="zhifu"><br>
    <label for="jingjilaiyuan">经济来源</label>
    <input type="text" id="jingjilaiyuan" name="jingjilaiyuan"><br>
    <label for="jibing">疾病</label>
    <input type="text" id="jibing" name="jibing"><br>
    <label for="yiwai">意外</label>
    <input type="text" id="yiwai" name="yiwai"><br>

    <h2>信息提供者及联系人信息表</h2>
    <label for="nameFamily">信息提供者姓名</label>
    <input type="text" id="nameFamily" name="nameFamily"><br>
    <label for="guanxi">与老人关系</label>
    <input type="text" id="guanxi" name="guanxi"><br>
    <label for="namelianxi">联系人</label>
    <input type="text" id="namelianxi" name="namelianxi"><br>
    <label for="tele">联系电话</label>
    <input type="text" id="tele" name="tele"><br>
    <input type="submit" value="提交">


</form>

</body>
</html>


posted @ 2025-02-19 14:41  guozichan  阅读(10)  评论(0)    收藏  举报