<?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.ruoyi.gysl.mapper.NoticeMapper">

    <resultMap type="com.ruoyi.gysl.entity.Notice" id="NoticeMap">
        <result property="id" column="id" jdbcType="INTEGER"/>
        <result property="type" column="type" jdbcType="INTEGER"/>
        <result property="content" column="content" jdbcType="VARCHAR"/>
        <result property="tyshxydm" column="tyshxydm" jdbcType="VARCHAR"/>
        <result property="createId" column="create_id" jdbcType="INTEGER"/>
        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
        <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
        <result property="updateId" column="update_id" jdbcType="INTEGER"/>
        <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
    </resultMap>

    <!-- 批量插入 -->
    <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
        insert into gysl.notice(typecontenttyshxydmcreate_idcreate_timecreate_byupdate_idupdate_byupdate_time)
        values
        <foreach collection="entities" item="entity" separator=",">
        (#{entity.type}#{entity.content}#{entity.tyshxydm}#{entity.createId}#{entity.createTime}#{entity.createBy}#{entity.updateId}#{entity.updateBy}#{entity.updateTime})
        </foreach>
    </insert>
    <!-- 批量插入或按主键更新 -->
    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
        insert into gysl.notice(typecontenttyshxydmcreate_idcreate_timecreate_byupdate_idupdate_byupdate_time)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.type}#{entity.content}#{entity.tyshxydm}#{entity.createId}#{entity.createTime}#{entity.createBy}#{entity.updateId}#{entity.updateBy}#{entity.updateTime})
        </foreach>
        on duplicate key update
type = values(type) content = values(content) tyshxydm = values(tyshxydm) create_id = values(create_id) create_time = values(create_time) create_by = values(create_by) update_id = values(update_id) update_by = values(update_by) update_time = values(update_time)     </insert>

</mapper>

