插入并更新

insert into t_product_vul_handle (id, product_vul_id, vul_id,
  process_result, create_time, update_time,
  create_user, update_user, process_file
  )
  values (#{id,jdbcType=VARCHAR}, #{product_vul_id,jdbcType=VARCHAR}, #{vul_id,jdbcType=VARCHAR},
  #{process_result,jdbcType=VARCHAR}, #{create_time,jdbcType=TIMESTAMP}, #{update_time,jdbcType=TIMESTAMP},
  #{create_user,jdbcType=VARCHAR}, #{update_user,jdbcType=VARCHAR}, #{process_file,jdbcType=LONGVARCHAR}
  )
 on DUPLICATE key //插入并更新
  UPDATE  id = #{id,jdbcType=VARCHAR},
  product_vul_id = #{product_vul_id,jdbcType=VARCHAR},
  vul_id = #{vul_id,jdbcType=VARCHAR},
  process_result = #{process_result,jdbcType=VARCHAR},
  create_time = #{create_time,jdbcType=TIMESTAMP},
  update_time = #{update_time,jdbcType=TIMESTAMP},
  create_user = #{create_user,jdbcType=VARCHAR},
  update_user = #{update_user,jdbcType=VARCHAR} 

你可能感兴趣的:(插入并更新)