package org.sky.scientific.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

/**
 * 所属二级单位/部门数据表
 */
@Data
@TableName("kd_department")
@Schema
public class DepartmentEntity implements Serializable {

	@Serial
	private static final long serialVersionUID = 1L;

	@Schema(description = "主键")
	@TableId(value = "id", type = IdType.ASSIGN_ID)
	private Long id;

	@Schema(description = "租户id")
	private String tenantId;

	@Schema(description = "所属年份，格式：yyyy")
	@NotNull(message = "参数yearAndMonth不能为空")
	private String yearAndMonth;

	@Schema(description = "父级单位id")
	private Long parentId;

	@Schema(description = "父级单位名称")
	@TableField(exist = false)
	private String parentName;

	@Schema(description = "名称")
	@NotNull(message = "请填写名称")
	private String name;



}
