package com.willalp.yiqing.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.willalp.common.annotation.Excel;
import com.willalp.common.core.domain.TreeEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 疫情地理地址对象 hs_yiqing_addr
 *
 * @author willalp
 * @date 2022-05-15
 */

@EqualsAndHashCode(callSuper = true)
@Data
@TableName("hs_yiqing_addr")
public class HsYiqingAddr extends TreeEntity {
    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    public String ancestors;
    @TableField(exist = false)
    protected Long parentId;
    /**
     * 主键
     */
    @TableId
    private String addrId;
    /**
     * 树ID
     */
    @Excel(name = "地址编号")
    private String addrTreeId;
    /**
     * 上级地址ID
     */
    @Excel(name = "上级地址编码")
    private String addrParentId;

    /**
     * 地址编号
     */
    private String addrNo;

    /**
     * 地址类型
     */
    @Excel(name = "地址类型", readConverterExp = "0=住宅区,1=方仓,2=集中隔离点,3=政府机构,4=居委会,5=其他")
    private String addrType;

    /**
     * 地址简称
     */
    @Excel(name = "属地/社区")
    private String addrName;

    /**
     * 门牌号
     */
    @Excel(name = "居委")
    private String houseNo;

    /**
     * 详细地址
     */
    @Excel(name = "详细地址")
    private String addrDetail;


    /**
     * 姓名
     */
    @Excel(name = "联系人")
    private String belongName;

    /**
     * 联系电话
     */
    @Excel(name = "联系电话")
    private String belongPhone;

    /**
     * 是否删除（0.未删除；1.已删除）
     */
    @TableLogic
    private Integer isDelete;

    @Override
    public String getId() {
        return addrId;
    }


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("addrId", getAddrId())
                .append("parentId", getParentId())
                .append("ancestors", getAncestors())
                .append("addrNo", getAddrNo())
                .append("addrType", getAddrType())
                .append("addrName", getAddrName())
                .append("addrDetail", getAddrDetail())
                .append("belongName", getBelongName())
                .append("belongPhone", getBelongPhone())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }
}
