MERGE into k_mingd_ncc_log t1
USING (select #{pkName} as pkName from dual) t2
ON (t1.pkName=t2.pkName)
when matched then
update set t1.code=#{code},t1.ResultMsg=#{ResultMsg},
t1.RequestBody=#{RequestBody},t1.lastTime=#{lastTime}
where t1.pkName=t2.pkName
when not matched then
insert (
pkName,
code,
ResultMsg,
RequestBody,
taskName,
lastTime) values (
#{pkName},
#{code},
#{ResultMsg},
#{RequestBody},
#{taskName},
#{lastTime}
)
ORACLE存在就修改 不存在就新增(注意更新和新增语法不同于常规语法)
于 2022-02-15 16:55:18 首次发布