| | |
| | | <?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.ycl.mapper.NewsColumnDao"> |
| | | |
| | | <resultMap type="com.ycl.entity.NewsColumn" id="NewsColumnMap"> |
| | | <result property="id" column="id" jdbcType="VARCHAR"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | </resultMap> |
| | | |
| | | <!-- 批量插入 --> |
| | | <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into news_website.news_column(name) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.name}) |
| | | </foreach> |
| | | </insert> |
| | | <!-- 批量插入或按主键更新 --> |
| | | <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into news_website.news_column(name) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.name}) |
| | | </foreach> |
| | | on duplicate key update |
| | | name = values(name) </insert> |
| | | |
| | | </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.ycl.dao.NewsColumnDao">
|
| | |
|
| | | <resultMap type="com.ycl.entity.NewsColumn" id="NewsColumnMap">
|
| | | <result property="id" column="id" jdbcType="VARCHAR"/>
|
| | | <result property="name" column="name" jdbcType="VARCHAR"/>
|
| | | </resultMap>
|
| | |
|
| | | <!-- 批量插入 -->
|
| | | <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
| | | insert into news_website.news_column(name)
|
| | | values
|
| | | <foreach collection="entities" item="entity" separator=",">
|
| | | (#{entity.name})
|
| | | </foreach>
|
| | | </insert>
|
| | | <!-- 批量插入或按主键更新 -->
|
| | | <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
| | | insert into news_website.news_column(name)
|
| | | values
|
| | | <foreach collection="entities" item="entity" separator=",">
|
| | | (#{entity.name})
|
| | | </foreach>
|
| | | on duplicate key update
|
| | | name = values(name) </insert>
|
| | |
|
| | | </mapper>
|
| | |
|