id, controller_id, intake_id, rtu_addr, dt, dt_last, dt_rtu, loss_amount
  
  
  
  
    
    delete from rm_loss_history
    where id = #{id,jdbcType=BIGINT}
  
  
    
    insert into rm_loss_history (id, controller_id, intake_id, 
      rtu_addr, dt, dt_last, dt_rtu, loss_amount
      )
    values (#{id,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, 
      #{rtuAddr,jdbcType=VARCHAR}, #{dt,jdbcType=DATE}, #{dtLast,jdbcType=TIMESTAMP}, #{dtRtu,jdbcType=TIMESTAMP}, #{lossAmount,jdbcType=DOUBLE}
      )
  
  
    
    insert into rm_loss_history
    
      
        id,
      
      
        controller_id,
      
      
        intake_id,
      
      
        rtu_addr,
      
      
        dt,
      
      
        dt_last,
      
     
        dt_rtu,
      
      
        loss_amount,
      
    
    
      
        #{id,jdbcType=BIGINT},
      
      
        #{controllerId,jdbcType=BIGINT},
      
      
        #{intakeId,jdbcType=BIGINT},
      
      
        #{rtuAddr,jdbcType=VARCHAR},
      
      
        #{dt,jdbcType=DATE},
      
      
        #{dtLast,jdbcType=TIMESTAMP},
      
      
        #{dtRtu,jdbcType=TIMESTAMP},
      
      
        #{lossAmount,jdbcType=DOUBLE},
      
    
  
  
    
    update rm_loss_history
    
      
        controller_id = #{controllerId,jdbcType=BIGINT},
      
      
        intake_id = #{intakeId,jdbcType=BIGINT},
      
      
        rtu_addr = #{rtuAddr,jdbcType=VARCHAR},
      
      
        dt = #{dt,jdbcType=DATE},
      
      
        dt_last = #{dtLast,jdbcType=TIMESTAMP},
      
      
        dt_rtu = #{dtRtu,jdbcType=TIMESTAMP},
      
      
        loss_amount = #{lossAmount,jdbcType=DOUBLE},
      
    
    where id = #{id,jdbcType=BIGINT}
  
  
    
    update rm_loss_history
    set controller_id = #{controllerId,jdbcType=BIGINT},
      intake_id = #{intakeId,jdbcType=BIGINT},
      rtu_addr = #{rtuAddr,jdbcType=VARCHAR},
      dt = #{dt,jdbcType=DATE},
      dt_last = #{dtLast,jdbcType=TIMESTAMP},
      dt_rtu = #{dtRtu,jdbcType=TIMESTAMP},
      loss_amount = #{lossAmount,jdbcType=DOUBLE}
    where id = #{id,jdbcType=BIGINT}