File was renamed from ycl-platform/src/main/resources/mapper/NewsDepartmentDao.xml |
| | |
| | | <?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.NewsDepartmentDao">
|
| | |
|
| | | <resultMap type="com.ycl.entity.NewsDepartment" id="NewsDepartmentMap">
|
| | | <result property="id" column="id" jdbcType="INTEGER"/>
|
| | | <result property="deptname" column="deptname" jdbcType="VARCHAR"/>
|
| | | </resultMap>
|
| | |
|
| | | <!-- 批量插入 -->
|
| | | <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
| | | insert into news_website.news_department(deptname)
|
| | | values
|
| | | <foreach collection="entities" item="entity" separator=",">
|
| | | (#{entity.deptname})
|
| | | </foreach>
|
| | | </insert>
|
| | | <!-- 批量插入或按主键更新 -->
|
| | | <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
| | | insert into news_website.news_department(deptname)
|
| | | values
|
| | | <foreach collection="entities" item="entity" separator=",">
|
| | | (#{entity.deptname})
|
| | | </foreach>
|
| | | on duplicate key update
|
| | | deptname = values(deptname) </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.mapper.NewsDepartmentDao"> |
| | | |
| | | <resultMap type="com.ycl.entity.NewsDepartment" id="NewsDepartmentMap"> |
| | | <result property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="deptname" column="deptname" jdbcType="VARCHAR"/> |
| | | </resultMap> |
| | | |
| | | <!-- 批量插入 --> |
| | | <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into news_website.news_department(deptname) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.deptname}) |
| | | </foreach> |
| | | </insert> |
| | | <!-- 批量插入或按主键更新 --> |
| | | <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true"> |
| | | insert into news_website.news_department(deptname) |
| | | values |
| | | <foreach collection="entities" item="entity" separator=","> |
| | | (#{entity.deptname}) |
| | | </foreach> |
| | | on duplicate key update |
| | | deptname = values(deptname) </insert> |
| | | |
| | | </mapper> |
| | | |