mybatis-plus学习记录(详细)

SpringBoot Mybatis-Plus 学习记录 SpringBoot Mybatis-Plus 学习记录 SpringBoot有多火,是有目共睹的,约定优于配置。不用写那么多配置,确实是爽多了。 Mybatis,半自动ORM框架,可以方便的自定义sql语句。但是要写的sql语句其实也挺多了(虽然有通用mapper),Mybatis-plus就为此诞生了,在Mybatis基础上加强并进一步封装有用的功能。 Mybatis-Plus文档 ... 阅读详情

mybatis-plus

官网:https://mp.baomidou.com/guide/

国产的开源框架,基于MyBatis

核心功能就是简化 MyBatis 的开发,提高效率。

MyBatis Plus 快速上手

Spring Boot(2.3.0) + MyBatis Plus(国产的开源框架,并没有接入到 Spring 官方孵化器中)

在这里插入图片描述

2、pom.xml 引入 MyBatis Plus 的依赖

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

3、创建实体类

package com.monkey.mybatisplus.entity;

import lombok.Data;

@Data
public class User {
    private Integer id;
    private String name;
    private Integer age;
}

4、创建 Mapper 接口

package com.monkey.mybatisplus;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.monkey.mybatisplus.entity.User;

public interface UserMapper extends BaseMapper<User>{
}

5、application.yml

spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
    username: root
    password: 123456
mybatis-plus:
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl   //打印sql日志

6、启动类需要添加 @MapperScan(“mapper所在的包”),否则无法加载 Mppaer bean。

@SpringBootApplication
@MapperScan("com.monkey.mybatisplus.mapper")
public class MybatisplusApplication {

    public static void main(String[] args) {
        SpringApplication.run(MybatisplusApplication.class, args);
    }

}

7、测试

package com.monkey.mybatisplus;

import com.monkey.mybatisplus.mapper.UserMapper;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
class UserMapperTest {

    @Autowired
    private UserMapper userMapper;

    @Test
    void test(){
        userMapper.selectList(null).forEach(System.out::println);
    }

}

常用注解

@TableName

映射数据库的表名(如果实体类名和数据库表名不一致)

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

@Data
@TableName(value = "user")
public class Account {
    private Integer id;
    private String name;
    private Integer age;
}

@TableId

设置主键映射,value 映射主键字段名

import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

@Data
public class User {
    @TableId(value = "id")
    private Integer num;
    private String name;
    private Integer age;
}

type 设置主键类型,主键的生成策略

@Data
public class User {
    @TableId(type = IdType.AUTO)
    private Long id;
    @TableField(value = "name")
    private String title;
    private Integer age;
}
AUTO(0),
NONE(1),
INPUT(2),
ASSIGN_ID(3),
ASSIGN_UUID(4),
/** @deprecated */
@Deprecated
ID_WORKER(3),
/** @deprecated */
@Deprecated
ID_WORKER_STR(3),
/** @deprecated */
@Deprecated
UUID(4);
值描述
AUTO数据库自增
NONEMP set 主键,雪花算法实现(默认)
INPUT需要开发者手动赋值
ASSIGN_IDMP 分配 ID,Long、Integer、String
ASSIGN_UUID分配 UUID,Strinig

INPUT 如果开发者没有手动赋值,则数据库通过自增的方式给主键赋值,如果开发者手动赋值,则存入该值。

AUTO 默认就是数据库自增,开发者无需赋值。

ASSIGN_ID MP 自动赋值,雪花算法。

ASSIGN_UUID 主键的数据类型必须是 String,自动生成 UUID 进行赋值。

@TableField

映射非主键字段,value 映射字段名

exist 表示是否为数据库字段 false,如果实体类中的成员变量在数据库中没有对应的字段,则可以使用 exist,在VO、DTO用得较多。

@Data
public class User {
    @TableId(type = IdType.AUTO)
    private Long id;
    @TableField(value = "name")
    private String title;
    private Integer age;
    @TableField(exist = false)
    private String gender;
}

select 表示是否查询该字段

@Data
public class User {
    @TableId(type = IdType.AUTO)
    private Long id;
    @TableField(value = "name",select = false)
    private String title;
    private Integer age;
    @TableField(exist = false)
    private String gender;
}

