Mybatis学习笔记17 - sql标签和include标签
示例代码: 接口定义: package com.mybatis.dao; import com.mybatis.bean.Employee; import org.apache.ibatis.annotations.Param; import java.util.List; public interface EmployeeMapper { public void addEmps(@Param("emps") List<Employee> emps); } mapper定义: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.mybatis.dao.EmployeeMapper"> <insert id="addEmps"> insert into tbl_employee( <include refid="insertSql"/> ) values <foreach collection="emps" item="emp" separator=","> (#{emp.lastName},#