/*
 * Author: wangjian
 * 生成entity
 */
package com.tofly.base.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.List;
import java.util.stream.Collectors;


/**
 * 分公司信息表
 *
 * @author admin
 * @date Tue Jan 18 00:00:00 CST 2022
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "TF_SMPN_COMPANY_X", resultMap = "companyMap")
@KeySequence("TF_SMPN_COMPANY_X")
@ApiModel
public class Company extends Model<Company> {
    private static final long serialVersionUID = 1L;

    /**
     * $column.comments
     */
    @TableId(value = "ID", type = IdType.INPUT)
    @ApiModelProperty(value = "$column.comments")
    private Long id;
    /**
     * 分公司名称
     */
    @ApiModelProperty(value = "分公司名称")
    private String companyName;
    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "CREATE_TIME", fill = FieldFill.INSERT)
    private Date createTime;
    /**
     * 修改时间
     */
    @ApiModelProperty(value = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "UPDATE_TIME", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    /**
     * 是否启用禁用 1启用 0禁用
     */
    @ApiModelProperty(value = "是否启用禁用 1启用 0禁用")
    private String statusFlag;
    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    @TableField(value = "CREATE_USER", fill = FieldFill.INSERT)
    private Long createUser;
    @ApiModelProperty(hidden = true)
    @TableField(exist = false)
    private String createUserName;
    /**
     * 总公司id
     */
    @ApiModelProperty(value = "总公司id")
    private Long parentId;

    @ApiModelProperty(value = "编码")
    private String coding;

    @ApiModelProperty(value = "地址")
    private String address;

    @ApiModelProperty(value = "联系电话")
    private String phone;

    @ApiModelProperty(value = "简称")
    private String abbreviation;

    @ApiModelProperty(value = "编码")
    private String code;

    @ApiModelProperty(value = "公司简介")
    private String companyRemark;

    @ApiModelProperty(value = "公司描述")
    private String companyDescribe;


    @ApiModelProperty(hidden = true)
    @TableField(exist = false)
    private List<Company> subCompany;
    @ApiModelProperty(hidden = true)
    @TableField(exist = false)
    private List<Department> deptVos;
}
