MybatisPlus概述及使用

news2024/9/24 3:20:02

文章目录

  • MybatisPlus
    • 1、介绍
      • 1.1、概述
      • 1.2、特性
      • 1.3、 支持数据库
      • 1.4、框架结构
    • 2、起步依赖与核心接口
      • 2.1 起步依赖
      • 2.2 BaseMapper
    • 3、快速入门
      • 3.1、导入依赖
      • 3.2、SpringBoot配置文件
      • 3.3、实体类
      • 3.4、Mapper接口
      • 3.5、引导类增加MapperScan注解
      • 3.6 测试
    • 4、注解
      • 4.1 @TableName
      • 4.2 @TableId
      • 4.3 @TableField
    • 5、常用API
      • 5.1 增加
      • 5.2 删除
      • 5.3 修改
      • 5.4 查询
      • 5.5 分页插件【了解】
    • 6.在Service层实现增强
    • 7、自定义Mapper

MybatisPlus

1、介绍

1.1、概述

  • 官网:
  • 是由国人开发一款Mybatis的插件
  • 简称 MP,是一个 MyBatis的增强工具,在MyBatis的基础上只做增强不做改变,为简化开发、提高效率而生。
  • 愿景:成为 MyBatis 最好的搭档
  • 源码:https://gitee.com/baomidou/mybatis-plus

1.2、特性

  • 无侵入:只做增强不做改变,引入它不会对现有工程产生影响,如丝般顺滑
  • 损耗小:启动即会自动注入基本 CURD,性能基本无损耗,直接面向对象操作
  • 强大的 CRUD 操作:内置通用 Mapper、通用 Service,仅仅通过少量配置即可实现单表大部分 CRUD 操作,更有强大的条件构造器,满足各类使用需求
  • 支持 Lambda 形式调用:通过 Lambda 表达式,方便的编写各类查询条件,无需再担心字段写错
  • 支持主键自动生成:支持多达 4 种主键策略(内含分布式唯一 ID 生成器 - Sequence),可自由配置,完美解决主键问题
  • 支持 ActiveRecord 模式:支持 ActiveRecord 形式调用,实体类只需继承 Model 类即可进行强大的 CRUD 操作
  • 支持自定义全局通用操作:支持全局通用方法注入( Write once, use anywhere )
  • 内置代码生成器:采用代码或者 Maven 插件可快速生成 Mapper 、 Model 、 Service 、 Controller 层代码,支持模板引擎,更有超多自定义配置等您来使用
  • 内置分页插件:基于 MyBatis 物理分页,开发者无需关心具体操作,配置好插件之后,写分页等同于普通 List 查询
  • 分页插件支持多种数据库:支持 MySQL、MariaDB、Oracle、DB2、H2、HSQL、SQLite、Postgre、SQLServer 等多种数据库
  • 内置性能分析插件:可输出 SQL 语句以及其执行时间,建议开发测试时启用该功能,能快速揪出慢查询
  • 内置全局拦截插件:提供全表 delete 、 update 操作智能分析阻断,也可自定义拦截规则,预防误操作

1.3、 支持数据库

  • MySQL,Oracle,DB2,H2,HSQL,SQLite,PostgreSQL,SQLServer,Phoenix,Gauss ,ClickHouse,Sybase,OceanBase,Firebird,Cubrid,Goldilocks,csiidb

1.4、框架结构

框架结构
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-bLignNk4-1670684066627)(pic/mybatis-plus-framework.jpg)]

2、起步依赖与核心接口

2.1 起步依赖

<dependency>
    <groupId>com.baomidou</groupId>
    <artifactId>mybatis-plus-boot-starter</artifactId>
    <version>3.1.1</version>
</dependency>

2.2 BaseMapper

  • Mapper 继承该接口后,无需编写 mapper.xml 文件,即可获得CRUD功能