fill 表示是否自动填充,将对象存入数据库的时候,由 MyBatis Plus 自动给某些字段赋值,create_time、update_time

1、给表添加 create_time、update_time 字段

2、实体类中添加成员变量

package com.monkey.mybatisplus.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import java.util.Date;

@Data
public class User {
    @TableId(type = IdType.AUTO)
    private Long id;
    @TableField(value = "name",select = false)
    private String title;
    private Integer age;
    @TableField(exist = false)
    private String gender;
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
//    private Product product;
}

3、创建自动填充处理器(自动填充时间-接上INSERT INSERT_UPDATE)

package com.monkey.mybatisplus.handler;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class MyMetaObjectHandler implements MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
        this.setFieldValByName("createTime",new Date(),metaObject);
        this.setFieldValByName("updateTime",new Date(),metaObject);
    }

    @Override
    public void updateFill(MetaObject metaObject) {
        this.setFieldValByName("updateTime",new Date(),metaObject);
    }
}

@Version

标记乐观锁,通过 version 字段来保证数据的安全性,当修改数据的时候,会以 version 作为条件,当条件成立的时候才会修改成功。

version = 2

线程 1:update … set version = 2 where version = 1

线程2 :update … set version = 2 where version = 1

1、数据库表添加 version 字段,默认值为 1

2、实体类添加 version 成员变量,并且添加 @Version

package com.monkey.mybatisplus.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.util.Date;

@Data
public class User {
    @TableId(type = IdType.AUTO)
    private Long id;
    @TableField(value = "name",select = false)
    private String title;
    private Integer age;
    @TableField(exist = false)
    private String gender;
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    @Version  //乐观锁
    private Integer version;

//    private Product product;
}

3、注册配置类(让乐观锁生效)

package com.monkey.mybatisplus.config;

import com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyBatisPlusConfig {

    @Bean
    public OptimisticLockerInterceptor optimisticLockerInterceptor(){
        return new OptimisticLockerInterceptor();
    }
}

测试:

package com.monkey.mybatisplus;

import com.monkey.mybatisplus.mapper.UserMapper;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
class UserMapperTest {

    @Autowired
    private UserMapper userMapper;

    @Test
    void test(){
        userMapper.selectList(null).forEach(System.out::println);
    }
    
    @Test
    void update(){
    	// update ... version = 3 where version = 2
    	User user = mapper.selectById(7);
    	user.setTitle("一号");
		
		// update ... version = 3 where version = 2
    	User user = mapper.selectById(7);
    	user.setTitle("二号");
		
		mapper.updateById(user1); //乐观锁保证修改只执行一次
		mapper.updateById(user);
    }

}

@EnumValue

1、通用枚举类注解,将数据库字段映射成实体类的枚举类型成员变量

package com.monkey.mybatisplus.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;

public enum StatusEbum {
    WORK(1,"上班"),
    REST(0,"休息");

    StatusEbum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @EnumValue
    private Integer code;
    private String msg;
}
package com.monkey.mybatisplus.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.monkey.mybatisplus.enums.StatusEbum;
import lombok.Data;

import java.util.Date;

@Data
public class User {
    @TableId(type = IdType.AUTO)
    private Long id;
    @TableField(value = "name",select = false)
    private String title;
    private Integer age;
    @TableField(exist = false)
    private String gender;
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    @Version
    private Integer version;
    private StatusEbum status;

//    private Product product;
}

application.yml

mybatis-plus:
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl   //打印sql日志
  type-enums-package: 
  	com.monkey.mybatisplus.enums  //扫描枚举的包

2、实现接口方式

package com.monkey.mybatisplus.enums;


import com.baomidou.mybatisplus.core.enums.IEnum;

public enum AgeEnum implements IEnum<Integer> {
    ONE(1,"一岁"),
    TWO(2,"两岁"),
    THREE(3,"三岁");

    private Integer code;
    private String msg;

    AgeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public Integer getValue() {
        return this.code;
    }
}

@TableLogic

映射逻辑删除(假删除)

1、数据表添加 deleted 字段

2、实体类添加注解

