SSM框架练习—主从表的业务模型

news2024/11/26 19:37:16

需要实现的整体功能:

  1. 系统的登录并进行用户名的校验
  2. 团购信息的列表展示
  3. 团购信息的添加
  4. 团购信息的检索

1、数据库创建

CREATE DATABASE mydb;

USE mydb;


drop table if exists vaccunit;

CREATE TABLE vaccunit (
  vid INT AUTO_INCREMENT PRIMARY KEY,
  unitname VARCHAR(50) NOT NULL,
  address VARCHAR(50) NOT NULL
);

insert into vaccunit(unitname,address) values('柏林卫生院','中原区');
insert into vaccunit(unitname,address) values('社区卫生院','金水区');
insert into vaccunit(unitname,address) values('第一医院','二七区');


drop table if exists appointment;

CREATE TABLE appointment (
  aid INT AUTO_INCREMENT PRIMARY KEY,
  person VARCHAR(32) NOT NULL,
  phone VARCHAR(11) NOT NULL,
  ipcard VARCHAR(18) NOT NULL,
  birthday DATETIME NOT NULL,
  sex VARCHAR(10) NOT NULL,
  vid INT NOT NULL,
  FOREIGN KEY (vid) REFERENCES vaccunit(vid)
);

insert into appointment values (1,'张三','1364758374','40038312345678','2020-01-01','男',1);
insert into appointment values (2,'李四','136423374','40038312345678','2020-01-01','女',2);
insert into appointment values (3,'王五','1364758374','40038312345678','2020-01-01','男',3);


select * from vaccunit;
select * from appointment;

#查询所有预约1号医院(柏林)预约医院
select * from appointment where vid=1;

#使用聚合函数统计查询数据数量
select count(*) from appointment where vid=1;

2、框架搭建,创建项目,导入jar包,创建实体类;

 1.springmvc.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc.xsd">
    <context:component-scan base-package="com.zhan.controller"/>

    <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/"/>
        <property name="suffix" value=".jsp"/>
    </bean>

    <mvc:resources mapping="/css/**" location="/css/"/>
    <mvc:resources mapping="/js/**" location="/js/"/>
    <mvc:resources mapping="/fonts/**" location="/fonts/"/>
    <mvc:resources mapping="/img/**" location="/img/"/>

    <mvc:annotation-driven/>

</beans>

2.spring.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="
            http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/context
            http://www.springframework.org/schema/context/spring-context.xsd
            http://www.springframework.org/schema/aop
            http://www.springframework.org/schema/aop/spring-aop.xsd">
    <context:component-scan base-package="com.zhan">
        <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
    </context:component-scan>

    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName" value="com.mysql.cj.jdbc.Driver"/>
        <property name="url" value="jdbc:mysql://localhost:3306/mydb"/>
        <property name="username" value="root"/>
        <property name="password" value="root"/>
    </bean>

    <bean id="factoryBean" class="org.mybatis.spring.SqlSessionFactoryBean">
        <property name="dataSource" ref="dataSource"/>
        <property name="typeAliasesPackage" value="com.zhan.bean"/>
        <property name="configLocation" value="classpath:mybatis.xml"/>
    </bean>

    <bean id="scannerConfigurer" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <property name="basePackage" value="com.zhan.dao"/>
    </bean>

</beans>

3.mybatis.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration
        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
    <settings>
        <setting name="logImpl" value="log4j"/>
    </settings>

</configuration>

4.web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
         version="4.0">
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:spring.xml</param-value>
    </context-param>

    <servlet>
        <servlet-name>dispatcherServlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:springmvc.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>dispatcherServlet</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

    <filter>
        <filter-name>encodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>utf-8</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>encodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
</web-app>

配置完成后,测试是否能够运行成功;

index.jsp首页

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>首页</title>
  </head>
  <body>
  <a href="findAll">去登录</a>
  </body>
</html>

zhuye.jsp主页

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>主页</title>
</head>
<body>
<h2>欢迎来到主页!</h2>
</body>
<table>
    <thead>
    <tr>
        <th>接种单位</th>
        <th>预约人</th>
        <th>电话</th>
        <th>身份证</th>
        <th>生日</th>
        <th>性别</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    
    </tbody>
</table>
</html>

