package com.muyu.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.muyu.domain.req.FaultCodeAddReq;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * 故障标签
 * @Author：weiran
 * @Package：com.muyu.cloud.faultmanage.domain
 * @Project：cloud-faultmanage
 * @name：FaultLabel
 * @Date：2024/9/17 15:06
 */


@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@TableName(value = "car_fault_label",autoResultMap = true)
@Tag(name = "故障标签")
public class FaultLabel {
    /**
     *自增主键
     */
    @TableId(value = "message_type_id",type = IdType.AUTO)
    private Long messageTypeId;
    /**
     *报文编码
     */
    private String messageTypeCode;
    /**
     *报文名称
     */
    private String messageTypeName;
    /**
     *报文所属类别
     */
    private String messageTypeBelongs;


    public static FaultLabel addfaultLabel(FaultLabel faultLabel){
        return FaultLabel.builder()
                .messageTypeId(faultLabel.getMessageTypeId())
                .messageTypeCode(faultLabel.getMessageTypeCode())
                .messageTypeName(faultLabel.getMessageTypeName())
                .messageTypeBelongs(faultLabel.getMessageTypeBelongs())
                .build();
    }


    public static FaultLabel selectFaultLabel(FaultLabel faultLabel) {
        return FaultLabel.builder()
                .messageTypeId(faultLabel.messageTypeId)
                .messageTypeCode(faultLabel.messageTypeCode)
                .messageTypeName(faultLabel.messageTypeName)
                .messageTypeBelongs(faultLabel.messageTypeBelongs)
                .build();
    }
}