package com.monkey.mybatisplus.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.monkey.mybatisplus.enums.AgeEnum;
import com.monkey.mybatisplus.enums.StatusEbum;
import lombok.Data;

import java.util.Date;

@Data
public class User {
    @TableId(type = IdType.AUTO)
    private Long id;
    @TableField(value = "name",select = false)
    private String title;
//    private AgeEnum age;
    private Integer age;
    @TableField(exist = false)
    private String gender;
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    @Version
    private Integer version;
    private StatusEbum status;
    @TableLogic
    private Integer deleted;

//    private Product product;
}

3、application.yml 添加配置

	global-config:
	    db-config:
	      logic-not-delete-value: 0
	      logic-delete-value: 1
查询
    @Test
    void select(){
        //不加任何条件直接全部查询
//        userMapper.selectList(null);

        QueryWrapper wrapper = new QueryWrapper();
//        wrapper.eq("name","梅西2");

//        Map<String,Object> map = new HashMap<>();
//        map.put("name","梅西2");
//        map.put("age",18);
//        wrapper.allEq(map);

//        wrapper.lt("age",6);//小于
//        wrapper.gt("age",6);//大于
//        wrapper.ne("name","梅西2");//不等于
//        wrapper.ge("age",5);//大于等于

//        wrapper.like("name","西");//模糊查询
        //like '%西'
//        wrapper.likeLeft("name","西");//模糊查询
        //like '西%'
//        wrapper.likeRight("name","西");//模糊查询

        //inSQL联合查询
//        wrapper.inSql("id","select id from user where id < 10");
//        wrapper.inSql("age","select age from user where age > 3");

//        wrapper.orderByDesc("age");
        wrapper.orderByAsc("age");
        wrapper.having("id > 8");

        System.out.println(userMapper.selectList(wrapper));
}
    @Test
    void select2(){
//        System.out.println(userMapper.selectById(1));
//        userMapper.selectBatchIds(Arrays.asList(1,2,3).forEach(System.out::println););

        //Map 只能做等值判断,逻辑判断需要使用 Wrapper 来处理
//        Map<String,Object> map = new HashMap<>();
//        map.put("id",1);
//        userMapper.selectByMap(map);

//        QueryWrapper wrapper = new QueryWrapper();
//        wrapper.gt("id",1);
//        System.out.println(userMapper.selectCount(wrapper));
        //下面将查询的结果集封装到Map中
//        userMapper.selectMaps(wrapper).forEach(System.out::println);
//        userMapper.selectList(wrapper).forEach(System.out::println);

        //分页
//        Page<User> page = new Page<>(1,5);
//        Page<User> result = userMapper.selectPage(page, null);
//        System.out.println(result.getSize());
//        System.out.println(result.getTotal());
//        System.out.println(result.getRecords().forEach(System.out::println););

        //将结果封装到Map中
//        Page<Map<String,Object>> page = new Page<>(1,2); //第一页,每一页两条记录
//        userMapper.selectMapsPage(page,null).getRecords().forEach(System.out::println);

        //返回ids
//        userMapper.selectObjs(null).forEach(System.out::println);

        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("id",1);
        System.out.println(userMapper.selectOne(wrapper));
    }

自定义 SQL(多表关联查询)

package com.monkey.mybatisplus.vo;

import lombok.Data;

@Data
public class ProductVo {
    private Integer category;
    private Integer count;
    private String description;
    private Integer userId;
    private String userName;
}
package com.monkey.mybatisplus.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.monkey.mybatisplus.entity.User;
import com.monkey.mybatisplus.vo.ProductVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper extends BaseMapper<User>{
    @Select("select p.*,u.name userName from product p,user u where p.user_id = u.id and u.id = #{id}")
    List<ProductVo> productList(Integer id);
}
@Test
void product(){
  userMapper.productList(1).forEach(System.out::println);
}
添加
@Test
void save(){
    User u = new User();
    u.setTitle("孙悟空");
    u.setAge(18);
    userMapper.insert(u);
    System.out.println(u);
}
删除
@Test
void delete(){
//        userMapper.deleteById(1);
//        userMapper.deleteBatchIds(Arrays.asList(1,2));

//        QueryWrapper wrapper = new QueryWrapper();
//        wrapper.eq("age",14);
//        userMapper.delete(wrapper);

    Map<String,Object> map = new HashMap<>();
    map.put("id",10);
    userMapper.deleteByMap(map);
}
修改
@Test
void update(){
//        User user = userMapper.selectById(1);
//        user.setTitle("梅西2");
//        userMapper.updateById(user);

//        //update ... version = 3 where version = 2
//        User user = mapper.selectById(1);
//        user.setTitle("一号");
//
//        //update ... version = 3 where version = 2
//        User user1 = mapper.selectById(1);
//        user1.setTitle("二号");
//
//        userMapper.updateById(user1);
//        userMapper.updateById(user);

    User user = userMapper.selectById(1);
    user.setTitle("小红");
    QueryWrapper wrapper = new QueryWrapper();
    wrapper.eq("age",18);
    userMapper.update(user,wrapper);

}
MyBatisPlus自动生成

