1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package org.jeecg.modules.dnc.entity;
 
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
 
import java.util.ArrayList;
import java.util.List;
 
@Getter
@Data
@NoArgsConstructor
@TableName(value = "nc_product_mix")
public class ProductMix {
    // id
    private long id;
    // 父级 id
    @TableField(value = "parent_id")
    private long parentId;
    // 名称
    @TableField(value = "name")
    private String name;
    // code
    @TableField(value = "code")
    private String code;
    // 类型
    @TableField(value = "type")
    private String type;
 
    private transient List<ProductMix> children = new ArrayList<>();
 
    public ProductMix(long id, long parentId, String name, String code, String type) {
        this.id = id;
        this.parentId = parentId;
        this.name = name;
        this.code = code;
        this.type = type;
        this.children = new ArrayList<>();
    }
 
    public void addChild(ProductMix child) {
        this.children.add(child);
    }
 
}