随笔分类 -  1、java / 3、框架学习 / 09、Mybatis-plus

摘要:一、引入dynamic-datasource-spring-boot-starter <dependency> <groupId>com.baomidou</groupId> <artifactId>dynamic-datasource-spring-boot-starter</artifactId 阅读全文
posted @ 2023-03-12 21:44 向大海 阅读(98) 评论(0) 推荐(0) 编辑
摘要:一、代码生成器 public class FastAutoGeneratorTest { public static void main(String[] args) { FastAutoGenerator //数据库信息 .create("jdbc:mysql://127.0.0.1:3306/g 阅读全文
posted @ 2023-03-12 20:49 向大海 阅读(27) 评论(0) 推荐(0) 编辑
摘要:一、Springboot整合mybatisPlus配置日志 #配置mybatisPlus日志 mybatis-plus: configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl 二、测试demo与效果 这里以分页测试: 阅读全文
posted @ 2023-03-12 18:12 向大海 阅读(2073) 评论(0) 推荐(0) 编辑
摘要:一、Springboot 配置防全表更新与删除插件 @Configuration public class MybatisPlusConfig { @Bean public MybatisPlusInterceptor mybatisPlusInterceptor() { MybatisPlusIn 阅读全文
posted @ 2023-03-12 14:29 向大海 阅读(134) 评论(0) 推荐(0) 编辑
摘要:一、Springboot 配置乐观锁插件 @Configuration public class MybatisPlusConfig { @Bean public MybatisPlusInterceptor mybatisPlusInterceptor() { MybatisPlusInterce 阅读全文
posted @ 2023-03-12 14:09 向大海 阅读(176) 评论(0) 推荐(0) 编辑
摘要:一、Springboot 配置分页插件 @Configuration public class MybatisPlusConfig { /*分页插件*/ @Bean public MybatisPlusInterceptor mybatisPlusInterceptor() { MybatisPlu 阅读全文
posted @ 2023-03-11 22:48 向大海 阅读(1338) 评论(0) 推荐(0) 编辑
摘要:wapper介绍: 用于条件封装,生成 sql 的 where 条件 |--Wrapper : 条件构造抽象类,最顶端父类 |--AbstractWrapper : 用于查询条件封装,生成 sql 的 where 条件 |--QueryWrapper : 查询条件封装 |--UpdateWrappe 阅读全文
posted @ 2023-03-11 20:08 向大海 阅读(137) 评论(0) 推荐(0) 编辑
摘要:Save(添加) // 插入一条记录(选择字段,策略插入) boolean save(T entity); // 插入(批量) boolean saveBatch(Collection<T> entityList); // 插入(批量) boolean saveBatch(Collection<T> 阅读全文
posted @ 2023-03-11 20:08 向大海 阅读(71) 评论(0) 推荐(0) 编辑
摘要:BaseMapper接口API: Insert(添加): /** * 插入一条记录 * * @param entity 实体对象 */ int insert(T entity); 参数说明: 类型 参数名 描述 T entity 实体对象 Delete(删除): /** * 根据 ID 删除 * * 阅读全文
posted @ 2023-03-10 17:18 向大海 阅读(300) 评论(0) 推荐(0) 编辑
摘要:这里是以Springboot为例,以下文档都是以此为基础实现 安装: 0.创建数据库表 1.使用IDEA构建Springboot项目 2.启动当前的Springboot项目,确保新构建的项目没有问题 3.引入依赖配置 pom.xml <!--springboot web--> <dependency 阅读全文
posted @ 2023-03-09 21:24 向大海 阅读(99) 评论(0) 推荐(0) 编辑
摘要:mybatisPlus相关注解 注解名称 使用位置 描述说明 @TableName 实体类 表名注解,标识实体类对应的数据相应的表 属性 类型 必须指定 默认值 描述说明 value String 否 "" 表名 schema String 否 "" schema keepGlobalPrefix 阅读全文
posted @ 2023-03-09 21:22 向大海 阅读(101) 评论(0) 推荐(0) 编辑
摘要:官网地址:https://mp.baomidou.com/ 官网简介: MyBatis-Plus (简称 MP)是一个 MyBatis 的增强工具,在 MyBatis 的基础上只做增强不做改变,为简化开发、提高效率而生。 我的简介: MyBatisPlus可以节省我们大量工作时间,所有的CRUD代码 阅读全文
posted @ 2023-03-09 13:52 向大海 阅读(24) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示