/*
 * Copyright (c) 2011-2020, baomidou (jobob@qq.com).
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * <p>
 * https://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package com.baomidou.mybatisplus.core.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;

/*

               :`
                    .:,
                     :::,,.
             ::      `::::::
             ::`    `,:,` .:`
             `:: `::::::::.:`      `:';,`
              ::::,     .:::`   `@++++++++:
               ``        :::`  @+++++++++++#
                         :::, #++++++++++++++`
                 ,:      `::::::;'##++++++++++
                 .@#@;`   ::::::::::::::::::::;
                  #@####@, :::::::::::::::+#;::.
                  @@######+@:::::::::::::.  #@:;
           ,      @@########':::::::::::: .#''':`
           ;##@@@+:##########@::::::::::: @#;.,:.
            #@@@######++++#####'::::::::: .##+,:#`
            @@@@@#####+++++'#####+::::::::` ,`::@#:`
            `@@@@#####++++++'#####+#':::::::::::@.
             @@@@######+++++''#######+##';::::;':,`
              @@@@#####+++++'''#######++++++++++`
               #@@#####++++++''########++++++++'
               `#@######+++++''+########+++++++;
                `@@#####+++++''##########++++++,
                 @@######+++++'##########+++++#`
                @@@@#####+++++############++++;
              ;#@@@@@####++++##############+++,
             @@@@@@@@@@@###@###############++'
           @#@@@@@@@@@@@@###################+:
        `@#@@@@@@@@@@@@@@###################'`
      :@#@@@@@@@@@@@@@@@@@##################,
      ,@@@@@@@@@@@@@@@@@@@@################;
       ,#@@@@@@@@@@@@@@@@@@@##############+`
        .#@@@@@@@@@@@@@@@@@@#############@,
          @@@@@@@@@@@@@@@@@@@###########@,
           :#@@@@@@@@@@@@@@@@##########@,
            `##@@@@@@@@@@@@@@@########+,
              `+@@@@@@@@@@@@@@@#####@:`
                `:@@@@@@@@@@@@@@##@;.
                   `,'@@@@##@@@+;,`
                        ``...``

 _ _     /_ _ _/_. ____  /    _
/ / //_//_//_|/ /_\  /_///_/_\      Talk is cheap. Show me the code.
     _/             /
 */

/**
 * Mapper 继承该接口后,无需编写 mapper.xml 文件,即可获得CRUD功能
 * <p>这个 Mapper 支持 id 泛型</p>
 *
 * @author hubin
 * @since 2016-01-23
 */
public interface BaseMapper<T> extends Mapper<T> {

    /**
     * 插入一条记录
     *
     * @param entity 实体对象
     */
    int insert(T entity);

    /**
     * 根据 ID 删除
     *
     * @param id 主键ID
     */
    int deleteById(Serializable id);

    /**
     * 根据 columnMap 条件,删除记录
     *
     * @param columnMap 表字段 map 对象
     */
    int deleteByMap(@Param(Constants.COLUMN_MAP) Map<String, Object> columnMap);

    /**
     * 根据 entity 条件,删除记录
     *
     * @param wrapper 实体对象封装操作类(可以为 null)
     */
    int delete(@Param(Constants.WRAPPER) Wrapper<T> wrapper);

    /**
     * 删除(根据ID 批量删除)
     *
     * @param idList 主键ID列表(不能为 null 以及 empty)
     */
    int deleteBatchIds(@Param(Constants.COLLECTION) Collection<? extends Serializable> idList);

    /**
     * 根据 ID 修改
     *
     * @param entity 实体对象
     */
    int updateById(@Param(Constants.ENTITY) T entity);

    /**
     * 根据 whereEntity 条件,更新记录
     *
     * @param entity        实体对象 (set 条件值,可以为 null)
     * @param updateWrapper 实体对象封装操作类(可以为 null,里面的 entity 用于生成 where 语句)
     */
    int update(@Param(Constants.ENTITY) T entity, @Param(Constants.WRAPPER) Wrapper<T> updateWrapper);

    /**
     * 根据 ID 查询
     *
     * @param id 主键ID
     */
    T selectById(Serializable id);

