
Mybatis
文章平均质量分 62
我的风格0.0
这个作者很懒,什么都没留下…
展开
-
SpringBoot整合Mybatis
SpringBoot整合Mybatis添加Mybatis的起步依赖<!--mybatis起步依赖--><dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.1.0</version></dep原创 2020-12-22 15:23:22 · 172 阅读 · 0 评论 -
mybatis批量操作出现的错误 the error occurred while setting parameters
<update id="recoveryImages"> <foreach collection="array" open="" close=" " separator=";" item="value"> UPDATE image SET `status` = 0 WHERE i_id = #{value} </foreach> </update>语句没问题,但就是报错问题解决方式:是由于mysq..原创 2021-02-08 16:07:04 · 1514 阅读 · 0 评论 -
Mybatis分页插件PageHelper使用教程
添加依赖 <!--添加分页插件--><!--只配置当前这一个依赖 PageHelper不生效--> <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper</artifactId> <version>5.1.10<原创 2021-04-25 17:29:20 · 942 阅读 · 0 评论 -
MyBatis传入Map,使用key和value 批量循环更新 可以根据条件更新
<update id="updateUser" parameterType="java.util.Map"> update userImage <trim prefix="set" suffixOverrides=","> <trim prefix="userImage_code =case" suffix="end,"> <foreach collection="mapData.entryS.原创 2021-05-19 17:44:36 · 2178 阅读 · 0 评论 -
Mybatis笔记,记载工作中的用法 如:批量插入/更新方式,批量插入同时更新方式和其它实用操作
mybatis批量 插入 或 更新数据都各有多种方法一、批量插入的多(2)种方法:1.使用mybatis foreach标签(常用的)该标签有两种使用方式方式一:(推荐使用)@Param 注解用于mapper层,作用是告诉Mybatis要传入的参数名称,同时和xml文件中的参数对应 int addEmps(@Param("emps") List<Employee> emps); --> <!-- MySQL下批量保存,可以foreach遍历 mysql支持va原创 2021-05-24 14:18:35 · 516 阅读 · 0 评论