package com.cf.imes.module.plan.dal.dataobject.orderParts;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cf.imes.framework.mybatis.core.dataobject.BaseDO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 生产单配件表 order_parts_{N} DO
 *
 * @author 晨丰科技
 */
@TableName("order_parts")
@KeySequence("order_parts_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库，可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class OrderPartsDO extends BaseDO {

    public OrderPartsDO(OrderPartsDO parts) {
        this.id = parts.getId();
        this.organId = parts.getOrganId();
        this.orderId = parts.getOrderId();
        this.goodsId = parts.getGoodsId();
        this.name = parts.getName();
        this.color = parts.getColor();
        this.material = parts.getMaterial();
        this.category = parts.getCategory();
        this.type = parts.getType();
        this.width = parts.getWidth();
        this.length = parts.getLength();
        this.thickness = parts.getThickness();
        this.model = parts.getModel();
        this.spec = parts.getSpec();
        this.brand = parts.getBrand();
        this.factory = parts.getFactory();
        this.unit = parts.getUnit();
        this.price = parts.getPrice();
        this.isComposite = parts.getIsComposite();
        this.subparts = parts.getSubparts();
        this.remark = parts.getRemark();
        this.deleted = parts.getDeleted();
        this.setCreateTime(parts.getCreateTime());
        this.setUpdateTime(parts.getUpdateTime());
        this.setCreator(parts.getCreator());
        this.setUpdater(parts.getUpdater());
    }

    /**
     * 配件 ID
     */
    @TableId
    private Long id;
    // 组织 ID
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long organId;
    /**
     * 生产单号
     */
    private Long orderId;
    /**
     * 商品ID
     */
    private String goodsId;
    /**
     * 配件名称
     */
    private String name;
    /**
     * 颜色
     */
    private String color;
    /**
     * 材质
     */
    private String material;
    /**
     * 配件类型
     */
    private String category;
    /**
     * 配件子类
     */
    private String type;
    /**
     * 宽度
     */
    private Double width;
    /**
     * 长度
     */
    private Double length;
    /**
     * 厚度
     */
    private Double thickness;
    /**
     * 型号
     */
    private String model;
    /**
     * 规格
     */
    private String spec;
    /**
     * 品牌
     */
    private String brand;
    /**
     * 厂家
     */
    private String factory;
    /**
     * 单位
     */
    private String unit;
    /**
     * 价格
     */
    private Double price;
    /**
     * 是否复合部件：0 否 1 是
     */
    private Boolean isComposite;
    /**
     * 子配件ID列表,复合部件时记录子配件ID,半角逗号分隔
     */
    private String subparts;
    /**
     * 备注
     */
    private String remark;
    /**
     * 是否删除
     */
    private Boolean deleted;

}