资讯 小学 初中 高中 语言 会计职称 学历提升 法考 计算机考试 医护考试 建工考试 教育百科
栏目分类:
子分类:
返回
空麓网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
空麓网 > 计算机考试 > 软件开发 > 后端开发 > Java

当年的Java考试:JAVA&移动应用&大数据-大三-社区疫苗接种管理系统(全部源码·保姆式呵护)

Java 更新时间: 发布时间: 计算机考试归档 最新发布

当年的Java考试:JAVA&移动应用&大数据-大三-社区疫苗接种管理系统(全部源码·保姆式呵护)

源码(免积分)下载地址:

 Java_SSM_tb_community对照编码(全部源码)-Java文档类资源-CSDN下载

最终效果:(包含需要的所有样式都写了)

添加页面

删除提示:

目录

1、数据库环境MySQL脚本

2、创建项目

3、基础配置文件位置

pom.xml

mapper.xml

jdbc.properties

applicationContext.xml

spring-mvc.xml

web.xml

4、各层级包创建

5、完成各层编码

【com.item.model/TbCommunity.java】

【com.item.dao/TbCommunityMapper.java】

【com.item.service/TbCommunityService.java】

【com.item.serviceimpl/TbCommunityServiceImpl.java】

【com.item.controller/TbCommunityController.java】

【webapp/views/GetInfo.jsp】

【webapp/views/AddInfoPage.jsp】

tomcat配置(略)


1、数据库环境MySQL脚本

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for tb_community
-- ----------------------------
DROp TABLE IF EXISTS `tb_community`;
CREATE TABLE `tb_community`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `existing` int(11) NOT NULL,
  `completed` int(11) NOT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;

-- ----------------------------
-- Records of tb_community
-- ----------------------------
INSERT INTO `tb_community` VALUES (1, '平壤们社区', 12000, 32345);
INSERT INTO `tb_community` VALUES (2, '红光社区', 22000, 42121);
INSERT INTO `tb_community` VALUES (3, '鱼梁洲社区', 42000, 21215);
INSERT INTO `tb_community` VALUES (4, '桥口社区', 32125, 13212);
INSERT INTO `tb_community` VALUES (5, '汉阳社区', 7000, 129832);

SET FOREIGN_KEY_CHECKS = 1;

2、创建项目

整个替换【dependencies】内所有内容

3、基础配置文件位置

pom.xml
    
      junit
      junit
      4.11
      test
    
    
      mysql
      mysql-connector-java
      5.1.47
    
    
      org.mybatis
      mybatis
      3.5.9
    
    
      javax.servlet
      javax.servlet-api
      3.1.0
    
    
      javax.servlet.jsp
      javax.servlet.jsp-api
      2.3.3
    
    
      org.springframework
      spring-core
      4.3.18.RELEASE

    
    
      org.springframework
      spring-web
      4.3.18.RELEASE
    
    
      org.springframework
      spring-context
      4.3.18.RELEASE
    
    
      org.springframework
      spring-beans
      4.3.18.RELEASE
    
    
      org.springframework
      spring-webmvc
      4.3.18.RELEASE
    
 
    
      org.springframework
      spring-jdbc
      4.3.18.RELEASE
    
    
      org.springframework
      spring-tx
      4.3.18.RELEASE
    
    
      org.mybatis
      mybatis-spring
      2.0.6
    
    
      javax.servlet
      jstl
      1.2
    
 
    
      commons-dbcp
      commons-dbcp
      1.4
    
    
      commons-fileupload
      commons-fileupload
      1.3.1
    
    
      commons-io
      commons-io
      2.4
    
 
 
    
      com.alibaba
      fastjson
      2.0.4
    
    
      com.alibaba
      druid
      1.1.10
    
 
    
      com.alibaba
      druid-spring-boot-starter
      1.2.9
    

