insert into charge_machine(
heartbeat_time,impl_bean,machine_id,machine_code,energy_price,rule_id,community_id,machine_name
) values (
#{heartbeatTime},#{implBean},#{machineId},#{machineCode},#{energyPrice},#{ruleId},#{communityId},#{machineName}
)
update charge_machine t set t.status_cd = #{statusCd}
,t.b_id = #{newBId}
, t.heartbeat_time= #{heartbeatTime}
, t.impl_bean= #{implBean}
, t.machine_code= #{machineCode}
, t.energy_price= #{energyPrice}
, t.rule_id= #{ruleId}
, t.community_id= #{communityId}
, t.machine_name= #{machineName}
where 1=1
and t.machine_id= #{machineId}