package com.shcd.enums;

import java.math.BigDecimal;
import java.util.Arrays;
import lombok.Getter;

@Getter
public enum AreaSortEnum {
  PD(1, "浦东新区", BigDecimal.valueOf(42), 5),
  QP(2, "青浦区", BigDecimal.valueOf(26), 8),
  MH(3, "闵行区", BigDecimal.valueOf(16), 2),
  SJ(4, "松江区", BigDecimal.valueOf(11), 7),
  JS(5, "金山区", BigDecimal.valueOf(37), 6),
  FX(6, "奉贤区", BigDecimal.valueOf(13), 9),
  JD(7, "嘉定区", BigDecimal.valueOf(38), 3),
  BS(8, "宝山区", BigDecimal.valueOf(29), 4),
  CM(9, "崇明区", BigDecimal.valueOf(52), 10),
  LG(10, "临港新片区", BigDecimal.valueOf(6), 11),
  SGNH(11, "市管内河", BigDecimal.valueOf(5), 1);


  private Integer owningArea;

  private String area;
  private BigDecimal operateMarinaNumber;
  private Integer sort;


  AreaSortEnum(Integer owningArea, String area, BigDecimal operateMarinaNumber, Integer sort) {
    this.owningArea = owningArea;
    this.area = area;
    this.operateMarinaNumber = operateMarinaNumber;
    this.sort = sort;
  }

  public static AreaSortEnum getByArea(String area) {
    return Arrays.stream(values()).filter(areaSortEnum -> areaSortEnum.getArea().equals(area))
        .findFirst().orElse(null);
  }
}
