package com.heketai.website.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import java.io.Serializable;

/**
 * <p>
 * 产品分类
 * </p>
 *
 * @author xjl
 * @since 2019-12-16
 */
@Data
@TableName("product_category")
@ToString
@SuppressWarnings("all")
public class ProductCategory extends Model<ProductCategory> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 中文产品分类名称
     */
    @TableField("name_ch")
    private String nameCh;

    /**
     * 英文产品分类名称
     */
    @TableField("name_en")
    private String nameEn;

    /**
     * 父节点id
     */
    @TableField("parent_id")
    private Integer parentId;

    @TableField(exist = false)
    private String parentName;

    /**
     * 创建时间
     */
    @TableField("create_time")
    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    private String createTime;

    @ApiModelProperty("商品图")
    @TableField("img")
    private String img;

    /**
     * 更新时间
     */
    @TableField("update_time")
    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    private String updateTime;
    /**
     * 分类属性类型  0 产品明细  1 产品汇总
     */
    @TableField("is_summary")
    private Integer isSummary;

    @TableField("feature_en")
    private String featureEn;

    @TableField("feature_ch")
    private String featureCh;

    @TableField("desc_en")
    private String descEn;

    @TableField("desc_ch")
    private String descCh;

    @TableField("application_en")
    private String applicationEn;

    @TableField("application_ch")
    private String applicationCh;

    @TableField(exist = false)
    private Integer language;

    @TableField("sort")
    private Integer sort;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }


}
