![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
mybatis
文章平均质量分 61
fulong0406
这个作者很懒,什么都没留下…
展开
-
tk.mybatis中方法使用注意事项
Example example = new Example(Receiver.class); example.createCriteria().andEqualTo(Receiver.CODE, station.getCode()); int count = receiverMapper.selectCountByExample(example);这几行代码有没有问题,实际上达不到我们业务要求的效果,当station.getCode()为空的时候,我们想当然的以为就是查询为空时的条数,但实际..原创 2022-04-07 09:36:56 · 932 阅读 · 1 评论 -
mybatis中操作sql语句
@Insert("insert into xxx_xxx(name, type, strategy, start_time, firmware_id, creator_id, create_time, device_num, status, protocol) " + " values(#{name},#{type},#{strategy},#{startTime},#{firmwareId},#{creatorId},#{createTime},#{deviceNum},...原创 2022-02-24 17:43:21 · 402 阅读 · 0 评论 -
通用mapper
核心包<dependency> <groupId>tk.mybatis</groupId> <artifactId>mapper-core</artifactId> <version>1.1.5</version></dependency><dependency> <groupId>tk.mybatis</groupId> <...转载 2022-02-18 09:38:05 · 408 阅读 · 0 评论 -
Mybatis中进行批量更新(updateBatch)
转载地址:Mybatis中进行批量更新(updateBatch) - 未月廿三 - 博客园一.更新多条数据,每条数据都不一样 背景描述:通常如果需要一次更新多条数据有两个方式,(1)在业务代码中循环遍历逐条更新。(2)一次性更新所有数据(更准确的说是一条sql语句来更新所有数据,逐条更新的https://www.cnblogs.com/eternityz/p/12284760.html一.更新多条数据,每条数据都不一样背景描述:通常如果需要一次更新多条数据有两个方式,(1)在业务代码中循环遍历逐条更转载 2021-09-23 13:47:18 · 3352 阅读 · 0 评论 -
mybatis——pageHelper
使用方法1. 引入分页插件引入分页插件有下面2种方式,推荐使用 Maven 方式。1). 引入 Jar 包你可以从下面的地址中下载最新版本的 jar 包 https://oss.sonatype.org/content/repositories/releases/com/github/pagehelper/pagehelper/ http://repo1.maven.org/maven2/com/github/pagehelper/pagehelper/ 由于使用了sql转载 2021-08-11 15:25:45 · 348 阅读 · 0 评论