mabatis insert into on duplicate key
一、mabatis实现saveOrUpdate功能
<insert id="insert" parameterType="hystrixconfigdo">
insert into hystrix_config
(app_id,command_key,command_group,fallback,isolationStgy,maxRequest,timeout,
threadPoolSize,requestThreshold,errorThreshold,circuitBreakTime,create_time,modify_time)
values
(#{appId}, #{commandKey}, #{commandGroup},#{fallback},
#{isolationStgy},#{maxRequest},#{timeout}, #{threadPoolSize},#{requestThreshold},
#{errorThreshold},#{circuitBreakTime},now(), now())
on duplicate key update
command_group=values(command_group),
fallback=values(fallback),
isolationStgy=values(isolationStgy),
maxRequest=values(maxRequest),
timeout=values(timeout),
threadPoolSize=values(threadPoolSize),
requestThreshold=values(requestThreshold),
errorThreshold=values(errorThreshold),
circuitBreakTime=values(circuitBreakTime),
modify_time=values(modify_time)
</insert>