1. 批量插入,Mybatis参数是list
int insertList(@Param("studentList") List<Student> students);
<insert id="insertList" parameterType="java.util.List">
insert into tb_student (s_id, s_name, s_age, create_date)
<foreach collection="studentList" item="e" index="index" open="(" close=")" separator="union">
select
#{e.sId,jdbcType=VARCHAR},
#{e.sName,jdbcType=VARCHAR},
#{e.sAge,jdbcType=VARCHAR},
#{e.createDate,jdbcType=TIMESTAMP}
from dual
</foreach>
</insert>
2. Mybatis参数是数组
List<Student> selectListByIds(@Param("ids") String[] ids);
<select id="selectListByIds" resultMap="BaseResultMap">