| | |
| | | import jakarta.persistence.Entity; |
| | | import jakarta.persistence.Transient; |
| | | import lombok.Data; |
| | | import org.hibernate.annotations.Comment; |
| | | import jakarta.persistence.Table; |
| | | |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author wjli |
| | | * @author |
| | | * @description |
| | | * @date 2026/4/29 10:51 |
| | | **/ |
| | | @Data |
| | | @Entity |
| | | @Table(name = "product") |
| | | @Comment("产品信息") |
| | | @Entity//加了才能自动生成表 |
| | | @org.hibernate.annotations.Table(appliesTo="product",comment = "产品")//给表加注释 |
| | | @jakarta.persistence.Table(name = "product")//数据库创建的表明 |
| | | public class Product extends BaseModel<Product> { |
| | | |
| | | //产品名称、产品编码(主数据、ERP)、产品价格、税点、所属上级 |
| | | @Schema(description = "产品名称") |
| | | @Column(columnDefinition = "VARCHAR(50) comment '产品名称'") |
| | | @Column(columnDefinition = "VARCHAR(512) comment '产品名称'") |
| | | private String productName; |
| | | |
| | | @Schema(description = "产品集团编码") |
| | |
| | | @Column(columnDefinition = "VARCHAR(50) comment '产品型号'") |
| | | private String productType; |
| | | |
| | | @Schema(description = "产品价格") |
| | | /* @Schema(description = "产品价格") |
| | | @Column(columnDefinition = "double comment '产品价格'") |
| | | private Double price; |
| | | private Double price;*/ |
| | | |
| | | @Schema(description = "税率(百分比,如13表示13%)") |
| | | @Column(columnDefinition = "double default 0.00 comment '税率'") |
| | |
| | | @Column(columnDefinition = "VARCHAR(50) comment '税收分类'") |
| | | private String taxClass; |
| | | |
| | | @Schema(description = "税收编码") |
| | | @Column(columnDefinition = "VARCHAR(80) comment '税收编码'") |
| | | private String taxCode; |
| | | |
| | | @Schema(description = "父ID") |
| | | @Column(columnDefinition = "bigint default 0 comment '父ID'") |
| | | private Long parentId; |
| | | |
| | | @Schema(description = "父名称") |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private String parentName; |
| | | |
| | | /** |
| | | * 标的物 |
| | |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private List<Product> children; |
| | | |
| | | /** |
| | | * 标的物 |
| | | */ |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private Integer childNum; |
| | | } |