MyBatis-Plus整合Spring Demo

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
RDS MySQL Serverless 高可用系列,价值2615元额度,1个月
简介: MyBatis-Plus整合Spring Demo

整合MyBatis和MP的不同


1.依赖不同


整合MyBatis的依赖


<!-- MyBatis -->
    <dependency>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis</artifactId>
      <version>3.4.1</version>
    </dependency>
    <!-- MyBatis-Spring -->
    <dependency>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis-spring</artifactId>
      <version>1.3.0</version>
    </dependency>


整合MP


  <dependency>
      <groupId>com.baomidou</groupId>
      <artifactId>mybatis-plus</artifactId>
      <version>2.3</version>
    </dependency>


2.SqlSession中的Bean的类型不同


MP中的class


<bean id="sqlSessionFactory"
    class="com.baomidou.mybatisplus.spring.MybatisSqlSessionFactoryBean">


MyBatis中的class


<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
    <property name="dataSource" ref="dataSource" />
    <!-- 配置MyBatis的配置的文件 -->
    <property name="configLocation" value="classpath:mybatis.xml"></property>
  </bean>


构建项目Spring+MyBatis-Plus


MP比MyBatis的优势就是省去了mapper.xml,那么问题来了,没有mapper.xml怎么有SQL和方法呢


这里就是MP给实现的,注意看下面的dao层,就是继承了一个接口BaseMapper<T>


项目结构


0.png


pom.mxl


<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.imooc</groupId>
  <artifactId>MyBatisPlus</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <dependencies>
    <dependency>
      <groupId>com.baomidou</groupId>
      <artifactId>mybatis-plus</artifactId>
      <version>2.3</version>
    </dependency>
    <!-- 单元测试 -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
    <!-- 日志 -->
    <!-- 实现slf4j接口并整合 -->
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>1.1.1</version>
    </dependency>
    <!-- 数据库 -->
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>5.1.39</version>
    </dependency>
    <!-- c3p0 -->
    <dependency>
      <groupId>com.mchange</groupId>
      <artifactId>c3p0</artifactId>
      <version>0.9.5.2</version>
    </dependency>
    <!-- Spring -->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
      <version>4.3.10.RELEASE</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
      <version>4.3.10.RELEASE</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-web</artifactId>
      <version>4.3.10.RELEASE</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jdbc</artifactId>
      <version>4.3.10.RELEASE</version>
    </dependency>
    <!-- MyBatis <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> 
      <version>3.4.1</version> </dependency> -->
    <!-- MyBatis-Spring <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> 
      <version>1.3.0</version> </dependency> -->
  </dependencies>
</project>


spring配置文件


