merge into table t
using (select 'key' key from dual ) t2
on (t2.key = t.key)
when matched then
update set t.x = xxx, t.y = yyy,t.date = to_date(?, 'yyyy-mm-dd hh24:mi:ss')
when not matched then
insert (t.key,t.x, t.y) values ('key',xxx, yyy,)
如果数据存在则更新,否则执行插入