package com.gci.boot.modules.system.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.gci.boot.common.dict.annotation.Dict;
import com.gci.boot.common.dict.annotation.ExcelEnum;
import com.gci.boot.common.dict.excel.DictConverter;
import com.gci.boot.common.dict.excel.EnumConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 组织机构表
 * </p>
 *
 * @author chenzhiwei
 * @since 2023-09-01
 */
@Data
@TableName("sys_depart")
@ApiModel(value = "SysDepart对象", description = "组织机构表")
public class SysDepart implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("ID")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty("父机构ID")
    @Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
    @ExcelProperty(value = "父机构", converter = DictConverter.class)
    private String parentId;

    @ExcelProperty("机构名称")
    @ApiModelProperty("机构/部门名称")
    private String departName;

    @ExcelProperty("排序")
    @ApiModelProperty("排序")
    private Integer departOrder;

    @ExcelProperty("描述")
    @ApiModelProperty("描述")
    private String description;

    @ApiModelProperty("机构类别 1普通部门，2维修厂，3客户公司（租赁方），0根节点")
    @ExcelEnum("1_普通部门,2_维修厂,3_客户公司,0_根节点")
    @ExcelProperty(value = "机构类别", converter = EnumConverter.class)
    private Integer orgCategory;

    @ExcelProperty("机构编码")
    @ApiModelProperty("机构编码")
    private String orgCode;

    @ExcelProperty("联系电话")
    @ApiModelProperty("联系电话")
    private String mobile;

    @ExcelProperty("传真")
    @ApiModelProperty("传真")
    private String fax;

    @ExcelProperty("地址")
    @ApiModelProperty("地址")
    private String address;

    @ExcelProperty("备注")
    @ApiModelProperty("备注")
    private String memo;

    @ApiModelProperty("状态（1启用，0不启用）")
    @ExcelEnum("1_启用,0_不启用")
    @ExcelProperty(value = "状态", converter = EnumConverter.class)
    private Integer status;

    @ApiModelProperty("创建人")
    @ExcelIgnore
    private String createBy;

    @ApiModelProperty("创建日期")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ExcelIgnore
    private Date createTime;

    @ApiModelProperty("更新人")
    @ExcelIgnore
    private String updateBy;

    @ApiModelProperty("更新日期")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ExcelIgnore
    private Date updateTime;

}
