批量mergeinto
为什么80%的码农都做不了架构师?>>>
<insert id="insertStockQuotaionByBatch" parameterType="java.util.List" useGeneratedKeys="false">
BEGIN
<foreach collection="list" item="item" index="index" separator=";">
merge into STOCK_QUOTATION a
using dual
on (a.stockno=#{item.stockno,jdbcType=VARCHAR} and a.TRADING_DAY = #{tradingDay,jdbcType=DATE})
when not matched then
insert into stock_quotation
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="stockno != null" >
STOCKNO,
</if>
<if test="tradingDay != null" >
TRADING_DAY,
</if>
<if test="stockName != null" >
STOCK_NAME,
</if>
<if test="openPrice != null" >
OPEN_PRICE,
</if>
<if test="closePrice != null" >
CLOSE_PRICE,
</if>
<if test="highestPrice != null" >
HIGHEST_PRICE,
</if>
<if test="lowestPrice != null" >
LOWEST_PRICE,
</if>
<if test="volume != null" >
VOLUME,
</if>
<if test="obv != null" >
OBV,
</if>
<if test="turnoverRate != null" >
turnover_rate,
</if>
<if test="amo != null" >
amo,
</if>
<if test="totalValue != null" >
total_value,
</if>
<if test="circulationMarketValue != null" >
circulation_market_value,
</if>
<if test="createdBy != null" >
CREATED_BY,
</if>
<if test="createdDate != null" >
CREATED_DATE,
</if>
<if test="updatedBy != null" >
UPDATED_BY,
</if>
<if test="updatedDate != null" >
UPDATED_DATE,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="stockno != null" >
#{stockno,jdbcType=VARCHAR},
</if>
<if test="tradingDay != null" >
#{tradingDay,jdbcType=DATE},
</if>
<if test="stockName != null" >
#{stockName,jdbcType=VARCHAR},
</if>
<if test="openPrice != null" >
#{openPrice,jdbcType=DOUBLE},
</if>
<if test="closePrice != null" >
#{closePrice,jdbcType=DOUBLE},
</if>
<if test="highestPrice != null" >
#{highestPrice,jdbcType=DOUBLE},
</if>
<if test="lowestPrice != null" >
#{lowestPrice,jdbcType=DOUBLE},
</if>
<if test="volume != null" >
#{volume,jdbcType=INTEGER},
</if>
<if test="obv != null" >
#{obv,jdbcType=DOUBLE},
</if>
<if test="turnoverRate != null" >
#{turnoverRate,jdbcType=DOUBLE},
</if>
<if test="amo != null" >
#{amo,jdbcType=DOUBLE},
</if>
<if test="obv != null" >
#{totalValue,jdbcType=DOUBLE},
</if>
<if test="obv != null" >
#{circulationMarketValue,jdbcType=DOUBLE},
</if>
<if test="createdBy != null" >
#{createdBy,jdbcType=VARCHAR},
</if>
<if test="createdDate != null" >
#{createdDate,jdbcType=DATE},
</if>
<if test="updatedBy != null" >
#{updatedBy,jdbcType=VARCHAR},
</if>
<if test="updatedDate != null" >
#{updatedDate,jdbcType=DATE},
</if>
</trim>
</foreach>
;END;
</insert>
转载于:https://my.oschina.net/hfq/blog/1475501
批量mergeinto相关推荐
- EFCore查询语句生成流程、让EFCore支持批量Update/Delete/MergeInto
引子 之前发现了一款叫 EFCore.BulkExtensions 的 nuget 包.里面提供了大量的 BulkInsertOrUpdateOrDelete 和 BatchUpdate 的拓展,可以 ...
- oracle merge into 批量新增或更新
mapper.java /*** 批量插入或更新* @param stpos* @author fengjia* @date 2022/5/9 19:50*/void mergeInto(List&l ...
- php批量导出pdf文件大小,php完美导出pdf,pdf合并批量导出
使用到的工具 pdftk https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ pdf合并工具 wkhtmltopdf ...
- Redis 笔记(16)— info 指令和命令行工具(查看内存、状态、客户端连接数、监控服务器、扫描大key、采样服务器、执行批量命令等)
Info 命令返回关于 Redis 服务器的各种信息和统计数值.通过给定可选的参数 section ,可以让命令只返回某一部分的信息. 1. 显示模块 server : 一般 Redis 服务器信息, ...
- Redis 笔记(15)— 管道 pipeline(客户端将批量命令打包发送用来节省网络开销)
Redis 是一种基于客户端-服务端模型以及请求/响应协议的 TCP 服务.这意味着通常情况下一个请求会遵循以下步骤: 客户端向服务端发送一个查询请求,并监听 Socket 返回,通常是以阻塞模式,等 ...
- Redis 笔记(03)— string类型(设置key、获取key、设置过期时间、批量设置获取key、对key进行加减、对key值进行追加、获取value子串)
字符串 string 是 Redis 最简单的数据结构.Redis 所有的数据结构都是以唯一的 key 字符串作为名称,然后通过这个唯一 key 值来获取相应的 value 数据.不同类型的数据结构的 ...
- shell 批量转换文件编码
相信大家在平时的跨平台编程中碰到过文件编码问题,比如在Windows代码字符编码方式是GB2312,然而转到Linux却只支持utf-8,虽然对代码部分没啥影响,但是很多中文注释部分,却一片乱码,很让 ...
- 批量梯度下降(BGD)、随机梯度下降(SGD)以及小批量梯度下降(MBGD)的理解
批量梯度下降(BGD).随机梯度下降(SGD)以及小批量梯度下降(MBGD)的理解 </h1><div class="clear"></div> ...
- pip 将 某包指定到某目录 批量安装
pip install -r requirements/requirements.txt 包批量安装 pip 将 某包指定到某目录 安装: pip install --target=d:\somew ...
最新文章
- 从零开始学 Python 之运算符
- ffmpeg4编解码例子
- java8_新增特性:函数式接口理解
- php判断ip地址小程序
- 提高ASP.net性能的十种方法
- flask+apache2+ubuntu
- Web前端JavaScript笔记(3)对象
- 中断占据CPU时间的计算问题
- MySql递归查询上级,下级
- 计算机列举几种常见的算法,列举十大计算机经典算法
- usb声卡驱动(五):声卡驱动的开始
- 微信红包发送关键代码
- 水中机器人电控方案设计
- iOS开发 ----- 加载动画之牛顿摆的实现
- 尼古拉斯·卡尔:IT发兵“云计算”
- 判定重大风险有哪几种_重大危险源判定
- 数据结构——哈夫曼树
- el-form和el-col响应式布局
- Axure RP 9 基础教程
- APP二维码微信扫描后无法下载 微信中无法下载APP的解决方案