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

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tofly.mybatisplus.config.ToflySqlCondition;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

/**
 * 部门表
 *
 * @author wangjian
 * @date Mon Oct 21 00:00:00 CST 2019
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "TF_SMPN_DEPARTMENT_X", resultMap = "departmentMap")
@KeySequence("TF_SMPN_DEPARTMENT_X")
@ApiModel
public class Department extends Model<Department> {
    private static final long serialVersionUID = 1L;

    /**
     * 部门ID，主键
     */
    @TableId(value = "ID", type = IdType.INPUT)
    @ApiModelProperty(value = "部门ID，主键")
    private Long id;
    /**
     * 部门名称
     */
    @ApiModelProperty(value = "部门名称")
    @TableField(condition = ToflySqlCondition.LIKE)
    private String name;
    /**
     * 排序号
     */
    @ApiModelProperty(value = "排序号")
    private Integer sort;
    /**
     * 创建时间
     */
    @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启用 2禁用
     */
    @ApiModelProperty(value = "是否启用禁用 1启用 2禁用")
    private String statusFlag;
    /**
     * 父级部门ID
     */
    @ApiModelProperty(value = "父级部门ID")
    private Integer parentId;
    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    @TableField(value = "CREATE_USER", fill = FieldFill.INSERT)
    private Long createUser;

    @ApiModelProperty(value = "创建人",hidden = true)
    private String userName;
    /**
     * 机构编码
     */
    @ApiModelProperty(value = "机构编码")
    @TableField(condition = ToflySqlCondition.LIKE)
    private String code;

    @ApiModelProperty(value = "单位简称")
    @TableField(condition = ToflySqlCondition.LIKE)
    private String shortName;

    @TableField(exist = false)
    @ApiModelProperty(value = "父级部门")
    private String parentName;

    @ApiModelProperty(value = "标志")
    private String statusName;

    @ApiModelProperty(value = "公司id")
    private Long companyId;
    @ApiModelProperty(value = "公司名称")
    @TableField(exist = false)
    private String companyName;
    @ApiModelProperty(value = "联系电话")
    private String phone;

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