/**
 * Copyright (c) 2018-2099, Chill Zhuang 庄骞 (bladejava@qq.com).
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.xiaoniu.subsystem.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.xiaoniu.common.core.annotation.Excel;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serial;
import java.util.Date;

/**
 * 单位管理表实体类
 *
 * @author sst
 * @since 2024-11-26
 */
@Data
@TableName("tb_unit")
@Accessors(chain = true)
@Schema(description = "单位管理表")
public class Unit {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 单位id
     */
    @Schema(description = "单位id")
    @TableId(value = "unit_id", type = IdType.AUTO)
    private Long unitId;
    /**
     * 单位名称
     */
    @Excel(name ="单位名称", headerColor = IndexedColors.RED, sort = 1)
    @Schema(description = "单位名称")
    private String unitName;
    /**
     * 单位代码
     */
    @Excel(name ="单位代码", headerColor = IndexedColors.RED, sort = 2)
    @Schema(description = "单位代码")
    private String unitCode;

    /**
     * 父单位id
     */
    @Schema(description = "父单位id")
    private Long parentId;
    /**
     * 父单位名称
     */
    @Excel(name ="父单位名称")
    @Schema(description = "父单位名称")
    private String parentName;
    /**
     * 父单位代码
     */
    @Excel(name ="父单位代码")
    @Schema(description = "父单位代码")
    private String parentCode;
    /**
     * 祖级列表
     */
    @Schema(description = "祖级列表")
    private String ancestors;
    /**
     * 旧单位代码
     */
    @Excel(name ="旧单位代码")
    @Schema(description = "旧单位代码")
    private String unitOldCode;
    /**
     * 单位简称
     */
    @Excel(name ="单位简称")
    @Schema(description = "单位简称")
    private String forShort;
    /**
     * 部队番号
     */
    @Excel(name ="部队番号")
    @Schema(description = "部队番号")
    private String unitDesignation;
    /**
     * 联系人
     */
    @Excel(name ="联系人")
    @Schema(description = "联系人")
    private String contactPerson;
    /**
     * 联系电话
     */
    @Excel(name ="联系电话")
    @Schema(description = "联系电话")
    private String phone;
    /**
     * 单位地址
     */
    @Excel(name ="单位地址")
    @Schema(description = "单位地址")
    private String address;
    /**
     * 邮政编码
     */
    @Excel(name ="邮政编码")
    @Schema(description = "邮政编码")
    private String postalCode;
    /**
     * 显示顺序
     */
    @Excel(name ="显示顺序")
    @Schema(description = "显示顺序")
    private Integer orderNum;
    /**
     * 类型（0机关单位 1承训单位）
     */
    @Schema(description = "类型（0机关单位 1承训单位）")
    private String type;
    /**
     * 备注/说明
     */
    @Excel(name ="备注/说明")
    @Schema(description = "备注/说明")
    private String remark;

    /**
     * 单位更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "单位更新时间")
    private Date unitUpdateTime;

    /**
     * 创建人
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(description = "创建人",hidden = true)
    private Long createUser;

    /**
     * 创建部门
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(description = "创建部门",hidden = true)
    private Long createDept;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建",hidden = true)
    private Date createTime;

    /**
     * 更新人
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(description = "更新人",hidden = true)
    private Long updateUser;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "更新时间",hidden = true)
    private Date updateTime;

    /**
     * 状态[0:正常]
     */
    @Schema(description = "业务状态")
    private Integer status;

    /**
     * 状态[0:未删除,1:删除]
     */
    @TableLogic
    @Schema(description = "是否已删除" , hidden = true)
    private Integer isDeleted;
}
