例子:
<update id="insert" parameterType="***.***.***.实体">
merge into 表名 a
using (select 1 from dual)
on (a.字段1 = #{参数} and a.字段2 = #{参数2})
when not matched then
insert (字段1,字段2,字段3)
values(#{参数1,jdbcType=VARCHAR},#{参数2,jdbcType=VARCHAR},#{参数3,jdbcType=VARCHAR})
when matched then
update set counts = counts + 1, last_time = sysdate, 字段1 = #{参数1,jdbcType=VARCHAR}
</update>