根据数据表自动生成实体类、Mapper、Service、ServiceImpl、Controller。

1、pom.xml 导入 MyBatis Plus Generator

<dependency>
    <groupId>com.baomidou</groupId>
    <artifactId>mybatis-plus-generator</artifactId>
    <version>3.3.1.tmp</version>
</dependency>

<dependency>
    <groupId>org.apache.velocity</groupId>
    <artifactId>velocity</artifactId>
    <version>1.7</version>
</dependency>

Velocity(默认)、Freemarker、Beetl

2、启动类

package com.monkey.mybatisplus;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
import com.baomidou.mybatisplus.generator.config.GlobalConfig;
import com.baomidou.mybatisplus.generator.config.PackageConfig;
import com.baomidou.mybatisplus.generator.config.StrategyConfig;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;

public class Generator {
    public static void main(String[] args) {
        //创建generator对象
        AutoGenerator autoGenerator = new AutoGenerator();
        //数据源
        DataSourceConfig dataSourceConfig = new DataSourceConfig();
        dataSourceConfig.setDbType(DbType.MYSQL);
        dataSourceConfig.setUrl("jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai");
        dataSourceConfig.setUsername("root");
        dataSourceConfig.setPassword("123456");
        dataSourceConfig.setDriverName("com.mysql.cj.jdbc.Driver");
        autoGenerator.setDataSource(dataSourceConfig);

        //全局配置
        GlobalConfig globalConfig = new GlobalConfig();
        globalConfig.setOutputDir(System.getProperty("user.dir")+"/src/main/java");
        globalConfig.setOpen(false); //创建好之后不打开文件夹
        globalConfig.setAuthor("hhhmonkey");
        globalConfig.setServiceName("%sService");  //去掉Impl前面的I
        autoGenerator.setGlobalConfig(globalConfig); 

        //包信息
        PackageConfig packageConfig = new PackageConfig();
        packageConfig.setParent("com.monkey.mybatisplus");
        packageConfig.setModuleName("your");
        packageConfig.setController("controller");
        packageConfig.setService("service");
        packageConfig.setServiceImpl("service.impl");
        packageConfig.setMapper("mapper");
        packageConfig.setEntity("entity");
        autoGenerator.setPackageInfo(packageConfig);

        //配置策略
        StrategyConfig strategyConfig = new StrategyConfig();
//        strategyConfig.setInclude("user","product"); //默认生成所有表,这里设置只生成部分表
        strategyConfig.setInclude("user");
        strategyConfig.setEntityLombokModel(true); //自动添lombok注解
        strategyConfig.setNaming(NamingStrategy.underline_to_camel);
        strategyConfig.setColumnNaming(NamingStrategy.underline_to_camel); //驼峰命名
        autoGenerator.setStrategy(strategyConfig);

        autoGenerator.execute();
    }
}

运行Generator的main方法,可得到自动生成的代码结构如下图所示:

在这里插入图片描述

在UserController中写一个接口测试:

package com.monkey.mybatisplus.your.controller;


import com.monkey.mybatisplus.your.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.servlet.ModelAndView;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hhhmonkey
 * @since 2020-08-19
 */
@Controller
@RequestMapping("/your/user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/index")
    public ModelAndView index(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("index");
        modelAndView.addObject("list",userService.list());
        return modelAndView;
    }

}

