select mml.label_id, mml.label_type, mml.label_code, mml.bind_time, mml.binder, mml.is_bind, mt.type_name from ma_machine_label mml left join ma_type mt on mml.type_id = mt.type_id insert into ma_machine_label( label_id, label_type, label_code, binder, is_bind, )values( #{labelId}, #{labelType}, #{labelCode}, #{binder}, #{isBind}, ) insert into ma_type( type_name, )values( #{typeName}, ) update ma_machine_label set is_bind = '0' where label_id in #{labelId} update ma_machine_label set is_bind = '1' where label_id = #{labelId} update ma_machine_label label_type = #{labelType}, label_code = #{labelCode}, binder = #{binder}, is_bind = #{isBind}, company_id = #{companyId}, where label_id = #{labelId} update ma_type type_name = #{typeName}, where type_id = #{typeId}