You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gysl/ruoyi-admin/src/main/resources/mapper/SmartDeclarationMapper.xml

35 lines
1.9 KiB

<?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.docking.mapper.SmartDeclarationMapper">
<resultMap type="com.ruoyi.docking.entity.SmartDeclaration" id="SmartDeclarationMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="smartRemindersId" column="smart_reminders_id" jdbcType="INTEGER"/>
<result property="isRead" column="is_read" jdbcType="INTEGER"/>
<result property="tyshxydm" column="tyshxydm" jdbcType="VARCHAR"/>
<result property="projectId" column="project_id" jdbcType="INTEGER"/>
<result property="alertTime" column="alert_time" jdbcType="TIMESTAMP"/>
<result property="zwId" column="zw_id" jdbcType="INTEGER"/>
</resultMap>
<!-- 批量插入 -->
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into gysl.smart_declaration(smart_reminders_idis_readtyshxydmproject_idalert_timezw_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.smartRemindersId}#{entity.isRead}#{entity.tyshxydm}#{entity.projectId}#{entity.alertTime}#{entity.zwId})
</foreach>
</insert>
<!-- 批量插入或按主键更新 -->
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into gysl.smart_declaration(smart_reminders_idis_readtyshxydmproject_idalert_timezw_id)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.smartRemindersId}#{entity.isRead}#{entity.tyshxydm}#{entity.projectId}#{entity.alertTime}#{entity.zwId})
</foreach>
on duplicate key update
smart_reminders_id = values(smart_reminders_id) is_read = values(is_read) tyshxydm = values(tyshxydm) project_id = values(project_id) alert_time = values(alert_time) zw_id = values(zw_id) </insert>
</mapper>