package org.jeecg.modules.oroqen.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @Description: 产品分类
 * @Author: jeecg-boot
 * @Date: 2025-01-08
 * @Version: V1.0
 */
@Data
@TableName("oroqen_product_category")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description = "产品分类")
public class OroqenProductCategory implements Serializable {
    private static final long serialVersionUID = 1L;

    /**主键*/
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "主键")
    private String id;

    /**分类名称*/
    @Excel(name = "分类名称", width = 15)
    @Schema(description = "分类名称")
    @TableField("category_name")
    private String categoryName;

    /**分类编码*/
    @Excel(name = "分类编码", width = 15)
    @Schema(description = "分类编码")
    @TableField("category_code")
    private String categoryCode;

    /**父级ID*/
    @Excel(name = "父级ID", width = 15)
    @Schema(description = "父级ID")
    @TableField("parent_id")
    private String parentId;

    /**排序*/
    @Excel(name = "排序", width = 15)
    @Schema(description = "排序")
    @TableField("sort_order")
    private Integer sortOrder;

    /**描述*/
    @Excel(name = "描述", width = 15)
    @Schema(description = "描述")
    private String description;

    /**图标*/
    @Excel(name = "图标", width = 15)
    @Schema(description = "图标")
    private String icon;

    /**状态(0-禁用,1-启用)*/
    @Excel(name = "状态(0-禁用,1-启用)", width = 15)
    @Schema(description = "状态(0-禁用,1-启用)")
    private Integer status;

    /**创建人*/
    @Schema(description = "创建人")
    @TableField("create_by")
    private String createBy;

    /**创建日期*/
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建日期")
    @TableField("create_time")
    private Date createTime;

    /**更新人*/
    @Schema(description = "更新人")
    @TableField("update_by")
    private String updateBy;

    /**更新日期*/
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "更新日期")
    @TableField("update_time")
    private Date updateTime;

    /**子分类列表*/
    @Schema(description = "子分类列表")
    @TableField(exist = false)
    private List<OroqenProductCategory> children;
}