controller层的AppointmentController

@Controller
public class AppointmentController {

    @RequestMapping("/findAll")
    public ModelAndView findAll(){
        ModelAndView mv = new ModelAndView();
        System.out.println("findAll执行");
        mv.setViewName("zhuye");
        return mv;
    }
}

运行后,测试成功; 

 

 3、当页面第一次加载时,显示所有的预约列表。 在列表中,需要显示列“接种单位”、“预约人”、“电话”、“身份证”、“生日”、“性别”、“操作”。

1.全查 

 dao层AppointmentDao

@Repository
public interface AppointmentDao {
    List<Appointment> selectAll();
}

dao层VaccunitDao

@Repository
public interface VaccunitDao {
    @Select("select * from vaccunit where vid=#{vid}")
    Vaccunit selectById(int vid);
}

dao层AppointmentDao.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhan.dao.AppointmentDao">
    <resultMap id="amMap" type="com.zhan.bean.Appointment">
        <id property="aid" column="aid"/>
        <result property="person" column="person"/>
        <result property="phone" column="phone"/>
        <result property="ipcard" column="ipcard"/>
        <result property="birthday" column="birthday"/>
        <result property="sex" column="sex"/>
        <association property="vaccunit" column="vid" select="com.zhan.dao.VaccunitDao.selectById"></association>
    </resultMap>
    <select id="selectAll" resultMap="amMap">
        select * from appointment;
    </select>
</mapper>

service层AppointmentService

@Service
public interface AppointmentService {
    List<Appointment> selectAll();
}

 service层VaccunitService

public interface VaccunitService {
    Vaccunit selectById(int vid);
}

service层impl.AppointmentServiceImpl

@Service
public class AppointmentServiceImpl implements AppointmentService {
    @Autowired
    AppointmentDao appointmentDao;

    @Override
    public List<Appointment> selectAll() {
        return appointmentDao.selectAll();
    }
}

 service层impl.VaccunitServiceImpl

@Service
public class VaccunitServiceImpl implements VaccunitService {
    @Autowired
    VaccunitDao vaccunitDao;

    @Override
    public Vaccunit selectById(int vid) {
        return vaccunitDao.selectById(vid);
    }
}

 controller层的AppointmentController

@Controller
public class AppointmentController {
    @Autowired
    AppointmentService appointmentService;
    @Autowired
    VaccunitService vaccunitService;

    @RequestMapping("/findAll")
    public ModelAndView findAll(){
        ModelAndView mv = new ModelAndView();
//        System.out.println("findAll执行");
        List<Appointment> appointmentList = appointmentService.selectAll();
//        System.out.println(appointmentList);
        mv.addObject("appointmentList",appointmentList);
        mv.setViewName("zhuye");
        return mv;
    }
}

zhuye.jsp主页

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>主页</title>
</head>
<body>
<h2>欢迎来到主页!</h2>
<table>
    <thead>
    <tr>
        <th>接种单位</th>
        <th>预约人</th>
        <th>电话</th>
        <th>身份证</th>
        <th>生日</th>
        <th>性别</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${appointmentList}" var="appointment">
        <tr>
            <td><a href="findByVid?vid=${appointment.vaccunit.vid}">${appointment.vaccunit.unitname}</a>
            </td>
            <td>${appointment.person}</td>
            <td>${appointment.phone}</td>
            <td>${appointment.ipcard}</td>
            <td>${appointment.birthday}</td>
            <td>${appointment.sex}</td>
            <td>
                <a href="del?aid=${appointment.aid}">删除</a>
            </td>
        </tr>
    </c:forEach>
    </tbody>
</table>
</body>
</html>

新增

  • 添加页面的接种单位需要从后台查询并使用下列列表显示。
  • 当缺陷预约成功之后,跳转到列表页面。
dao层AppointmentDao
@Repository
public interface AppointmentDao {
    int insert(Appointment appointment);
}