<?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:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
  xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd">
  <!-- 配置自动扫描的包,使其自动注入到IOC容器 -->
  <context:component-scan base-package="com.imooc.service"></context:component-scan>
  <!-- 导入资源文件 -->
  <context:property-placeholder location="classpath:db.properties" />
  <!-- 配置数据源 -->
  <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
    <property name="user" value="${jdbc.user}"></property>
    <property name="password" value="${jdbc.password}"></property>
    <property name="driverClass" value="${jdbc.driverClass}"></property>
    <property name="jdbcUrl" value="${jdbc.jdbcUrl}"></property>
    <property name="initialPoolSize" value="${jdbc.initPoolSize}"></property>
    <property name="maxPoolSize" value="${jdbc.maxPoolSize}"></property>
  </bean>
  <!-- 配置MyBatis的SqlSession -->
  <bean id="sqlSessionFactory"
    class="com.baomidou.mybatisplus.spring.MybatisSqlSessionFactoryBean">
    <property name="dataSource" ref="dataSource" />
    <!-- 配置MyBatis的配置的文件 -->
    <property name="configLocation" value="classpath:mybatis.xml"></property>
    <!-- 别名处理 -->
    <!-- <property name="typeAliasesPackage" value="com.imooc.entity"></property> -->
    <!-- 注入MP的全局策略配置  -->
    <property name="globalConfig"  ref="globalConfiguration"></property>
    <!-- 插件注册 -->
    <property name="plugins">
       <list>
           <!-- 注册分页插件 -->
           <bean  class="com.baomidou.mybatisplus.plugins.PaginationInterceptor"></bean>
           <!-- 注册性能分析插件 -->
           <bean  class="com.baomidou.mybatisplus.plugins.PerformanceInterceptor">
               <property name="format" value="true"></property>
               <!-- <property name="maxTime" value="5"></property>   -->       
           </bean>
       </list>
    </property>
  </bean>
    <!-- MP的全局策略配置 -->
  <bean id="globalConfiguration" class="com.baomidou.mybatisplus.entity.GlobalConfiguration">
    <!-- 
    在2.3版本以后,dbColumnUnderline 默认值就是true 
    驼峰命名转换为下划线命名 user_name对应userName
     -->
    <property name="dbColumnUnderline" value="true"></property>
    <!--
     全局的主键策略
    省去了@TableId(value = "id", type = IdType.AUTO)为主键策略 
    -->
    <!-- <property name="idType" value="0"></property> -->
    <!-- 
    全局的表前缀策略配置 
    省略了@TableName("employee") ,如果你的表名为bt1_user
    -->
    <!-- <property name="tablePrefix" value="tbl_"></property> -->
  </bean>
  <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
    <!-- 自动扫描 com.imooc.dao下的interface,并加入IOC容器 -->
    <property name="basePackage" value="com.imooc.dao" />
    <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property>
  </bean>
  <!-- 开启事务 -->
  <bean id="transactionManager"
    class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    <property name="dataSource" ref="dataSource" />
  </bean>
  <!-- 可通过注解控制事务 -->
  <tx:annotation-driven transaction-manager="transactionManager" />
</beans>


MyBatis配置文件


<?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>
  <!-- 
  =====>设置别名: 将com.imooc.entity.User设置为User 
  如果不设置别名<select id="selectDemo" resultType="com.imooc.entity.User"> ***</select>
  设置别名            <select id="selectDemo" resultType="User">***</select>
   -->
  <typeAliases>
    <package name="com.imooc.entity"></package>
  </typeAliases>
</configuration>


数据库配置文件


jdbc.user=root
jdbc.password=123456
jdbc.driverClass=com.mysql.jdbc.Driver
jdbc.jdbcUrl=jdbc:mysql://localhost:3306/demo?useUnicode=true&characterEncoding=UTF-8
jdbc.initPoolSize=5
jdbc.maxPoolSize=10
#...


实体层


package com.imooc.entity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
/**
 * 
 * @TableName("employee") 如果你数据的表和实体类的名称不一样,那就用tableName注解
 * 
 *
 */
public class Employee {
  @TableId(value = "id", type = IdType.AUTO)//value是对应数据库字段的名称,type为主键策略
  private Integer id;
  //@TableField("emp_name")如果你的数据库字段和属性名称不匹配
  private String name;
  private String email;
  private Integer gender;
  private Integer age;
  public Integer getId() {
    return id;
  }
  public void setId(Integer id) {
    this.id = id;
  }
  public String getName() {
    return name;
  }
  public void setName(String name) {
    this.name = name;
  }
  public String getEmail() {
    return email;
  }
  public void setEmail(String email) {
    this.email = email;
  }
  public Integer getGender() {
    return gender;
  }
  public void setGender(Integer gender) {
    this.gender = gender;
  }
  public Integer getAge() {
    return age;
  }
  public void setAge(Integer age) {
    this.age = age;
  }
  public Employee(String name, String email, Integer gender, Integer age) {
    this.name = name;
    this.email = email;
    this.gender = gender;
    this.age = age;
  }
  public Employee() {
  }
  @Override
  public String toString() {
    return "Employee [id=" + id + ", name=" + name + ", email=" + email + ", gender=" + gender + ", age=" + age
        + "]";
  }
}


Dao层


注意:仅仅继承了BashMapper


package com.imooc.dao;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.imooc.entity.Employee;
/**
 * MyBatis-plus
 * @author lenovo
 *
 */
public interface EmployeeMapper extends BaseMapper<Employee>{
}


测试层


