package org.dromara.ems.base.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import cn.idev.excel.annotation.format.DateTimeFormat;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

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

/**
 * 统计单元信息对象 ems_base_work_unit
 * 
 * @author Yinq
 * @date 2024-05-09
 */
@ExcelIgnoreUnannotated
public class EmsBaseWorkUnit extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键标识 */
    private Long objId;

    /** 统计单元编号 */
    @ExcelProperty(value = "统计单元编号")
    private String workUnitCode;

    /** 统计单元名称 */
    @ExcelProperty(value = "统计单元名称")
    private String workUnitName;

    /** 统计区域 */
    @ExcelProperty(value = "统计区域")
    private String workUnitAddress;

    /** 排序 */
    @ExcelProperty(value = "排序")
    private Long workUnitSort;

    /** 产线/工位 */
    @ExcelProperty(value = "产线/工位")
    private String productLineCode;

    /** 统计单元类型（1建筑） */
    @ExcelProperty(value = "统计单元类型")
    private Long workUnitType;

    /** 启用标识(0启用 1停用) */
    @ExcelProperty(value = "启用标识(0启用 1停用)")
    private String isFlag;

    /** 创建人 */
    @ExcelProperty(value = "创建人")
    private String createdBy;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ExcelProperty(value = "创建时间")
    private Date createdTime;

    /** 更新人 */
    @ExcelProperty(value = "更新人")
    private String updatedBy;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ExcelProperty(value = "更新时间")
    private Date updatedTime;

    private List<EmsBaseWorkUnit> children = new ArrayList<EmsBaseWorkUnit>();

    private String parentName;

    private Long parentId;

    private Integer orderNum;

    private String ancestors;

    public List<EmsBaseWorkUnit> getChildren() {
        return children;
    }

    public void setChildren(List<EmsBaseWorkUnit> children) {
        this.children = children;
    }

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public Integer getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Integer orderNum) {
        this.orderNum = orderNum;
    }

    public String getAncestors() {
        return ancestors;
    }

    public void setAncestors(String ancestors) {
        this.ancestors = ancestors;
    }

    public void setObjId(Long objId)
    {
        this.objId = objId;
    }

    public Long getObjId() 
    {
        return objId;
    }
    public void setWorkUnitCode(String workUnitCode) 
    {
        this.workUnitCode = workUnitCode;
    }

    public String getWorkUnitCode() 
    {
        return workUnitCode;
    }
    public void setWorkUnitName(String workUnitName) 
    {
        this.workUnitName = workUnitName;
    }

    public String getWorkUnitName() 
    {
        return workUnitName;
    }
    public void setWorkUnitAddress(String workUnitAddress) 
    {
        this.workUnitAddress = workUnitAddress;
    }

    public String getWorkUnitAddress() 
    {
        return workUnitAddress;
    }
    public void setWorkUnitSort(Long workUnitSort) 
    {
        this.workUnitSort = workUnitSort;
    }

    public Long getWorkUnitSort() 
    {
        return workUnitSort;
    }
    public void setProductLineCode(String productLineCode) 
    {
        this.productLineCode = productLineCode;
    }

    public String getProductLineCode() 
    {
        return productLineCode;
    }
    public void setWorkUnitType(Long workUnitType) 
    {
        this.workUnitType = workUnitType;
    }

    public Long getWorkUnitType() 
    {
        return workUnitType;
    }
    public void setIsFlag(String isFlag) 
    {
        this.isFlag = isFlag;
    }

    public String getIsFlag() 
    {
        return isFlag;
    }
    public void setCreatedBy(String createdBy) 
    {
        this.createdBy = createdBy;
    }

    public String getCreatedBy() 
    {
        return createdBy;
    }
    public void setCreatedTime(Date createdTime) 
    {
        this.createdTime = createdTime;
    }

    public Date getCreatedTime() 
    {
        return createdTime;
    }
    public void setUpdatedBy(String updatedBy) 
    {
        this.updatedBy = updatedBy;
    }

    public String getUpdatedBy() 
    {
        return updatedBy;
    }
    public void setUpdatedTime(Date updatedTime) 
    {
        this.updatedTime = updatedTime;
    }

    public Date getUpdatedTime() 
    {
        return updatedTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("objId", getObjId())
            .append("workUnitCode", getWorkUnitCode())
            .append("parentId", getParentId())
            .append("workUnitName", getWorkUnitName())
            .append("workUnitAddress", getWorkUnitAddress())
            .append("ancestors", getAncestors())
            .append("workUnitSort", getWorkUnitSort())
            .append("productLineCode", getProductLineCode())
            .append("workUnitType", getWorkUnitType())
            .append("isFlag", getIsFlag())
            .append("createdBy", getCreatedBy())
            .append("createdTime", getCreatedTime())
            .append("updatedBy", getUpdatedBy())
            .append("updatedTime", getUpdatedTime())
            .toString();
    }
}
