oracle mybatis批量插入,无匹配找默认
批量插入
<insert id="insertIndi" parameterType="java.util.HashMap" useGeneratedKeys="false">
<foreach collection="datalist" item="item" index="index" open="begin" close="; end;" separator=";">
insert into fpmv_indi_exectemp(${lineColumn}) values
<foreach collection="item.values" index="key" item="_value" open="(" close=")" separator=",">
#{_value}
</foreach>
</foreach>
</insert>
查询无匹配找默认
<select id="getIndiRefList" parameterType="java.util.HashMap" resultType="java.util.HashMap">
select * from T_FPDICTYPE where govid = '0' and govyear = '0' and not exists(
select 1 from t_fpdictype where 1 = 1
<if test="year != null">
and trim(govyear) = #{year,jdbcType=VARCHAR}
</if>
<if test = "province != null">
and trim(govid) = #{province,jdbcType=VARCHAR}
</if>
)
union (
select * from t_fpdictype where 1 = 1
<if test="year != null">
and trim(govyear) = #{year,jdbcType=VARCHAR}
</if>
<if test = "province != null">
and trim(govid) = #{province,jdbcType=VARCHAR}
</if>
) </select>
oracle mybatis批量插入,无匹配找默认的更多相关文章
- oracle+mybatis批量插入踩坑记
最近在项目中需要使用oracle+mybatis批量插入数据,因为自增主键,遇到问题,现记录如下: 一.常用的两种sql写法报错 1.insert ... values ... <insert ...
- 解决Oracle+Mybatis批量插入报错:SQL 命令未正确结束
Mybatis批量插入需要foreach元素.foreach元素有以下主要属性: (1)item:集合中每一个元素进行迭代时的别名. (2)index:指定一个名字,用于表示在迭代过程中,每次迭代到的 ...
- Oracle+Mybatis批量插入,更新和删除
1.插入 (1)第一种方式:利用<foreach>标签,将入参的list集合通过UNION ALL生成虚拟数据,从而实现批量插入(验证过) <insert id="inse ...
- Oracle + Mybatis批量插入数据,xml.mapper种的写法
1,把表中去年所有的信息全部复制作为今年的数据,即查询出去年所有的数据然后复制插入 <insert id="cover" parameterType="java.l ...
- mybatis oracle mysql 批量插入时的坑爹问题--需谨记
mybatis oracle mysql 批量插入一.oracle的批量插入方式insert into db(id, zgbh, shbzh) select '1', '2', '3' from du ...
- mybatis批量插入数据到oracle
mybatis 批量插入数据到oracle报 ”java.sql.SQLException: ORA-00933: SQL 命令未正确结束“ 错误解决方法 oracle批量插入使用 insert a ...
- mybatis批量插入oracle时报错:unique constraint (table name) violated
mybatis批量插入oracle时报错:unique constraint (table name) violated,是因为插入的集合中有两条相同唯一约束的数据.
- 160421、MyBatis批量插入数据
在程序中封装了一个List集合对象,然后需要把该集合中的实体插入到数据库中,由于项目使用了Spring+MyBatis的配置,所以打算使用MyBatis批量插入,由于之前没用过批量插入,在网上找了一些 ...
- MyBatis批量插入数据(MySql)
由于项目需要生成多条数据,并保存到数据库当中,在程序中封装了一个List集合对象,然后需要把该集合中的实体插入到数据库中,项目使用了Spring+MyBatis,所以打算使用MyBatis批量插入,应 ...
随机推荐
- python中return的用法
def testReturn(x): if x > 10000: return print "test return!!" #这句话永远不会得到执行 elif x > ...
- Windows pip
pip 最常用命令(go语言用go get) 显示版本和路径 pip --version 获取帮助 pip --help 升级 pip pip install -U pip 如果这个升级命令出现问题 ...
- poj2478——Farey Sequence(欧拉函数)
Farey Sequence Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 18507 Accepted: 7429 D ...
- CodeForces 877E Danil and a Part-time Job(dfs序+线段树)
Danil decided to earn some money, so he had found a part-time job. The interview have went well, so ...
- Freemark与spring整合
SpringMVC环境的搭建在这里就不多说了,我们这节主要是FreeMarker与SpringMVC整合 首先,在springmvc的配置文件普通视图之前,加入freemarker的视图 fre-se ...
- Vc6.0 编译发生致命链接错误 :不能打开exe的文件
错误: fatal error LNK1104: cannot open file "Debug/CeshiToolBar1.exe" 解决方法:打开任务管理器,找到对应的exe应 ...
- Linux系统优化及状态监控
1.查看系统进程命令 top 进入后可按s 加时间,指定多长时间刷新一次 2.查看cpu信息 cat /proc/cpuinfo 3.查看内存信息 cat /proc/meminfo 4.清理内存:主 ...
- ASP.NET mvc4 Controllder 同步还是异步
从抽象类Controller 的定义可以看出他 同时实现了 IAsyncController, IController public abstract class Controller : Contr ...
- pycharm中使用git
注册GitHub https://www.jb51.net/article/135606.htm pycharm中配置git https://www.cnblogs.com/feixuelove100 ...
- Python【 模块】
module模块:一个py文件就是一个模块 好处: 提高代码的可维护性 可重用 使用模块可以避免函数名和变量名冲突 分类: 标准库模块 第三方模块 自定义模块 调用方法: import 模块 # .p ...