id, intake_id, dt, amount, dt_last, rtu_addr_last, controller_id_last, total_amount_last,
    rtu_dt_last
  
  
  
  
    
    delete from rm_intake_amount_day
    where id = #{id,jdbcType=BIGINT}
  
  
    
    insert into rm_intake_amount_day (id, intake_id, dt, 
      amount, dt_last,
      rtu_addr_last, controller_id_last, total_amount_last, 
      rtu_dt_last)
    values (#{id,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, #{dt,jdbcType=DATE}, 
      #{amount,jdbcType=DOUBLE}, #{dtLast,jdbcType=TIMESTAMP},
      #{rtuAddrLast,jdbcType=VARCHAR}, #{controllerIdLast,jdbcType=BIGINT}, #{totalAmountLast,jdbcType=FLOAT}, 
      #{rtuDtLast,jdbcType=TIMESTAMP})
  
  
    
    insert into rm_intake_amount_day
    
      
        id,
      
      
        intake_id,
      
      
        dt,
      
      
        amount,
      
      
        dt_last,
      
      
        rtu_addr_last,
      
      
        controller_id_last,
      
      
        total_amount_last,
      
      
        rtu_dt_last,
      
    
    
      
        #{id,jdbcType=BIGINT},
      
      
        #{intakeId,jdbcType=BIGINT},
      
      
        #{dt,jdbcType=DATE},
      
      
        #{amount,jdbcType=DOUBLE},
      
      
        #{dtLast,jdbcType=TIMESTAMP},
      
      
        #{rtuAddrLast,jdbcType=VARCHAR},
      
      
        #{controllerIdLast,jdbcType=BIGINT},
      
      
        #{totalAmountLast,jdbcType=FLOAT},
      
      
        #{rtuDtLast,jdbcType=TIMESTAMP},
      
    
  
  
    
    update rm_intake_amount_day
    
      
        intake_id = #{intakeId,jdbcType=BIGINT},
      
      
        dt = #{dt,jdbcType=DATE},
      
      
        amount = #{amount,jdbcType=DOUBLE},
      
      
        dt_last = #{dtLast,jdbcType=TIMESTAMP},
      
      
        rtu_addr_last = #{rtuAddrLast,jdbcType=VARCHAR},
      
      
        controller_id_last = #{controllerIdLast,jdbcType=BIGINT},
      
      
        total_amount_last = #{totalAmountLast,jdbcType=FLOAT},
      
      
        rtu_dt_last = #{rtuDtLast,jdbcType=TIMESTAMP},
      
    
    where id = #{id,jdbcType=BIGINT}
  
  
    
    update rm_intake_amount_day
    set intake_id = #{intakeId,jdbcType=BIGINT},
      dt = #{dt,jdbcType=DATE},
      amount = #{amount,jdbcType=DOUBLE},
      dt_last = #{dtLast,jdbcType=TIMESTAMP},
      rtu_addr_last = #{rtuAddrLast,jdbcType=VARCHAR},
      controller_id_last = #{controllerIdLast,jdbcType=BIGINT},
      total_amount_last = #{totalAmountLast,jdbcType=FLOAT},
      rtu_dt_last = #{rtuDtLast,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}