dao层AppointmentDao.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhan.dao.AppointmentDao">
    <resultMap id="amMap" type="com.zhan.bean.Appointment">
        <id property="aid" column="aid"/>
        <result property="person" column="person"/>
        <result property="phone" column="phone"/>
        <result property="ipcard" column="ipcard"/>
        <result property="birthday" column="birthday"/>
        <result property="sex" column="sex"/>
        <association property="vaccunit" column="vid" select="com.zhan.dao.VaccunitDao.selectById"></association>
    </resultMap>
    <insert id="insert" parameterType="com.zhan.bean.Appointment">
        insert into appointment(person,phone,ipcard,birthday,sex,vid)
        values (#{person},#{phone},#{ipcard},#{birthday},#{sex},#{vaccunit.vid});
    </insert>
</mapper>

service层AppointmentService

@Service
public interface AppointmentService {
    int insert(Appointment appointment);
}

service层impl.AppointmentServiceImpl

@Service
public class AppointmentServiceImpl implements AppointmentService {
    @Autowired
    AppointmentDao appointmentDao;

    @Override
    public int insert(Appointment appointment) {
        return appointmentDao.insert(appointment);
    }
}

 controller层的AppointmentController

@Controller
public class AppointmentController {
    @Autowired
    AppointmentService appointmentService;
    @Autowired
    VaccunitService vaccunitService;


    @RequestMapping("/add")
    public ModelAndView insert(Appointment appointment){
        ModelAndView mv = new ModelAndView();
//        System.out.println(appointment);
        int n = appointmentService.insert(appointment);
        if(n>0){
            mv.setViewName("redirect:/findAll");
        }else{
            mv.setViewName("error");
        }
        return mv;
    }

    @RequestMapping("/del")
    public ModelAndView del(int aid){
        ModelAndView mv = new ModelAndView();
        int n = appointmentService.delete(aid);
        System.out.println(n);
        mv.setViewName("redirect:/findAll");
        return mv;
    }
}

zhuye.jsp主页

<h2>欢迎来到主页!</h2>
<h3>
    <a href="add.jsp">预约</a>
</h3>

add.jsp添加页

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>添加页</title>
</head>
<body>
<form action="add" method="post">
    接种单位:
    <select id="type" name="vaccunit.vid">
        <option value="1">柏林卫生院</option>
        <option value="2">社区卫生院</option>
        <option value="3">第一医院</option>
    </select><br>
    预约人:<input type="text" name="person" id="person" value=""><br>
    电话:<input type="text" name="phone" id="phone" value=""><br>
    身份证:<input type="text" name="ipcard" id="ipcard" value=""><br>
    生日:<input type="text" name="birthday" id="birthday" value=""><br>
    性别:<input type="radio" name="sex" value="男">男
    <input type="radio" name="sex" value="女">女<br>
    <button type="submit" id="btn">预约</button>
</form>
</body>
</html>

删除

dao层AppointmentDao

@Repository
public interface AppointmentDao {
    int delete(int aid);
}

dao层AppointmentDao.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhan.dao.AppointmentDao">
    <resultMap id="amMap" type="com.zhan.bean.Appointment">
        <id property="aid" column="aid"/>
        <result property="person" column="person"/>
        <result property="phone" column="phone"/>
        <result property="ipcard" column="ipcard"/>
        <result property="birthday" column="birthday"/>
        <result property="sex" column="sex"/>
        <association property="vaccunit" column="vid" select="com.zhan.dao.VaccunitDao.selectById"></association>
    </resultMap>

    <delete id="delete" parameterType="int">
         delete from appointment where aid=#{aid};
    </delete>
</mapper>

service层AppointmentService

@Service
public interface AppointmentService {
    int delete(int aid);
}

service层impl.AppointmentServiceImpl

@Service
public class AppointmentServiceImpl implements AppointmentService {
    @Autowired
    AppointmentDao appointmentDao;

    @Override
    public int delete(int aid) {
        return appointmentDao.delete(aid);
    }
}

 controller层的AppointmentController

@Controller
public class AppointmentController {
    @Autowired
    AppointmentService appointmentService;
    @Autowired
    VaccunitService vaccunitService;

    @RequestMapping("/del")
    public ModelAndView del(int aid){
        ModelAndView mv = new ModelAndView();
        int n = appointmentService.delete(aid);
        System.out.println(n);
        mv.setViewName("redirect:/findAll");
        return mv;
    }
}

zhuye.jsp主页

            <td>
                <a href="del?aid=${appointment.aid}">删除</a>
            </td>

统计

  • 详情界面能够正确显示接种单位和单位地址。
  • 并能够正确显示预约人数。

dao层AppointmentDao

@Repository
public interface AppointmentDao {
    int count(int vid);
}

dao层AppointmentDao.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhan.dao.AppointmentDao">
    <resultMap id="amMap" type="com.zhan.bean.Appointment">
        <id property="aid" column="aid"/>
        <result property="person" column="person"/>
        <result property="phone" column="phone"/>
        <result property="ipcard" column="ipcard"/>
        <result property="birthday" column="birthday"/>
        <result property="sex" column="sex"/>
        <association property="vaccunit" column="vid" select="com.zhan.dao.VaccunitDao.selectById"></association>
    </resultMap>
    <select id="count" parameterType="int" resultType="int">
        select count(*) from appointment where vid=#{vid};
    </select>
</mapper>

service层AppointmentService

@Service
public interface AppointmentService {
    int count(int vid);
}

service层impl.AppointmentServiceImpl

@Service
public class AppointmentServiceImpl implements AppointmentService {
    @Autowired
    AppointmentDao appointmentDao;

    @Override
    public int count(int vid) {
        return appointmentDao.count(vid);
    }
}

 controller层的AppointmentController

@Controller
public class AppointmentController {
    @Autowired
    AppointmentService appointmentService;
    @Autowired
    VaccunitService vaccunitService;

    @RequestMapping("/findByVid")
    public ModelAndView findByVid(int vid){
        ModelAndView mv = new ModelAndView();
        //根据Vid查询医院信息
        Vaccunit vaccunit = vaccunitService.selectById(vid);
        //根vid查询该医院预约信息的计数数量
        int count = appointmentService.count(vid);
        mv.addObject("vaccunit",vaccunit);
        mv.addObject("count",count);
        mv.setViewName("show");
        return mv;
    }
}

zhuye.jsp主页 

    <select id="type" name="vaccunit.vid">
        <option value="1">柏林卫生院</option>
        <option value="2">社区卫生院</option>
        <option value="3">第一医院</option>
    </select>

模糊查询

dao层AppointmentDao 

@Repository
public interface AppointmentDao {
    List<Appointment> seach(Appointment appointment);
}

dao层AppointmentDao.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhan.dao.AppointmentDao">
    <resultMap id="amMap" type="com.zhan.bean.Appointment">
        <id property="aid" column="aid"/>
        <result property="person" column="person"/>
        <result property="phone" column="phone"/>
        <result property="ipcard" column="ipcard"/>
        <result property="birthday" column="birthday"/>
        <result property="sex" column="sex"/>
        <association property="vaccunit" column="vid" select="com.zhan.dao.VaccunitDao.selectById"></association>
    </resultMap>
    <select id="seach" parameterType="com.zhan.bean.Appointment" resultMap="amMap">
        select * from appointment where vid=#{vaccunit.vid} and person like concat('%',#{person},'%');
    </select>
</mapper>

service层AppointmentService

@Service
public interface AppointmentService {
    List<Appointment> seach(Appointment appointment);
}

service层impl.AppointmentServiceImpl

@Service
public class AppointmentServiceImpl implements AppointmentService {
    @Autowired
    AppointmentDao appointmentDao;

    @Override
    public List<Appointment> seach(Appointment appointment) {
        return appointmentDao.seach(appointment);
    }
}

 controller层的AppointmentController

@Controller
public class AppointmentController {
    @Autowired
    AppointmentService appointmentService;
    @Autowired
    VaccunitService vaccunitService;

    @RequestMapping("/seach")
    public ModelAndView seach(Appointment appointment){
        ModelAndView mv = new ModelAndView();
        List<Appointment> appointmentList = appointmentService.seach(appointment);
        System.out.println(appointmentList);
        mv.addObject("appointmentList",appointmentList);
        mv.setViewName("zhuye");
        return mv;
    }
}

zhuye.jsp主页

<form action="seach" method="post">
    <select id="type" name="vaccunit.vid">
        <option value="1">柏林卫生院</option>
        <option value="2">社区卫生院</option>
        <option value="3">第一医院</option>
    </select>
    <input type="text" name="person" value="" placeholder="请输入姓名">
    <input type="submit" value="搜索">
</form>

页面展示

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/513453.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

合众伟奇加入飞桨技术伙伴计划,共建“AI+数智化服务”科技创新发展格局

近日&#xff0c;北京合众伟奇科技股份有限公司正式加入飞桨技术伙伴计划&#xff0c;双方将共同努力在电力能源、工业制造等行业的AI技术应用及生态建设上做出贡献&#xff0c;致力构建“AI数智化服务”发展新模式&#xff0c;助力客户业务信息化、数字化、智能化升级。 北京合…

Grafana系列-统一展示-6-Zabbix仪表板

系列文章 Grafana 系列文章 &#x1f4dd;Notes: 关于 Grafana系列-统一展示-6-Zabbix 数据源, 其实已经在之前的文章: 使用 Grafana 统一监控展示 - 对接 Zabbix 里详细介绍过了, 感兴趣的请移步阅读. 知识储备 一个图表上的多个 Items 我们可以在 metric 字段内使用正则表…

在为缺少进项发票忧心忡忡?教你如何合理降低增值税!

​业务是流程&#xff0c;财税是结果&#xff0c;税收问题千千万&#xff0c;《税算盘》来帮你找答案。 缺少进项通常是指增值税专用发票缺少抵扣&#xff0c;增值税专用发票有能够抵扣税金的功能。企业出现缺少进项发票的情况时&#xff0c;就会进一步影响企业的所得税税负。…

海睿思分享 | 制造业数字化转型之路

近年来&#xff0c;制造业企业数字化转型的话题一直处于行业高热位置。中央经济工作会议作出“大力发展数字经济”的部署&#xff0c;工信部提出要深化产业数字化转型&#xff0c;建设一批全球领先的智能工厂、智慧供应链&#xff0c;并向中小企业场景化、标准化复制推广。近期…

c#笔记-特性

特性 添加特性 特性是一种用于给代码添加额外信息的声明性标签。 在修饰的元素之前&#xff0c;用方括号声明特性。 [Obsolete("过时的类")] public class MyClass1 {}需要声明多个特性时&#xff0c;可以使用多个方括号&#xff0c;也可以在一个方括号里使用逗号…

STL好难(1):STL简介

目录 1. 什么是STL&#xff1a; 2. STL的版本&#xff1a; &#xff08;1&#xff09;原始版本 &#xff08;2&#xff09;P.J.版本 &#xff08;3&#xff09;RW版本 &#xff08;4&#xff09;SGL版本 3. STL的六大组件&#xff1a; 4. SLT的重要性 &#xff08;1&a…

医院医学影像系统PACS,使用手册和操作说明书。

首先&#xff0c;系统可实现检查预约、病人信息登记、计算机阅片、电子报告书写、胶片打印、数据备份等一系列满足影像科室日常工作的功能,并且由于影像数字化存储,用户可利用影像处理与测量技术辅助诊断、方便快捷地查找资料或利用网络将资料传输至临床科室&#xff0c;还可与…

femu使用记录

femu使用记录 环境搭建libnvme&#xff1a;libnvme.so.1: cannot open shared object file: No such file or directory调试方法 Briefly speaking, FEMU is a fast, accurate, scalable, and extensible NVMe SSD Emulator. Based upon QEMU/KVM, FEMU is exposed to Guest OS…

《花雕学AI》Poe 上的四种 AI 机器人,你该怎么选?ChatGPT、Sage、Claude 和 Dragonfly对比

虽然 ChatGPT 是一项革命性的技术&#xff0c;但它作为一个消费产品却有点失败。你可能会花很长时间等待 OpenAI 的聊天机器人加载&#xff0c;或者根本无法使用它&#xff0c;因为它太大了。就算你能用上它&#xff0c;它也很缓慢&#xff0c;而且它的界面也很丑陋。它甚至没有…

连接(基础版)

QUESTION ONE # Write your MySQL query statement below select unique_id,name from EmployeeUNI right join Employees on EmployeeUNI.id Employees.id 这题很显然有两张表需要进行连接&#xff0c;在我们确定完要取的字段后&#xff0c;就需要连接两张表&#xff0c;…

鸿蒙Hi3861学习十二-Huawei LiteOS-M(osXX与LOS_XX)

一、LOS_XX是什么 LOS_XX是LiteOS_M或LiteOS_A内核提供的接口。例如&#xff1a;LOS_TaskCreate、LOS_TaskCreate、LOS_SemCreate等。因为LiteOS_M和LiteOS_A是针对不同的内核&#xff0c;所以LOS_XX在实现上也是有所不同的。也就是说LOS_XX跟具体的内核类型是有关系的。 这里只…

伸展树详解

伸展树的概念 伸展树&#xff08;Splay Tree&#xff09;是仅依靠局部性原理和局部平衡分析&#xff0c;从而实现高效的自适应平衡树结构。是一种二叉查找树&#xff0c;其核心思想是将最近访问的节点旋转到根节点。每次进行访问、插入、删除等操作时&#xff0c;都会选择与之…

【云计算】Hadoop集群安装

文章目录 前言一、环境二、安装虚拟机及配置配置网络 三、安装Ubuntu及配置下载ISO镜像VMware安装UbuntuUbuntu配置&#xff1a;配置结果IP免密登录 JAVA安装hadoop安装&#xff1a;文件的作用core-site.xml&#xff1a;core-site.xmlyarn-site.xmlmapred-site.xml 修改配置&am…

【Linux网络】网络层IP和数据链路层

文章目录 1、网络层IP1.1 认识网络层1.2 IP报文格式和IP报文切片1.3 网段划分以及路由 2、数据链路层2.1 以太网帧格式2.2 ARP协议 3、其它重要协议或技术3.1 DNS技术3.2 ICMP协议3.3 NAT技术3.4 NAT和代理服务器 1、网络层IP 1.1 认识网络层 浅谈一下各层 应用层&#xff1a;…

JBoss 5.x/6.x 反序列化漏洞(CVE-2017-12149)复现

文章目录 一.前言二.影响版本三.环境搭建四.漏洞复现1.编写反弹shell的命令2.序列化数据生成3.发送POC 一.前言 该漏洞为 Java反序列化错误类型&#xff0c;存在于 Jboss 的 HttpInvoker 组件中的 ReadOnlyAccessFilter 过滤器中。该过滤器在没有进行任何安全检查的情况下尝试…

基于AT89C51单片机的温度计设计

点击链接获取Keil源码与Project Backups仿真图&#xff1a; https://download.csdn.net/download/qq_64505944/87773445 源码获取 主要内容&#xff1a; 设计一个简易温度计&#xff1b;要求电路实现如下功能&#xff1a; 设计通过单片机和数码管、led灯等组成&#xff0c;可…

巧用千寻位置GNSS软件| 一文学会曲线样

曲线放样是圆曲线形放样工具&#xff0c;在线路初堪、临时设计、临时放样采集坐标等作业过程中&#xff0c;曲线放样更加简单和方便。千寻位置GNSS软件提供了三种线型文件编辑放&#xff0c;分别是直线、圆曲线 和缓曲线。圆曲线说明:线型上任意一点的曲率、半径都相同;缓曲线说…

【剧前爆米花--爪哇岛寻宝】网络编程一些概念以及Java实现网络编程流程

作者&#xff1a;困了电视剧 专栏&#xff1a;《JavaEE初阶》 文章分布&#xff1a;这是一篇关于网络初识的文章&#xff0c;在这篇文章中剖析了网络编程的一些概念以及用Java实现网络编程的一些流程&#xff0c;希望对你有所帮助&#xff01; 目录 网络编程 含义和一些概念 …

sysMaster: 全新1号进程实现方案,秒级自愈,保障系统全天在线

认识 1 号进程和 sysMaster 在 Linux 操作系统中&#xff0c;1 号进程是 init 进程&#xff0c;它是所有其他进程的祖先进程。init 进程是系统启动时第一个被创建的进程&#xff0c;它负责启动和管理其他所有进程&#xff0c;并在系统关机时关闭它们。在现代 Linux 系统中&…

数组--part 4--长度最小的子数组(力扣299/904/76)

文章目录 算法基本思想leetcode 209 长度最小的子数组leetcode 904 水果成篮leetcode 76 最小覆盖子串 算法基本思想 首先对于滑动窗口&#xff0c;题目可以先去看看leetcode 209 进行相关的了解后&#xff0c;再来书写代码。 首先我们的第一想法肯定就是暴力解法&#xff1a…