insert into meter_machine(
heartbeat_time,impl_bean,address,prestore_degrees,machine_name,room_id,room_name,cur_reading_time,machine_model,
cur_degrees,machine_id,meter_type,fee_config_name,community_id,fee_config_id,read_day,read_hours
) values (
#{heartbeatTime},#{implBean},#{address},#{prestoreDegrees},#{machineName},#{roomId},#{roomName},#{curReadingTime},
#{machineModel},#{curDegrees},#{machineId},#{meterType},#{feeConfigName},#{communityId},#{feeConfigId},#{readDay},#{readHours}
)
update meter_machine t set t.status_cd = #{statusCd}
,t.b_id = #{newBId}
, t.heartbeat_time= #{heartbeatTime}
, t.impl_bean= #{implBean}
, t.address= #{address}
, t.prestore_degrees= #{prestoreDegrees}
, t.machine_name= #{machineName}
, t.room_id= #{roomId}
, t.room_name= #{roomName}
, t.cur_reading_time= #{curReadingTime}
, t.machine_model= #{machineModel}
, t.cur_degrees= #{curDegrees}
, t.meter_type= #{meterType}
, t.fee_config_name= #{feeConfigName}
, t.fee_config_id= #{feeConfigId}
, t.read_day= #{readDay}
, t.read_hours = #{readHours}
where 1=1
and t.machine_id= #{machineId}
and t.community_id= #{communityId}
update meter_machine t set
t.read_day= #{readDay},
t.read_hours = #{readHours}
where 1=1
and t.community_id= #{communityId}
and t.machine_model= #{machineModel}