package com.imooc.main;
import java.sql.SQLException;
import javax.sql.DataSource;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class Main {
  public static void main(String[] args) throws SQLException {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
    System.out.println("----------------------");
    System.out.println(context);
    DataSource dataSource = (DataSource) context.getBean("dataSource");
    System.out.println(dataSource);
    System.out.println(dataSource.getConnection());
  }
}


Mapper中继承的BaseMapper的方法的使用


package com.imooc.main;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.baomidou.mybatisplus.plugins.Page;
import com.imooc.dao.EmployeeMapper;
import com.imooc.entity.Employee;
public class EmployeeMapperTest {
  private ClassPathXmlApplicationContext context = null;
  private EmployeeMapper employeeDao = null;
  // private UserMapper userDao=null;
  @Before
  public void before() {
    context = new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
    employeeDao = context.getBean(EmployeeMapper.class);
    // userDao=context.getBean(UserMapper.class);
  }
  @Test
  public void test() {
    System.out.println(employeeDao);
  }
  /**
   * 按照List中的id,返回删除了几条数据
   */
  @Test
  public void deleteBatchIds() {
    List<Integer> ids=new ArrayList<>();
    //ids.add(1);
    ids.add(10);
    ids.add(9);
    Integer result=employeeDao.deleteBatchIds(ids);
    System.out.println("删除记录数"+result);
  }
  /**
   * 按照条件删除,返回删除了几条数据
   */
  @Test
  public void deleteByMap() {
    Map<String, Object> columnMap = new HashMap<>();
    //columnMap.put("gender", 2);
    columnMap.put("age", 11);
    Integer result=employeeDao.deleteByMap(columnMap);
    System.out.println("删除记录数"+result);
  }
  /*
   * 返回是否删除成功  1表示成功,0表示不成功
   */
  @Test
  public void deleteById() {
    Integer result = employeeDao.deleteById(10);
    System.out.println("删除结果:" + (result != 0));
  }
  @Test
  public void selectById() {
    Employee e = employeeDao.selectById(1);
    System.out.println(e);
  }
  /**
   * 根据Employee中属性的值查询一个,一个,一个对象,如果返回多个,报错,只能返回一个或者null 自我感觉这个方法不推荐
   */
  @Test
  public void selectOne() {
    Employee e = new Employee();
    e.setId(10);
    e.setName("张三10");
    e.setEmail("8@com10");
    e.setAge(13);
    e.setGender(0);
    Employee ee = employeeDao.selectOne(e);
    System.out.println(ee);
  }
  /**
   * 简单的没有查询条件的分页查询 注意:效果不是很好,因为底层SQL为(SELECT id AS id,`name`,email,gender,age
   * FROM employee ) page=new Page<>(current, size)
   * employeeDao.selectPage(rowBounds, wrapper)
   */
  @Test
  public void selectPage() {
    Page<Employee> page = new Page<>(2, 2);// currect,size
    List<Employee> emps = employeeDao.selectPage(page, null);
    System.out.println(emps);
  }
  /**
   * 按照条件查询
   */
  @Test
  public void selectByMap() {
    Map<String, Object> columnMap = new HashMap<>();
    columnMap.put("gender", 1);
    columnMap.put("age", 1);
    List<Employee> employees = employeeDao.selectByMap(columnMap);
    for (Employee employee : employees) {
      System.out.println(employee);
    }
  }
  /**
   * SQL:SELECT id AS id,`name`,email,gender,age FROM employee WHERE id IN ( ?
   * , ? , ? ) 查询多个ID
   */
  @Test
  public void selectBatchIds() {
    List<Integer> idList = new ArrayList<>();
    idList.add(1);
    idList.add(2);
    idList.add(3);
    List<Employee> employees = employeeDao.selectBatchIds(idList);
    for (Employee employee : employees) {
      System.out.println(employee);
    }
  }
  @Test
  public void update() {
    Employee e = new Employee();
    e.setId(10);
    e.setName("张三10");
    e.setEmail("8@com10");
    e.setAge(13);
    e.setGender(0);
    int result = employeeDao.updateById(e);// 更新属性为非空的列
    // int result = employeeDao.updateAllColumnById(e);//更新全部的列
    System.out.println("处理结果:" + (result != 0));
    System.out.println("返回的主键值:" + e.getId());
  }
  /**
   * //e.setAge(13); 先判断是否为空,不为空的属性插入的表中 NSERT INTO employee ( `name`, email,
   * gender, age ) VALUES ( ?, ?, ?, ? ) INSERT INTO employee ( `name`, email,
   * gender ) VALUES ( ?, ?, ? )
   */
  @Test
  public void insert() {
    Employee e = new Employee();
    e.setName("张三");
    e.setEmail("8@com");
    e.setAge(13);
    e.setGender(1);
    int result = employeeDao.insert(e);
    // employeeDao.insertAllColumn(e);讲所有的属性都插入,null也插入
    System.out.println("处理结果:" + (result != 0));
    System.out.println("返回的主键值:" + e.getId());
  }
}


