2021
05-19
05-19
Mybatis三种批量插入数据的方式
1.循环插入mapper.xml:<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEmapperPUBLIC"-//mybatis.org//DTDMapper3.0//EN""http://mybatis.org/dtd/mybatis-3-mapper.dtd"><mappernamespace="com.buhe.demo.mapper.StudentMapper"><insertid="insert"parameterType="Student">INSERTINTOtb_student(name,age,phone,address,class_id)VALUES(#{name},#{age},#{phone},#{address},#{classId})</...
继续阅读 >