    /**
     * 查询(根据ID 批量查询)
     *
     * @param idList 主键ID列表(不能为 null 以及 empty)
     */
    List<T> selectBatchIds(@Param(Constants.COLLECTION) Collection<? extends Serializable> idList);

    /**
     * 查询(根据 columnMap 条件)
     *
     * @param columnMap 表字段 map 对象
     */
    List<T> selectByMap(@Param(Constants.COLUMN_MAP) Map<String, Object> columnMap);

    /**
     * 根据 entity 条件,查询一条记录
     *
     * @param queryWrapper 实体对象封装操作类(可以为 null)
     */
    T selectOne(@Param(Constants.WRAPPER) Wrapper<T> queryWrapper);

    /**
     * 根据 Wrapper 条件,查询总记录数
     *
     * @param queryWrapper 实体对象封装操作类(可以为 null)
     */
    Integer selectCount(@Param(Constants.WRAPPER) Wrapper<T> queryWrapper);

    /**
     * 根据 entity 条件,查询全部记录
     *
     * @param queryWrapper 实体对象封装操作类(可以为 null)
     */
    List<T> selectList(@Param(Constants.WRAPPER) Wrapper<T> queryWrapper);

    /**
     * 根据 Wrapper 条件,查询全部记录
     *
     * @param queryWrapper 实体对象封装操作类(可以为 null)
     */
    List<Map<String, Object>> selectMaps(@Param(Constants.WRAPPER) Wrapper<T> queryWrapper);

    /**
     * 根据 Wrapper 条件,查询全部记录
     * <p>注意: 只返回第一个字段的值</p>
     *
     * @param queryWrapper 实体对象封装操作类(可以为 null)
     */
    List<Object> selectObjs(@Param(Constants.WRAPPER) Wrapper<T> queryWrapper);

    /**
     * 根据 entity 条件,查询全部记录(并翻页)
     *
     * @param page         分页查询条件(可以为 RowBounds.DEFAULT)
     * @param queryWrapper 实体对象封装操作类(可以为 null)
     */
    IPage<T> selectPage(IPage<T> page, @Param(Constants.WRAPPER) Wrapper<T> queryWrapper);

    /**
     * 根据 Wrapper 条件,查询全部记录(并翻页)
     *
     * @param page         分页查询条件
     * @param queryWrapper 实体对象封装操作类
     */
    IPage<Map<String, Object>> selectMapsPage(IPage<T> page, @Param(Constants.WRAPPER) Wrapper<T> queryWrapper);
}

3、快速入门

3.1、导入依赖

<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
</dependency>

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-test</artifactId>
</dependency>

<dependency>
    <groupId>com.baomidou</groupId>
    <artifactId>mybatis-plus-boot-starter</artifactId>
    <version>3.1.1</version>
</dependency>
<dependency>
    <groupId>com.github.pagehelper</groupId>
    <artifactId>pagehelper-spring-boot-starter</artifactId>
    <version>1.3.0</version>
</dependency>
<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>druid-spring-boot-starter</artifactId>
    <version>1.1.10</version>
</dependency>

3.2、SpringBoot配置文件

logging:
  level:
    com.qf.java2108.demo04: debug

spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/library?useSSL=false&serverTimezone=UTC&characterEncoding=UTF8&useUnicode=true
    username: root
    password: root
    type: com.alibaba.druid.pool.DruidDataSource