application.yml:

 thymeleaf:
    prefix: classpath:/templates/
    suffix: .html

index.html:

<!DOCTYPE html>
<html lang="en">
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <table>
        <tr th:each="user:${list}">
            <td th:text="${user.id}"></td>
            <td th:text="${user.name}"></td>
            <td th:text="${user.age}"></td>
        </tr>
    </table>

</body>
</html>

运行Spring boot应用:

在浏览器查看结果:

在这里插入图片描述

Spring Boot +MyBatis Plus 打包,发布阿里云

参见楠哥视频

本文是在视频学习过程中边学习边敲的,如有错误欢迎指正,阿里云部分可去学习B站楠哥教学视频,这里也顺便帮楠哥宣传一下,讲课辛苦了,感谢楠哥。

获取代码地址见下GitHub链接

(可参照代码看本篇文章,然后自己动手写,加油!)

github : https://github.com/monkeyhlj/spring-study

脑电分析:为什么大脑信号会“变同步”?——事件相关同步化与去同步化 (ERS/ERD) 全景解析 脑电分析中的事件相关同步化(ERS)和去同步化(ERD)是研究大脑动态节律的重要方法,反映特定任务下脑电频段能量的变化。ERD表示神经元活动分散(功率下降),提示脑区活跃处理信息;ERS则反映神经元同步(功率增强),常与静息状态相关。本文详解了ERS/ERD的生理机制、计算流程(包括基线校正和功率谱分析),并提供了Python实现示例,展示如何通过Welch法和STFT进行时频分析,生成ERD/ERS热力图。该技术广泛应用于运动想象脑机接口、癫痫检测等领域,为理解大脑功能状态提供了量化工具。 阅读详情

相关推荐

OpenSpec 从入门到精通:AI 时代的最佳 SDD 范式

同样都是「先写规范再写代码」的开源 SDD 框架,OpenSpec(https://github.com/fission-ai/openspec) 展现出了极高的工程性价比,无论是使用 Claude Code、Cursor 还是 Aider,都可以无缝接入 OpenSpec 的规格管理层。这些问题需要人来做判断,AI 做不了这个主。整个流程跑下来,OpenSpec 产出的效果还是令人满意的,一些前期没有考虑到的细节 AI 都补上了,生成的相关文档也有利于开发人员的知识对齐,可以尝试在团队内部推广。

qq_39093474的博客 932

Mybatis-plus常用注解

Mybatis-plus常用注解 @TableName:映射数据库表名 在你创建的实体类类名与数据库表明不同时可以用@TableName(value = “数据库表名”) package com.bzhan.mybatisplus.entity; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; @Data @TableName(value = "user") public class Account { p

weixin_43910407的博客 2186

MyBatisPlus学习(4)—— 设置实体类

设置实体类

Archer__13的博客 4456

树莓派与stm32通信超详细解答过程

笔者之前发过关于stm32与openmv通信的教程,在学习了几天opencv后,想实现树莓派4B与stm32进行通信。于是上网查询资料,最后实现了两者之间的通信,相信这对大多数电赛人都很有帮助,opencv的识别效果是远高于openmv以及K210的。在此我参考了以下资料辅助我学习,大家可以参考。基于树莓派4B与STM32的UART串口通信实验(代码开源)_树莓派4b串口波特率-优快云博客。

Halcyon0804的博客 5465

基于 YOLOv26 的食品包装缺陷检测系统:智能视觉质检方案

本文提出了一种基于YOLOv26深度学习的食品包装缺陷智能检测系统。该系统能够自动识别多种常见包装缺陷,包括密封不良、破损、污染、标签错误等8类问题。相比传统人工检测方法,该系统具有高精度、多类别分类、实时推理等优势。文章详细介绍了系统架构,包含数据采集、预处理、YOLOv26检测模型和后处理四个核心模块,并提供了完整的环境配置和数据处理代码实现。该系统为食品包装行业提供了一种高效、准确的智能视觉质检解决方案。

一键难忘的博客 685

mybatis-plus的@TableId

package com.zjh.myabatiesplus.pojo; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.AllArgsConstructor; import lombok.Data; impor...

weixin_46564011的博客 1042

2026.1.9:最新VSCode集成claude插件完美解决方案,跳过登录界面,使用国内Kimi K2进行计费

本文介绍了如何安装配置Claude插件并连接Kimi K2 API的详细步骤:1)搜索安装Claude插件;2)进入设置关闭登录提示;3)在settings.json中添加API配置,包括ANTHROPIC_AUTH_TOKEN(需替换为Kimi API Key)和ANTHROPIC_BASE_URL;4)通过Kimi官网获取API Key。完成配置后即可正常使用该插件。文中配有完整的操作截图指引。

