2020
12-10
12-10
Mybatis批量提交实现步骤详解
简介:mybatis的批量操作减少数据库连接次数一、mapper使用foreach遍历批量insert:<insertid="addEmpsBatch">INSERTINTOemp(ename,gender,email,did)VALUES<foreachcollection="emps"item="emp"separator=",">(#{emp.eName},#{emp.gender},#{emp.email},#{emp.dept.id})</foreach></insert>批量update:<updateid="updateNewStock"parameterType="java.util.List"><foreachcollection="list"...
继续阅读 >