mybatis-plus:
  type-aliases-package: com.qf.java2108.demo04.pojo
  mapper-locations: classpath:mapper/*Mapper.xml
  configuration:
    map-underscore-to-camel-case: true

3.3、实体类

package com.qf.java2108.demo04.pojo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author ghy
 * @version 1.0
 * @date
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
//映射数据库表,默认情况下,会把实体类名作为表名去映射
@TableName("tb_reader")
public class ReaderInfo {

    @TableId  //表示主键
    private Integer id;

    private String readerNum;
    private String readerName;

    //当数据库表的字段名跟Java实体属性名不一致,且也不满足驼峰命名时,必须使用@TableField来指定当前属性跟数据库表的哪个字段进行映射
    //@TableField("password")
    //private String pwd;

    private String password;
    private Integer gender;
    private Date birth;
    private String address;
    private String phone;
    private Date createTime;
    private Date updateTime;
    private Integer adminId;
    private Integer status;

}

3.4、Mapper接口

继承BaseMapper

public interface ReaderInfoMapper extends BaseMapper<ReaderInfo> {}

3.5、引导类增加MapperScan注解

@SpringBootApplication
@MapperScan("com.qf.java2108.demo04.mapper")
public class SpringBootDemo04Application {
    public static void main(String[] args) {
        SpringApplication.run(SpringBootDemo04Application.class, args);
    }
}

3.6 测试

package com.qf.java2108.demo04;

import com.qf.java2108.demo04.mapper.ReaderInfoMapper;
import com.qf.java2108.demo04.pojo.ReaderInfo;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

/**
 * @author ghy
 * @version 1.0
 * @date 2022-03-11
 **/
@SpringBootTest
public class SpringBootDemo04ApplicationTest {

    @Autowired
    private ReaderInfoMapper readerInfoMapper;

    /**
     *
     **/
    @Test
    public void mybatisPlusQuickTest() throws Exception {
        List<ReaderInfo> list = readerInfoMapper.selectList(null);
        for (ReaderInfo readerInfo : list) {
            System.out.println(readerInfo);
        }

    }

}
测试效果

4、注解

4.1 @TableName

  • 映射数据库表,默认情况下,会把实体类名作为表名去映射

4.2 @TableId

  • 映射主键
  • type属性:指定主键生成策略
    • 插入时,如果主键是自增的,那么就无需指定主键的值

4.3 @TableField

  • value属性:指定数据库表的字段名

    • 当数据库表的字段名跟Java实体属性名不一致且也不满足驼峰命名时,必须使用@TableField来指定当前属性跟数据库表的哪个字段进行映射
  • select属性:查询时,是否查询该属性对应的字段值

    • 默认值是true,要查询
    • false:不查询该属性对应的字段值
  • exist:表示当前属性在数据库表中是否有对应的字段【一般在映射实体和集合时会指定】

    • 默认值是true,是有的
    • false:没有对应的字段
    //表示当前属性在数据库表中没有对应的字段
    @TableField(exist = false)
    private Admin admin;
    

5、常用API

增删改返回的都是影响行数

5.1 增加

/**
* 插入一条记录
*
* @param entity 实体对象
*/
int insert(T entity);
  • 注意

    • @TableId(type = IdType.AUTO)  //表示主键
      private Long id;
      
      • 指定@TableId注解的type属性为IdType.AUTO值,表示插入记录使用数据库主键自增特性
    • 会自动返回插入记录的主键值

5.2 删除

/**
 * 根据 ID 删除
 *
 * @param id 主键ID
 */
int deleteById(Serializable id);

5.3 修改

/**
 * 根据 ID 修改
 *
 * @param entity 实体对象
 */
int updateById(@Param(Constants.ENTITY) T entity);
动态更新
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-fmkDe5KB-1670684066628)(pic/image-20220311111136882.png)]

5.4 查询

/**
 * select
 **/
