随笔分类 -  【Java系列】 / 【Mybatis-Plus】

Mybatis-Plus系列---【自定义sql拦截器打印完整sql及耗时】
摘要:1.自定义sql拦截器(注意:Executor是org.apache.ibatis.executor.Executor包下的,不要导错了) import cn.hutool.core.util.ObjectUtil; import lombok.extern.slf4j.Slf4j; import 阅读全文

posted @ 2025-12-03 15:45 少年攻城狮 阅读(40) 评论(0) 推荐(0)

Mybatis-Plus系列---【解决null值字段不更新的问题】
摘要:解决null值字段不更新的问题 1.问题 我的MP版本是3.3.2,用Mybatis-Plus的updateById()来更新数据时,无法将字段设置为null值(更新后数据还是原来的值)。 2.分析 默认情况下,Mybatis-Plus在更新时会判断字段是否为null,如果是null,则不设值(不将 阅读全文

posted @ 2022-12-08 23:47 少年攻城狮 阅读(3366) 评论(0) 推荐(1)

MybatisPlus系列---【时间查询】
摘要:1.问题描述 项目中经常遇到这样的问题,有个查询条件是日期,或者日期范围,但是数据库一般存的是日期时间,想要查询,肯定要做格式化后再比较。不使用MybatisPlus的时候,一般都用Mysql的Tochar进行处理,使用MybatisPlus的时候,有没有更优雅的写法呢? 2.解决方案 注意:bet 阅读全文

posted @ 2022-08-22 20:30 少年攻城狮 阅读(3091) 评论(0) 推荐(0)

Mybatis-Plus系列---【增、删、改、查常用Demo】
摘要:1.新增 @PostMapping("/add") public R<Boolean> insert(@RequestBody BusinessCustomer businessCustomer) { return add(this.businessCustomerService.save(busi 阅读全文

posted @ 2022-07-23 15:24 少年攻城狮 阅读(569) 评论(0) 推荐(0)

Mybatis-Plus系列---【org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.fast.dao.FinanceOutcomeDao.getListByPayTime】
摘要:1.问题 我习惯于使用mybatis-plus,因此很少使用xml写sql,但是有时复杂的查询还是写sql比较方便,因此我在使用xml写sql后,调用时报了org.apache.ibatis.binding.BindingException: Invalid bound statement (not 阅读全文

posted @ 2022-04-25 21:17 少年攻城狮 阅读(475) 评论(0) 推荐(0)

工具类系列---【tk-mybatis查询条件组装类】
摘要:tk-mybatis的使用教程 1.引入依赖 <dependency> <groupId>tk.mybatis</groupId> <artifactId>mapper-spring-boot-starter</artifactId> <version>2.1.5</version> </depen 阅读全文

posted @ 2022-03-09 17:00 少年攻城狮 阅读(511) 评论(0) 推荐(0)

Mybatis-Plus系列---【自动填充】
摘要:1.引入pom依赖 <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>3.4.3.4</version> </dependency> 2.引 阅读全文

posted @ 2021-11-04 01:03 少年攻城狮 阅读(162) 评论(0) 推荐(0)

Mybatis-Plus系列---【代码生成器】
摘要:1.引入pom依赖 <!--我的是springCloud项目,这个放在了fast-service的pom文件中--> <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifac 阅读全文

posted @ 2021-11-03 23:43 少年攻城狮 阅读(112) 评论(0) 推荐(0)

导航