Condition条件构造器


package com.imooc.main;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.baomidou.mybatisplus.mapper.Condition;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.imooc.dao.EmployeeMapper;
import com.imooc.entity.Employee;
public class ConditionTest {
  private ClassPathXmlApplicationContext context = null;
  private EmployeeMapper employeeDao = null;
  // private UserMapper userDao=null;
  @Before
  public void before() {
    context = new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
    employeeDao = context.getBean(EmployeeMapper.class);
    // userDao=context.getBean(UserMapper.class);
  }
  @Test
  public void test() {
    System.out.println(employeeDao);
  }
  /**
   * 和wrapper方法一样
   */
  @Test
  public void conditionDemo() {
    Condition condition=Condition.create();
    condition.eq("gender", 1);
    List<Employee>emps=null;
    emps=employeeDao.selectList(condition);
    System.out.println(emps);
  }
}


EntityWrapper条件构造器


package com.imooc.main;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.imooc.dao.EmployeeMapper;
import com.imooc.entity.Employee;
public class WrapperTest {
  private ClassPathXmlApplicationContext context = null;
  private EmployeeMapper employeeDao = null;
  // private UserMapper userDao=null;
  @Before
  public void before() {
    context = new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
    employeeDao = context.getBean(EmployeeMapper.class);
    // userDao=context.getBean(UserMapper.class);
  }
  @Test
  public void test() {
    System.out.println(employeeDao);
  }
  @Test
  public void selectList_EntityWrapper(){
    EntityWrapper<Employee> wrapper=new EntityWrapper<>();
    wrapper.eq("gender", 1)
    //.or().like("email", "a")    //WHERE (gender = ? OR email LIKE ?) 
    .orNew().like("email", "a");//WHERE (gender = ? ) OR (email LIKE ?) 
    List<Employee> emps=employeeDao.selectList(wrapper);
    System.out.println(emps);
  }
  /**同上
   * R
   * U
   * D
   */
  //@Test
  public void RUD_EntityWrapper(){
    EntityWrapper<Employee> wrapper=new EntityWrapper<>();
    Employee e=new Employee();
    //e.setAge(1);修改的内容
    employeeDao.update(e, wrapper);//按照wrapper条件修改为e中的内容
    employeeDao.delete(wrapper);//删除按照wrapper条件的数据
  }
  @Test
  public void EntityWrapper(){
    Page<Employee> page=new Page<>(1, 2);
    EntityWrapper<Employee> wrapper=new EntityWrapper<>();
    //wrapper.between(column, val1, val2) 注意:column是数据库字段,不是类的属性
    wrapper
    //.between("age", 10, 20)//查询age字段在10-20之间的记录
    .eq("gender", 1);//查询字段为gender为1的记录
    List<Employee> emps=employeeDao.selectPage(page, wrapper);
    System.out.println(emps);
  }
}


分页查询


