package com.sysu.admin.support.system.region;

import com.xiesx.fastboot.core.jpa.entity.JpaPlusEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import lombok.experimental.FieldNameConstants;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

/**
 * @title Area.java (generator)
 * @description 参数配置
 * @author 谢思贤
 * @date 2020-06-04
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@FieldNameConstants(innerTypeName = "FIELDS")
@Table(name = "sys_region")
@Entity
@EntityListeners(AuditingEntityListener.class)
@DynamicInsert
@DynamicUpdate
public class Region extends JpaPlusEntity<Region> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    /**
     * 代码
     */
    @Column
    private Long code;

    /**
     * 名称
     */
    @Column
    private String name;

    /**
     * 简称
     */
    @Column
    private String nameShort;

    /**
     * 级别
     */
    @Column
    private Integer level;


    /**
     * 经度
     */
    @Column
    private String lng;

    /**
     * 纬度
     */
    @Column
    private String lat;

    /**
     * 上级代码
     */
    @Column
    private Long parent;

    /**
     * 排序
     */
    @Column
    private Integer sort;
}