@Test
public void selectTest() throws Exception {
    //ReaderInfo readerInfo = readerInfoMapper.selectById(1);
    //System.out.println("readerInfo = " + readerInfo);
//
    //List<ReaderInfo> readerInfos = readerInfoMapper.selectBatchIds(Arrays.asList(1, 10, 2, 30));
    //for (ReaderInfo info : readerInfos) {
    //    System.out.println(info);
    //}

    //List<ReaderInfo> readerInfos = readerInfoMapper.selectList(null);

    //根据条件查询
    //QueryWrapper<ReaderInfo> wrapper = new QueryWrapper<>();
    //wrapper.eq("phone", "13512345678");
    //wrapper.gt("update_time", java.sql.Date.valueOf("2000-12-12"));
    //wrapper.likeRight("reader_name","l");
    参数一:是否需要进行排序
    //wrapper.orderBy(true, true, "id");
    //wrapper.orderByDesc("update_time");
    //List<ReaderInfo> readerInfos = readerInfoMapper.selectList(wrapper);
    
    //Map<String,Object> map = new HashMap<>();
    //map.put("phone","13512345678");
    //List<ReaderInfo> readerInfos = readerInfoMapper.selectByMap(map);

    //QueryWrapper<ReaderInfo> wrapper = new QueryWrapper<>();
    //wrapper.eq("phone", "13512345678");
    //wrapper.gt("update_time", java.sql.Date.valueOf("2000-12-12"));
    //Integer count = readerInfoMapper.selectCount(wrapper);
    //System.out.println("count = " + count);

    //QueryWrapper<ReaderInfo> wrapper = new QueryWrapper<>();
    //wrapper.eq("reader_name", "lisi");
    通过非主键查询单条记录
    //ReaderInfo readerInfo = readerInfoMapper.selectOne(wrapper);
    //System.out.println("readerInfo = " + readerInfo);

    QueryWrapper<ReaderInfo> wrapper = new QueryWrapper<>();
    wrapper.eq("reader_name", "lisi");
    List<Object> objects = readerInfoMapper.selectObjs(wrapper);
    for (Object object : objects) {
        System.out.println("object = " + object);
    }

    /*for (ReaderInfo info : readerInfos) {
        System.out.println(info);
    }*/

}

5.5 分页插件【了解】

  • 配置一个bean
package com.qf.java2108.demo04.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.plugins.pagination.optimize.JsqlParserCountOptimize;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author ghy
 * @version 1.0
 * @date 2022-03-11
 **/
@Configuration
public class MybatisPlusConfig {

    @Bean
    public PaginationInterceptor paginationInterceptor(){
        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
        // 设置请求的页面大于最大页后操作, true调回到首页,false 继续请求  默认false
        paginationInterceptor.setOverflow(true);
        // 设置最大单页限制数量,默认 50 条,-1 不受限制
        paginationInterceptor.setLimit(50);
        // 开启 count 的 join 优化,只针对部分 left join
        paginationInterceptor.setCountSqlParser(new JsqlParserCountOptimize());
        return paginationInterceptor;
    }

}

  • selectPage(IPage, QueryWrapper)
@Test
public void mybatisPlusPaginationTest() throws Exception {
    IPage<ReaderInfo> page = new Page<>();
    page.setCurrent(1);
    page.setSize(1);
    IPage<ReaderInfo> ipage = readerInfoMapper.selectPage(page, null);
    System.out.println(ipage);
}

mybatis-plus的分页插件跟pagehepler没有冲突的,建议使用原生的

6.在Service层实现增强

  • 通过县相关配置,可以极大简化代码,实现在Service层的业务逻辑增强

  • Mapper层

    public interface StudentMapper extends BaseMapper<TbStudent> {
    
        List<TbStudent> findAll();
    }
    
  • Service接口层

    import com.baomidou.mybatisplus.extension.service.IService;
    public interface StudentService extends IService<TbStudent> {
    
    }
    
  • ServiceImpl层

    import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
    
    //实现类要继承 ServiceImpl<对应的mapper,实体类对象> 实现接口
    @Service
    public class StudentServiceImpl extends ServiceImpl<StudentMapper,TbStudent> implements StudentService{
    }
    
  • 测试

    	@Test
        public void findAll(){
            List<TbStudent> list = studentService.list();
            System.out.println(list);
        }
    

7、自定义Mapper

  • 跟原生Mybatis开发接口没有任何区别,但是注意不要使用BaseMapper接口中的方法名
  • 可以在实体类中使用注解实现实体与数据库自定义映射(意味着不需要在xml映射文件中使用标签@ResultMap实现自定义映射了)