拥抱具身智能,昇腾Ascend C 8724

mybatisPlus中@TableName注解不生效

@TableName不生效

天马行空的博客 6470

go实现MQTT broker(附完整源码)

go实现MQTT broker(附完整源码)

希望我的博客,能帮上你解决学习中工作中所遇到的问题 577

【即插即用模块】卷积篇 | TCSVT 2025 | MFACB:多尺度膨胀融合,快速扩大感受野,多尺度特征精准捕捉!

本文提出了一种新型多尺度融合膨胀卷积模块MFACB,用于增强语义分割任务中的特征表达能力。该模块通过三分支串联膨胀卷积结构快速扩大感受野,采用双路径融合机制(基础信息路径+多尺度信息路径)实现高效上下文聚合。相比传统卷积块,MFACB在保持轻量化的同时显著提升了多尺度特征捕捉能力,实验表明其性能优于基础残差块。该模块支持自定义膨胀率和步长调整,可灵活嵌入不同网络阶段,适用于需要特征增强的视觉任务。

主要更新底层视觉(去噪、超分等)相关的科研内容,形式为【论文精读】+【论文复现】 311

Spring Boot整合Mybatis-Plus快速入门(二)

Mybatis-Plus常用注解说明 一、@TableName注解 /*描述:用来将实体对象与数据库表名完成映射 修饰范围:用在类上 常见属性: value:String类型,指定映射的表名 resultMap:String类型,用来指定XML配置中resultMap的id值*/ package com.cheny.pojo; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsC.

Cd_Air的博客 749

基于YOLOv8/YOLOv7/YOLOv6/YOLOv5的体育赛事目标检测系统(Python+PySide6界面+训练代码)

本文详细介绍了一个基于YOLOv5/v6/v7/v8的体育赛事目标检测系统的设计与实现。系统采用先进的深度学习算法,结合PySide6图形界面,实现了对体育赛事中运动员、球类、裁判等多种目标的实时检测与跟踪。本文将全面阐述系统的架构设计、算法原理、训练流程、界面实现以及实际应用效果,并提供完整的代码实现。

YOLO 509

MyBatis-Plus 安装与学习记录及总结

安装过程学习过程基础知识配置与依赖实体类与Mapper条件构造器常见问题解决总结附图MyBatis-Plus是一个功能强大的MyBatis增强工具,提供了许多便捷的特性和工具,极大地简化了数据库操作的开发。通过本次学习,我掌握了MyBatis-Plus的基本配置、实体类与Mapper的创建、条件构造器的使用以及常见问题的解决方法。MyBatis-Plus的优势在于其依赖少、损耗小、支持多种数据库以及提供了强大的CRUD操作和条件构造器。

2403_88307691的博客 661

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

【Mybatis plus】学习记录

本文主要记录了Mybatis Plus的学习笔记,包括其特性、引入方式、基本使用和核心功能。Mybatis Plus作为Mybatis的增强工具,具有无侵入、损耗小、内置代码生成器等优点。文章详细介绍了如何通过继承BaseMapper快速实现单表CRUD操作,以及如何自定义复杂SQL查询。还讲解了ServiceImpl实现类的使用方式、常用注解(如@TableName、@TableId等)以及Wrapper条件构造器。此外,文中还涉及雪花算法原理和代码生成器的配置方法,为开发者提供了高效的ORM解决方案。

m0_58239800的博客 1020

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

MyBatis Plus学习记录

MyBatis-Plushttps://baomidou.com/ 入门案例: (1)首先创建数据库 (2)创建user表 DROP TABLE IF EXISTS user; CREATE TABLE user ( id BIGINT(20) NOT NULL COMMENT '主键ID', name VARCHAR(30) NULL DEFAULT NULL COMMENT '姓名', age INT(11) NULL DEFAULT NULL COMMENT '年龄', email VA