package com.imooc.main;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.imooc.dao.EmployeeMapper;
import com.imooc.entity.Employee;
public class PageTest {
  private ClassPathXmlApplicationContext context = null;
  private EmployeeMapper employeeDao = null;
  // private UserMapper userDao=null;
  @Before
  public void before() {
    context = new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
    employeeDao = context.getBean(EmployeeMapper.class);
    // userDao=context.getBean(UserMapper.class);
  }
  @Test
  public void test() {
    System.out.println(employeeDao);
  }
  @Test
  public void pageTest() {
    Page page = new Page<>(2, 2);
    List<Employee> emps = employeeDao.selectPage(page, null);
    System.out.println(emps);
    System.out.println("===============获取分页相关的一些信息======================");
    System.out.println("总条数:" + page.getTotal());
    System.out.println("当前页码: " + page.getCurrent());
    System.out.println("总页码:" + page.getPages());
    System.out.println("每页显示的条数:" + page.getSize());
    System.out.println("是否有上一页: " + page.hasPrevious());
    System.out.println("是否有下一页: " + page.hasNext());
    // 将查询的结果封装到page对象中
    page.setRecords(emps);
  }
}
相关实践学习
如何快速连接云数据库RDS MySQL
本场景介绍如何通过阿里云数据管理服务DMS快速连接云数据库RDS MySQL,然后进行数据表的CRUD操作。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
3天前
|
SQL JavaScript Java
Spring Boot 3 整合 Mybatis-Plus 实现数据权限控制
本文介绍了如何在Spring Boot 3中整合MyBatis-Plus实现数据权限控制,通过使用MyBatis-Plus提供的`DataPermissionInterceptor`插件,在不破坏原有代码结构的基础上实现了细粒度的数据访问控制。文中详细描述了自定义注解`DataScope`的使用方法、`DataPermissionHandler`的具体实现逻辑,以及根据用户的不同角色和部门动态添加SQL片段来限制查询结果。此外,还展示了基于Spring Boot 3和Vue 3构建的前后端分离快速开发框架的实际应用案例,包括项目的核心功能模块如用户管理、角色管理等,并提供Gitee上的开源仓库
38 11
|
7月前
|
存储 Java Maven
Spring Boot WebFlux 增删改查完整实战 demo
Spring Boot WebFlux 增删改查完整实战 demo
|
2月前
|
SQL Java 数据库连接
MyBatis-Plus快速入门:从安装到第一个Demo
本文将带你从零开始,快速入门 MyBatis-Plus。我们将首先介绍如何安装和配置 MyBatis-Plus,然后通过一个简单的示例演示如何使用它进行数据操作。无论你是 MyBatis 的新手还是希望提升开发效率的老手,本文都将为你提供清晰的指导和实用的技巧。
596 0
MyBatis-Plus快速入门:从安装到第一个Demo
|
4月前
|
前端开发 JavaScript Java
技术分享:使用Spring Boot3.3与MyBatis-Plus联合实现多层次树结构的异步加载策略
在现代Web开发中,处理多层次树形结构数据是一项常见且重要的任务。这些结构广泛应用于分类管理、组织结构、权限管理等场景。为了提升用户体验和系统性能,采用异步加载策略来动态加载树形结构的各个层级变得尤为重要。本文将详细介绍如何使用Spring Boot3.3与MyBatis-Plus联合实现这一功能。
159 2
|
6月前
|
Java 数据库连接 Spring
搭建 spring boot + mybatis plus 项目框架并进行调试
搭建 spring boot + mybatis plus 项目框架并进行调试
115 4
|
5月前
|
Java Spring
【Azure 应用服务】记一次Azure Spring Cloud 的部署错误 (az spring-cloud app deploy -g dev -s testdemo -n demo -p ./hellospring-0.0.1-SNAPSHOT.jar --->>> Failed to wait for deployment instances to be ready)
【Azure 应用服务】记一次Azure Spring Cloud 的部署错误 (az spring-cloud app deploy -g dev -s testdemo -n demo -p ./hellospring-0.0.1-SNAPSHOT.jar --->>> Failed to wait for deployment instances to be ready)
|
5月前
|
Java 关系型数据库 MySQL
|
7月前
|
Java 数据库连接 数据库
Spring Boot 集成 MyBatis-Plus 总结
Spring Boot 集成 MyBatis-Plus 总结
|
7月前
|
Java 数据库连接 mybatis
在Spring Boot应用中集成MyBatis与MyBatis-Plus
在Spring Boot应用中集成MyBatis与MyBatis-Plus
138 5
|
7月前
|
Java 数据库连接 数据库
实现Spring Boot与MyBatis结合进行数据库历史数据的定时迁移
实现Spring Boot与MyBatis结合进行数据库历史数据的定时迁移
244 2