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

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

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

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

posted @ 2022-08-22 20:30 少年攻城狮 阅读(2998) 评论(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 少年攻城狮 阅读(484) 评论(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 少年攻城狮 阅读(353) 评论(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 少年攻城狮 阅读(448) 评论(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 少年攻城狮 阅读(124) 评论(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 少年攻城狮 阅读(83) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

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