#日志打印
mybatis-plus:
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
    #配置别名
  type-aliases-package: com.qf.pojo
  #扫描xml sql文件
  mapper-locations: classpath:mapper/*Mapper.xml

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

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

相关文章

《从总账到总监》读书笔记

书本封面 内容简介 这是一本用小说体例写作的财务专业书籍。工作中如何将财物数据业务化&#xff0c;找到绩效管理的关键点&#xff1f;在人工智能都会写诗的时代&#xff0c;财务这门学科是否会毫无价值&#xff1f;以及在未来&#xff0c;财务人员应该具备哪些专项能力才能不…

Java#34(多线程)

目录 线程(thread): 是一个程序内部的一条执行路经(之前写的代码中,main方法的执行就是一条单独的执行路径) 单线程: 一个程序只有一条执行路线 多线程: 指从软硬件上实现多条执行流程的技术 一.创建多线程 1.继承Thread类 2.实现Runnable接口 3.利用Callable, FutureT…

8 标志寄存器

标志寄存器 CPU 内部的寄存器中&#xff0c;有一种特殊的寄存器&#xff08;对于不同的处理机&#xff0c;个数和结构都可能不同&#xff09;具有以下3 种作用。 用来存储相关指令的某些执行结果&#xff1b;用来为CPU 执行相关指令提供行为依据&#xff1a;用来控制CPU 的相…

Pyinstaller打包exe程序

Pyinstaller和Nuitka是两大热门的python打包路径&#xff0c;学习Nuitka可以点击Nuitka入门学习。本文主要介绍Pyinstaller打包过程。 1.创建python虚拟环境 在conda中创建一个虚拟环境&#xff0c;用于程序打包&#xff0c;可以使打包程序占用空间最小 使用一下指令&#x…

一个超方便将现有博客生成vuepress2文档站的插件

闲来无事&#xff0c;研究了一下vuepress2和它的插件机制&#xff0c;写了一个可以一键通过已有博客生成vuepress2的文档站的vuepress2插件vuepress-plugin-blog-sync 效果 在vuepress2中简单引入即可达到将政采云掘金博客一键生成vuepress2页面&#xff0c;效果✨ 详见Demo …

38_SPI通信原理

SPI接口简介 SPI是英语Serial Peripheral interface的缩写,顾名思义就是串行外围设备接口。是Motorola首先在其MC68HCXX系列处理器上定义的。 SPI,是一种高递的,全双工,同步的通信总线,并且在芯片的管脚上只占用四根线,节约了芯片的管脚,同时为PCB的布局上节省空间,提供方便,…

蔚来智驾功能大更新:与其叫NOP+,不如叫NAD-

HiEV消息&#xff08;文/张祥威&#xff09;赶在2022年最后一个月&#xff0c;蔚来的自动驾驶大招露出了冰山一角。 2020年10月&#xff0c;蔚来国内首家推送高速场景下的领航辅助NOP&#xff08;Navigate on Pilot&#xff09;&#xff0c;当时只有特斯拉实现了类似功能&#…

English Learning - L1 站在高处建立灵魂 2022.12.5 周一

English Learning - L1 站在高处建立灵魂 2022.12.5 周一1.1 到底什么是语法1.2 为什么要学习语法口语分广义和狭义讲母语的人为啥不学语法&#xff1f;作为一名二语习得者口语中可不可以没有有语法&#xff1f;1.3 英语&#xff08;听说读写&#xff09;的核心金字塔理论关于词…

[附源码]计算机毕业设计基于web的羽毛球管理系统Springboot程序

项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM mybatis Maven Vue 等等组成&#xff0c;B/S模式 M…

数据结构作业——第十四周——AOE网+查找

1. 单选题 简单 5分 若一个有向图中的顶点不能排成一个拓扑序列&#xff0c;则可断定该有向图______。 A.是个有根有向图 B.是个强连通图 C.含有多个入度为0的顶点 D.含有顶点数目大于1的强连通分量 回答正确 解析 2 . 单选题 简单 5分 以下关于图拓扑排序的叙述中正确的…

自动驾驶之去光晕调研

中文版综述github 一、光晕类型 常见去光晕算法的光晕 去光晕算法的光晕之二(汇总) 样式包括有: halos(色圈), streaks(条纹), bright lines(亮线), saturated blobs(深污点), color bleeding(色渗), haze(烟雾), and many others。 二、光晕成因 一个理想的相机&#x…

JSP SSH校园兼职信息发布平台myeclipse开发mysql数据库MVC模式java编程计算机网页设计

一、源码特点 JSP SSH校园兼职信息发布平台是一套完善的web设计系统&#xff08;系统采用ssh框架进行设计开发&#xff09;&#xff0c;对理解JSP java编程开发语言有帮助&#xff0c;系统具有完整的源代码和数据库&#xff0c;系统主要采 用B/S模式开发。开发环境为TOMCA…

Docker Images Explore

Docker Images Explore scratch an explicitly empty image, especially for building images “FROM scratch” You can use Docker’s reserved, minimal image, scratch, as a starting point for building containers. Using the scratch “image” signals to the build …

自定义键盘快捷键调节电脑音量

外接的键盘没有Fn。。。也没有调音量的键&#x1f605;于是想自己弄一个 方法一&#xff1a;修改注册表键盘映射 新建记事本文件打开&#xff0c;粘贴如下内容&#xff1a; Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Key…

Idea 调试自定义 AbstractProcessor 程序

我们常使用的 Lombok 可以自动生成 gettr 和 setter 方法,使用起来非常方便;有时候我们也要去实现自己的注解处理器,实现一些在编译阶段需要执行的逻辑,例如我之前写的 spring cloud 自动生成 openfeign 的Fallback 降级方法;自动生成 openfeign 的Fallback 但是自定义注…

JavaEE进阶:SpringBoot概念、创建和运⾏

文章目录一、Spring Boot 优点二、Spring Boot 项⽬创建1、使用 Idea 创建① 准备工作② 创建项目③ 注意事项2、网页版创建&#xff08;了解&#xff09;三、项目目录介绍和运行1、运行项目2、输出 Hello world四、注意事项&#xff1a;包路径错误1、正确路径2、小结&#xff…

第十四届蓝桥杯集训——JavaC组第九篇——三元运算符

第十四届蓝桥杯集训——JavaC组第九篇——三元运算符 一元运算符(一元运算符有1个操作数) &#xff0c;- -都是运算符&#xff0c;- -可分为前&#xff0c;后&#xff0b;和前-&#xff0c;后减如果在后面&#xff0c;如&#xff1a;num 10&#xff1b;先参与运算&#xff0c;然…

基于混合NSGA II-MOPSO算法的热电联合经济排放调度(Matlab代码实现)【混合多目标遗传算法-多目标粒子群算法】

&#x1f4a5;&#x1f4a5;&#x1f4a5;&#x1f49e;&#x1f49e;&#x1f49e;欢迎来到本博客❤️❤️❤️&#x1f4a5;&#x1f4a5;&#x1f4a5; &#x1f680;支持&#xff1a;&#x1f381;&#x1f381;&#x1f381;如果觉得博主的文章还不错或者您用得到的话&…

游戏开发43课 移动游戏性能优化1

1. 前言 很多年前就想将这些年工作中积累的优化经验撰写成文章&#xff0c;但懒癌缠身&#xff0c;迟迟未动手&#xff0c;近期总算潜下心写成文章。 涉及到具体优化技巧时&#xff0c;博主会尽量阐述原理和依据&#xff0c;让读者知其然也知其所以然。要完全读懂这篇文章&am…

尚医通MyBatis-Plus入门、添加、主键策略(二)

目录&#xff1a; &#xff08;1&#xff09;MyBatis-Plus入门案例 &#xff08;2&#xff09;MyBatis-Plus-添加和主键生成策略 &#xff08;1&#xff09;MyBatis-Plus入门案例 简介&#xff1a; MyBatis-Plus&#xff08;简称 MP&#xff09;是一个 MyBatis 的增强工具&a…