<?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.yjp.mapper.CitiesMapper">
<resultMap type="com.yjp.model.Cities" id="CitiesMap">
<id column="cities_Id" property="citiesId"></id>
<result column="province" property="province"></result>
<result column="city" property="city"></result>
<result column="area" property="area"></result>
</resultMap>
<insert id="createCities" parameterType="java.util.List">
insert into cities(province,city,area)
values
<foreach collection="list" item="item" index="index" separator=",">
(#{item.province},#{item.city},#{item.area})
</foreach>
</insert>
</mapper>
mybatis批量插入数据
最新推荐文章于 2024-07-17 09:57:35 发布