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>

posted on 2017-01-19 10:16  myf008  阅读(537)  评论(0编辑  收藏  举报

导航