package com.ruoyi.base.area.domain;

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.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * 行政区域对象 sys_cn_area
 *
 * @author ruoyi
 * @date 2023-06-25
 */
@Data
@TableName("sys_cn_area")
public class SysCnArea implements Serializable {

    private static final long serialVersionUID=1L;

    /**
     *
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 名称
     */
    private String label;
    /**
     * 行政编码
     */
    private String value;
    /**
     * 上级行政编码
     */
    private String parent;
    /**
     * 经度
     */
    private String longitude;
    /**
     * 维度
     */
    private String latitude;
    /**
     * 级别
     */
    private Integer level;

    /**
     * 首字母
     */
    private String initial;

    /**
     * 拼音
     */
    private String pinyin;

    @TableField(exist = false)
    private List<SysCnArea> children;


    @TableField(exist = false)
    @ApiModelProperty("商家数量")
    private Integer businessCount = 0 ;

    public SysCnArea()
    {}

    public final static  SysCnArea CN = new SysCnArea("中国","100000","","",0,"");

    public SysCnArea(String label,String value,String longitude,String latitude,Integer level,String parent)
    {
        this.label = label;
        this.value = value;
        this.longitude =longitude;
        this.latitude =latitude;
        this.level = level;
    }

}
