insert into machine(heartbeat_time, machine_code, auth_code, location_type_cd, machine_version, machine_name,
machine_mac,
machine_id, type_id, state, community_id, location_obj_id, machine_type_cd, machine_ip,
direction, b_id)
values (#{heartbeatTime}, #{machineCode}, #{authCode}, #{locationTypeCd}, #{machineVersion}, #{machineName},
#{machineMac},
#{machineId}, #{typeId}, #{state}, #{communityId}, #{locationObjId}, #{machineTypeCd}, #{machineIp},
#{direction}, #{bId})
update machine t set t.status_cd = #{statusCd}
,t.b_id = #{newBId}
, t.heartbeat_time= #{heartbeatTime}
, t.machine_code= #{machineCode}
, t.auth_code= #{authCode}
, t.location_type_cd= #{locationTypeCd}
, t.machine_version= #{machineVersion}
, t.machine_name= #{machineName}
, t.machine_mac= #{machineMac}
, t.type_id= #{typeId}
, t.state= #{state}
, t.community_id= #{communityId}
, t.location_obj_id= #{locationObjId}
, t.machine_type_cd= #{machineTypeCd}
, t.machine_ip= #{machineIp}
, t.direction= #{direction}
where 1=1
and t.machine_id= #{machineId}