friggly的博客 2368

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

MyBatis-Plus学习记录

MyBatis-Plus(MP)是一个MyBatis的增强工具,在MyBatis的基础上做增强,简化开发。支持MySQL,Oracle等大部分数据库。自动生成单表的CRUD功能提供丰富的条件拼接方法全自动ORM类型持久层框架(全自动orm思维持久层框架如hibernate,只需要把数据库数据和java实体类映射(配置),它就能提供crud方法,而且会自动生成对应的sql语句。MyBatis-Plus的功能仅限于单表操作,多表操作还是自己写SQL比较好。

abcd661054026的博客 1356

MyBatis - Plus 安装与学习记录

MyBatis - Plus 是一个 MyBatis 的增强工具,在 MyBatis 的基础上只做增强不做改变,为简化开发、提高效率而生。它提供了诸如通用 CRUD 操作、条件构造器、代码生成器等强大功能。

xxxi12的博客 1378

mybatis plus的学习记录

1、与Mybatis的区别 在Mybatis中,需要在mapper接口中手动写CRUD方法(创建,查询,更新,删除); 而在Mybatis plus中只需要创建mapper接口,继承BaseMapper接口,就可以完成CRUD操作,甚至不用创建SQL映射文件。 public interface UserMapper extends BaseMapper<User>{ //User是指实体类里面的类名 } 2、 ...

weixin_44019720的博客 181

MyBatis-Plus【学习记录】

MyBatis-Plus的学习记录

m0_59901835的博客 392

Mybatis-plus学习记录

1.新建spring-boot项目引入相关依赖 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.ap

yaoxie1534的博客 1006

SpringBoot、MyBatis 和 MyBatis-Plus 学习记录

刚接触这几个框架时,我对它们的区分比较模糊,大概只知道 SpringBoot 用来搭项目,MyBatis 用来操作数据库,MyBatis-Plus 可以少写一些 SQL。写过一些接口后,再回头看这三个框架,分工其实比较明确:SpringBoot 负责项目启动、配置和组件管理;MyBatis 负责执行 SQL,以及 Java 对象和数据库记录之间的映射;MyBatis-Plus 在 MyBatis 上增加了通用 CRUD、条件构造器和分页等功能。本文使用的示例比较独立,不以某个完整项目为主。

2401_83011856的博客 265

《MyBatis-Plus 学习安装记录》

通过本次学习和安装 MyBatis-Plus,我深刻体会到了它的强大功能和便捷性。MP 大大简化了 MyBatis 的开发过程,提高了开发效率。在学习过程中,我遇到了一些问题,但通过查阅资料和分析错误信息,都得到了很好的解决。这也让我更加熟悉了 Maven 项目的构建和 Spring Boot 的开发。在今后的项目中,我会继续使用 MyBatis-Plus,发挥它的优势,提高项目的质量和开发效率。

galagaoshou的博客 506

Mybatis-plus之案例教程学习记录

文章目录一、Mybaits-plus简介二、特性MyBatisPlus入门案列一、创建并初始化数据库1、创建数据库:2、创建 User 表二、初始化工程三、添加依赖1、引入依赖2、idea中安装lombok插件四、配置五、编写代码1、主类2、实体3、mapper六、开始使用七、配置日志 一、Mybaits-plus简介 官网:http://mp.baomidou.com/ 参考教程:http://mp.baomidou.com/guide/ MyBatis-Plus(简称 MP)是一个 MyBatis 的增

Liugx的博客 1447

《MyBatis-Plus 学习与安装记录》

本文记录了 MyBatis-Plus 的学习与安装过程,包括资料准备、安装步骤(添加依赖、配置数据源、创建实体类与 Mapper 接口),阐述了遇到的依赖冲突和数据库连接失败问题及解决过程,最后总结了学习收获与体会,强调其对开发效率的提升及后续学习探索的方向。

QiXiangGuanHai的博客 742
上一篇: Github上传代码截图过程
下一篇: Shiro学习记录(详细)
monkeyhlj
博客等级 码龄9年 1万+粉丝 184原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值