mapper.xml



    
        select * from tb_community where name like "%${name}%";
    
    
        insert into tb_community values(0,"${name}",#{existing},#{completed})
    
    
        delete from tb_community where id=#{id}
    

jdbc.properties
driver=com.mysql.jdbc.Driver
url=jdbc:mysql://127.0.0.1:3306/community_db?characterEncoding=utf-8
username=root
password=12345678

applicationContext.xml


    
        
    

    
        
        
        
        
    

    
        
        
        【com.item.serviceimpl/TbCommunityServiceImpl.java】 
package com.item.serviceimpl;

import com.item.dao.TbCommunityMapper;
import com.item.model.TbCommunity;
import com.item.service.TbCommunityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class TbCommunityServiceImpl implements TbCommunityService {
    @Autowired
    private TbCommunityMapper tbCommunityMapper;
    @Override
    public List GetInfo() {
        return tbCommunityMapper.GetInfo();
    }

    @Override
    public List SelectByName(String name) {
        return tbCommunityMapper.SelectByName(name);
    }

    @Override
    public int AddInfo(String name, int existing, int completed) {
        return tbCommunityMapper.AddInfo(name,existing,completed);
    }

    @Override
    public int DeleteById(int id) {
        return tbCommunityMapper.DeleteById(id);
    }
}

【com.item.controller/TbCommunityController.java】
package com.item.controller;

import com.item.model.TbCommunity;
import com.item.service.TbCommunityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Controller
public class TbCommunityController {

    @Autowired
    private TbCommunityService db;
    @GetMapping("/GetInfo")
    public String GetInfo(HttpServletRequest request, Model model){
        List list = db.GetInfo();
        model.addAttribute("lists",list);
        return "GetInfo";
    }

    @GetMapping("/SelectByName")
    public String SelectByName(HttpServletRequest request, Model model){
        String name = request.getParameter("name");
        List list = db.SelectByName(name);
        model.addAttribute("lists",list);
        return "GetInfo";
    }
    
    @GetMapping("/AddInfoPage")
    public String AddInfoPage(){
        return "AddInfoPage";
    }
    @PostMapping("/AddInfo")
    public String AddInfo(HttpServletRequest request){
        String name = request.getParameter("name");
        String existing = request.getParameter("existing");
        String completed = request.getParameter("completed");
        db.AddInfo(name, Integer.parseInt(existing), Integer.parseInt(completed));
        return "redirect:/GetInfo";
    }
    @GetMapping("/DeleteById")
    public String DeleteById(HttpServletRequest request){
        String id = request.getParameter("id");
        db.DeleteById(Integer.parseInt(id));
        return "redirect:/GetInfo";
    }
}

【webapp/views/GetInfo.jsp】
<%@ page import="java.util.*" %>
<%@ page import="com.item.model.TbCommunity" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/5/31 0031
  Time: 10:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>


    显示



搜索
名称:
<% List list = (List) request.getAttribute("lists");%> <% for (TbCommunity t : list) { %> <% } %>
编号 用户名 接种疫苗 已接种疫苗 操作
<%=t.getId()%> <%=t.getName()%> <%=t.getExisting()%> <%=t.getCompleted()%> " onclick="return confirm('是否删除此行?')">删除
添加    共计<%=list.size()%>条数据

【webapp/views/AddInfoPage.jsp】
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/5/31 0031
  Time: 10:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>


    添加


添加信息
社区名称
现存疫苗
已接种人数
  

tomcat配置(略)

祝大家考试顺利。 

访问路径:端口号根据自己的配置些啊:

【http://localhost:8088/GetInfo】

转载请注明:文章转载自 http://www.konglu.com/
本文地址:http://www.konglu.com/it/938846.html
免责声明:

我们致力于保护作者版权,注重分享,被刊用文章【当年的Java考试:JAVA&移动应用&大数据-大三-社区疫苗接种管理系统(全部源码·保姆式呵护)】因无法核实真实出处,未能及时与作者取得联系,或有版权异议的,请联系管理员,我们会立即处理,本文部分文字与图片资源来自于网络,转载此文是出于传递更多信息之目的,若有来源标注错误或侵犯了您的合法权益,请立即通知我们,情况属实,我们会第一时间予以删除,并同时向您表示歉意,谢谢!

我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2023 成都空麓科技有限公司

ICP备案号:蜀ICP备2023000828号-2