package com.bonus.canteen.core.nutrition.common.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@TableName("nutrient_reference_intake")
@ApiModel("膳食营养素参考摄入量 实体类")
public class NutrientReferenceIntake {
   @TableId("id")
   @ApiModelProperty("主键id")
   private String id;
   @TableField("cust_age")
   @ApiModelProperty("年龄")
   private Integer custAge;
   @TableField("cust_sex")
   @ApiModelProperty("性别 1-男 2-女")
   private @NotNull(
   message = "[性别 1-男 2-女]不能为空"
) Integer custSex;
   @TableField("activity_level")
   @ApiModelProperty("身体活动水平 1-轻 2-中 3-重")
   private @NotNull(
   message = "[身体活动水平 1-轻 2-中 3-重"
) Integer activityLevel;
   @TableField("calories")
   @ApiModelProperty("能量EER(kcal/d)")
   private @NotNull(
   message = "[能量EER(kcal/d)]不能为空"
) BigDecimal calories;
   @TableField("protein")
   @ApiModelProperty("蛋白质DRIs(g/d)")
   private @NotNull(
   message = "[蛋白质DRIs(g/d)]不能为空"
) BigDecimal protein;
   @TableField("fat")
   @ApiModelProperty("脂肪(g/d)")
   private @NotNull(
   message = "[脂肪(g/d)]不能为空"
) BigDecimal fat;
   @TableField("carbohydrate")
   @ApiModelProperty("碳水化合物(g/d)")
   private @NotNull(
   message = "[碳水化合物(g/d)]不能为空"
) BigDecimal carbohydrate;
   @TableField("calcium")
   @ApiModelProperty("钙(mg/d)")
   private @NotNull(
   message = "[钙(mg/d)]不能为空"
) BigDecimal calcium;
   @TableField("phosphorus")
   @ApiModelProperty("磷(mg/d)")
   private @NotNull(
   message = "[磷(mg/d)]不能为空"
) BigDecimal phosphorus;
   @TableField("kalium")
   @ApiModelProperty("钾(mg/d)")
   private @NotNull(
   message = "[钾(mg/d)]不能为空"
) BigDecimal kalium;
   @TableField("sodium")
   @ApiModelProperty("钠(mg/d)")
   private @NotNull(
   message = "[钠(mg/d)]不能为空"
) BigDecimal sodium;
   @TableField("magnesium")
   @ApiModelProperty("镁(mg/d)")
   private @NotNull(
   message = "[镁(mg/d)]不能为空"
) BigDecimal magnesium;
   @TableField("chlorine")
   @ApiModelProperty("氯(mg/d)")
   private @NotNull(
   message = "[氯(mg/d)]不能为空"
) BigDecimal chlorine;
   @TableField("iron")
   @ApiModelProperty("铁(mg/d)")
   private @NotNull(
   message = "[铁(mg/d)]不能为空"
) BigDecimal iron;
   @TableField("iodine")
   @ApiModelProperty("碘(ug/d)")
   private @NotNull(
   message = "[碘(ug/d)]不能为空"
) BigDecimal iodine;
   @TableField("zinc")
   @ApiModelProperty("锌(mg/d)")
   private @NotNull(
   message = "[锌(mg/d)]不能为空"
) BigDecimal zinc;
   @TableField("cuprum")
   @ApiModelProperty("铜(mg/d)")
   private @NotNull(
   message = "[铜(mg/d)]不能为空"
) BigDecimal cuprum;
   @TableField("manganese")
   @ApiModelProperty("锰(mg/d)")
   private @NotNull(
   message = "[锰(mg/d)]不能为空"
) BigDecimal manganese;
   @TableField("selenium")
   @ApiModelProperty("硒(μg/d)")
   private @NotNull(
   message = "[硒(μg/d)]不能为空"
) BigDecimal selenium;
   @TableField("fluorine")
   @ApiModelProperty("氟(mg/d)")
   private @NotNull(
   message = "[氟(mg/d)]不能为空"
) BigDecimal fluorine;
   @TableField("chromium")
   @ApiModelProperty("铬(μg/d)")
   private @NotNull(
   message = "[铬(μg/d)]不能为空"
) BigDecimal chromium;
   @TableField("molybdenum")
   @ApiModelProperty("钼(μg/d)")
   private @NotNull(
   message = "[钼(μg/d)]不能为空"
) BigDecimal molybdenum;
   @TableField("vitamin_a")
   @ApiModelProperty("维生素A(ugRAE/d)")
   private @NotNull(
   message = "[维生素A(ugRAE/d)]不能为空"
) BigDecimal vitaminA;
   @TableField("vitamin_b1")
   @ApiModelProperty("维生素B1(mg/d)")
   private @NotNull(
   message = "[维生素B1(mg/d)]不能为空"
) BigDecimal vitaminB1;
   @TableField("vitamin_b2")
   @ApiModelProperty("维生素B2(mg/d)")
   private @NotNull(
   message = "[维生素B2(mg/d)]不能为空"
) BigDecimal vitaminB2;
   @TableField("vitamin_b6")
   @ApiModelProperty("维生素B6(mg/d)")
   private @NotNull(
   message = "[维生素B6(mg/d)]不能为空"
) BigDecimal vitaminB6;
   @TableField("vitamin_b12")
   @ApiModelProperty("维生素B12(μg/d)")
   private @NotNull(
   message = "[维生素B12(μg/d)]不能为空"
) BigDecimal vitaminB12;
   @TableField("pantothenic_acid")
   @ApiModelProperty("泛酸(mg/d)")
   private @NotNull(
   message = "[泛酸(mg/d)]不能为空"
) BigDecimal pantothenicAcid;
   @TableField("vitamin_c")
   @ApiModelProperty("维生素C(mg/d)")
   private @NotNull(
   message = "[维生素C(mg/d)]不能为空"
) BigDecimal vitaminC;
   @TableField("vitamin_d")
   @ApiModelProperty("维生素D(ug/d)")
   private @NotNull(
   message = "[维生素D(ug/d)]不能为空"
) BigDecimal vitaminD;
   @TableField("vitamin_e")
   @ApiModelProperty("维生素E(mg/d)")
   private @NotNull(
   message = "[维生素E(mg/d)]不能为空"
) BigDecimal vitaminE;
   @TableField("vitamin_k")
   @ApiModelProperty("维生素K(ug/d)")
   private @NotNull(
   message = "[维生素K(ug/d)]不能为空"
) BigDecimal vitaminK;
   @TableField("folic")
   @ApiModelProperty("叶酸(ugDFE/d)")
   private @NotNull(
   message = "[叶酸(ugDFE/d)]不能为空"
) BigDecimal folic;
   @TableField("nicotinic_acid")
   @ApiModelProperty("烟酸(mg/d)")
   private @NotNull(
   message = "[烟酸(mg/d)]不能为空"
) BigDecimal nicotinicAcid;
   @TableField("nicotinamide")
   @ApiModelProperty("烟酰胺(mg/d)")
   private @NotNull(
   message = "[烟酰胺(mg/d)]不能为空"
) BigDecimal nicotinamide;
   @TableField("choline")
   @ApiModelProperty("胆碱(mg/d)")
   private @NotNull(
   message = "[胆碱(mg/d)]不能为空"
) BigDecimal choline;
   @TableField("biotin")
   @ApiModelProperty("生物素/维生素7(ug/d)")
   private @NotNull(
   message = "[生物素/维生素7(ug/d)]不能为空"
) BigDecimal biotin;
   @TableField("revision")
   @ApiModelProperty("乐观锁")
   private @NotNull(
   message = "[乐观锁]不能为空"
) Integer revision;
   @TableField("crby")
   @ApiModelProperty("创建人")
   private @NotBlank(
   message = "[创建人]不能为空"
) @Size(
   max = 32,
   message = "编码长度不能超过32"
) @Length(
   max = 32,
   message = "编码长度不能超过32"
) String crby;
   @TableField("crtime")
   @ApiModelProperty("创建时间")
   @DateTimeFormat(
      pattern = "yyyy-MM-dd HH:mm:ss"
   )
   private @NotNull(
   message = "[创建时间]不能为空"
) LocalDateTime crtime;
   @TableField("upby")
   @ApiModelProperty("更新人")
   private @NotBlank(
   message = "[更新人]不能为空"
) @Size(
   max = 32,
   message = "编码长度不能超过32"
) @Length(
   max = 32,
   message = "编码长度不能超过32"
) String upby;
   @TableField("uptime")
   @ApiModelProperty("更新时间")
   @DateTimeFormat(
      pattern = "yyyy-MM-dd HH:mm:ss"
   )
   private @NotNull(
   message = "[更新时间]不能为空"
) LocalDateTime uptime;

   public BigDecimal getNutrientValue(String nutrient) {
      switch (nutrient) {
         case "calories":
            return this.getCalories();
         case "protein":
            return this.getProtein();
         case "fat":
            return this.getFat();
         case "carbohydrate":
            return this.getCarbohydrate();
         case "calcium":
            return this.getCalcium();
         case "phosphorus":
            return this.getPhosphorus();
         case "kalium":
            return this.getKalium();
         case "sodium":
            return this.getSodium();
         case "magnesium":
            return this.getMagnesium();
         case "chlorine":
            return this.getChlorine();
         case "iron":
            return this.getIron();
         case "iodine":
            return this.getIodine();
         case "zinc":
            return this.getZinc();
         case "cuprum":
            return this.getCuprum();
         case "manganese":
            return this.getManganese();
         case "selenium":
            return this.getSelenium();
         case "fluorine":
            return this.getFluorine();
         case "chromium":
            return this.getChromium();
         case "molybdenum":
            return this.getMolybdenum();
         case "vitaminA":
            return this.getVitaminA();
         case "vitaminB1":
            return this.getVitaminB1();
         case "vitaminB2":
            return this.getVitaminB2();
         case "vitaminB6":
            return this.getVitaminB6();
         case "vitaminB12":
            return this.getVitaminB12();
         case "pantothenicAcid":
            return this.getPantothenicAcid();
         case "vitaminC":
            return this.getVitaminC();
         case "vitaminD":
            return this.getVitaminD();
         case "vitaminE":
            return this.getVitaminE();
         case "vitaminK":
            return this.getVitaminK();
         case "folic":
            return this.getFolic();
         case "nicotinicAcid":
            return this.getNicotinicAcid();
         case "nicotinamide":
            return this.getNicotinamide();
         case "choline":
            return this.getCholine();
         case "biotin":
            return this.getBiotin();
         default:
            return null;
      }
   }

   public NutrientReferenceIntake setNutrientValue(String nutrition, BigDecimal recomand) {
      switch (nutrition) {
         case "calories":
            return this.setCalories(recomand);
         case "protein":
            return this.setProtein(recomand);
         case "fat":
            return this.setFat(recomand);
         case "carbohydrate":
            return this.setCarbohydrate(recomand);
         case "calcium":
            return this.setCalcium(recomand);
         case "phosphorus":
            return this.setPhosphorus(recomand);
         case "kalium":
            return this.setKalium(recomand);
         case "sodium":
            return this.setSodium(recomand);
         case "magnesium":
            return this.setMagnesium(recomand);
         case "chlorine":
            return this.setChlorine(recomand);
         case "iron":
            return this.setIron(recomand);
         case "iodine":
            return this.setIodine(recomand);
         case "zinc":
            return this.setZinc(recomand);
         case "cuprum":
            return this.setCuprum(recomand);
         case "manganese":
            return this.setManganese(recomand);
         case "selenium":
            return this.setSelenium(recomand);
         case "fluorine":
            return this.setFluorine(recomand);
         case "chromium":
            return this.setChromium(recomand);
         case "molybdenum":
            return this.setMolybdenum(recomand);
         case "vitaminA":
            return this.setVitaminA(recomand);
         case "vitaminB1":
            return this.setVitaminB1(recomand);
         case "vitaminB2":
            return this.setVitaminB2(recomand);
         case "vitaminB6":
            return this.setVitaminB6(recomand);
         case "vitaminB12":
            return this.setVitaminB12(recomand);
         case "pantothenicAcid":
            return this.setPantothenicAcid(recomand);
         case "vitaminC":
            return this.setVitaminC(recomand);
         case "vitaminD":
            return this.setVitaminD(recomand);
         case "vitaminE":
            return this.setVitaminE(recomand);
         case "vitaminK":
            return this.setVitaminK(recomand);
         case "folic":
            return this.setFolic(recomand);
         case "nicotinicAcid":
            return this.setNicotinicAcid(recomand);
         case "nicotinamide":
            return this.setNicotinamide(recomand);
         case "choline":
            return this.setCholine(recomand);
         case "biotin":
            return this.setBiotin(recomand);
         default:
            return null;
      }
   }

   public String getId() {
      return this.id;
   }

   public Integer getCustAge() {
      return this.custAge;
   }

   public Integer getCustSex() {
      return this.custSex;
   }

   public Integer getActivityLevel() {
      return this.activityLevel;
   }

   public BigDecimal getCalories() {
      return this.calories;
   }

   public BigDecimal getProtein() {
      return this.protein;
   }

   public BigDecimal getFat() {
      return this.fat;
   }

   public BigDecimal getCarbohydrate() {
      return this.carbohydrate;
   }

   public BigDecimal getCalcium() {
      return this.calcium;
   }

   public BigDecimal getPhosphorus() {
      return this.phosphorus;
   }

   public BigDecimal getKalium() {
      return this.kalium;
   }

   public BigDecimal getSodium() {
      return this.sodium;
   }

   public BigDecimal getMagnesium() {
      return this.magnesium;
   }

   public BigDecimal getChlorine() {
      return this.chlorine;
   }

   public BigDecimal getIron() {
      return this.iron;
   }

   public BigDecimal getIodine() {
      return this.iodine;
   }

   public BigDecimal getZinc() {
      return this.zinc;
   }

   public BigDecimal getCuprum() {
      return this.cuprum;
   }

   public BigDecimal getManganese() {
      return this.manganese;
   }

   public BigDecimal getSelenium() {
      return this.selenium;
   }

   public BigDecimal getFluorine() {
      return this.fluorine;
   }

   public BigDecimal getChromium() {
      return this.chromium;
   }

   public BigDecimal getMolybdenum() {
      return this.molybdenum;
   }

   public BigDecimal getVitaminA() {
      return this.vitaminA;
   }

   public BigDecimal getVitaminB1() {
      return this.vitaminB1;
   }

   public BigDecimal getVitaminB2() {
      return this.vitaminB2;
   }

   public BigDecimal getVitaminB6() {
      return this.vitaminB6;
   }

   public BigDecimal getVitaminB12() {
      return this.vitaminB12;
   }

   public BigDecimal getPantothenicAcid() {
      return this.pantothenicAcid;
   }

   public BigDecimal getVitaminC() {
      return this.vitaminC;
   }

   public BigDecimal getVitaminD() {
      return this.vitaminD;
   }

   public BigDecimal getVitaminE() {
      return this.vitaminE;
   }

   public BigDecimal getVitaminK() {
      return this.vitaminK;
   }

   public BigDecimal getFolic() {
      return this.folic;
   }

   public BigDecimal getNicotinicAcid() {
      return this.nicotinicAcid;
   }

   public BigDecimal getNicotinamide() {
      return this.nicotinamide;
   }

   public BigDecimal getCholine() {
      return this.choline;
   }

   public BigDecimal getBiotin() {
      return this.biotin;
   }

   public Integer getRevision() {
      return this.revision;
   }

   public String getCrby() {
      return this.crby;
   }

   public LocalDateTime getCrtime() {
      return this.crtime;
   }

   public String getUpby() {
      return this.upby;
   }

   public LocalDateTime getUptime() {
      return this.uptime;
   }

   public NutrientReferenceIntake setId(final String id) {
      this.id = id;
      return this;
   }

   public NutrientReferenceIntake setCustAge(final Integer custAge) {
      this.custAge = custAge;
      return this;
   }

   public NutrientReferenceIntake setCustSex(final Integer custSex) {
      this.custSex = custSex;
      return this;
   }

   public NutrientReferenceIntake setActivityLevel(final Integer activityLevel) {
      this.activityLevel = activityLevel;
      return this;
   }

   public NutrientReferenceIntake setCalories(final BigDecimal calories) {
      this.calories = calories;
      return this;
   }

   public NutrientReferenceIntake setProtein(final BigDecimal protein) {
      this.protein = protein;
      return this;
   }

   public NutrientReferenceIntake setFat(final BigDecimal fat) {
      this.fat = fat;
      return this;
   }

   public NutrientReferenceIntake setCarbohydrate(final BigDecimal carbohydrate) {
      this.carbohydrate = carbohydrate;
      return this;
   }

   public NutrientReferenceIntake setCalcium(final BigDecimal calcium) {
      this.calcium = calcium;
      return this;
   }

   public NutrientReferenceIntake setPhosphorus(final BigDecimal phosphorus) {
      this.phosphorus = phosphorus;
      return this;
   }

   public NutrientReferenceIntake setKalium(final BigDecimal kalium) {
      this.kalium = kalium;
      return this;
   }

   public NutrientReferenceIntake setSodium(final BigDecimal sodium) {
      this.sodium = sodium;
      return this;
   }

   public NutrientReferenceIntake setMagnesium(final BigDecimal magnesium) {
      this.magnesium = magnesium;
      return this;
   }

   public NutrientReferenceIntake setChlorine(final BigDecimal chlorine) {
      this.chlorine = chlorine;
      return this;
   }

   public NutrientReferenceIntake setIron(final BigDecimal iron) {
      this.iron = iron;
      return this;
   }

   public NutrientReferenceIntake setIodine(final BigDecimal iodine) {
      this.iodine = iodine;
      return this;
   }

   public NutrientReferenceIntake setZinc(final BigDecimal zinc) {
      this.zinc = zinc;
      return this;
   }

   public NutrientReferenceIntake setCuprum(final BigDecimal cuprum) {
      this.cuprum = cuprum;
      return this;
   }

   public NutrientReferenceIntake setManganese(final BigDecimal manganese) {
      this.manganese = manganese;
      return this;
   }

   public NutrientReferenceIntake setSelenium(final BigDecimal selenium) {
      this.selenium = selenium;
      return this;
   }

   public NutrientReferenceIntake setFluorine(final BigDecimal fluorine) {
      this.fluorine = fluorine;
      return this;
   }

   public NutrientReferenceIntake setChromium(final BigDecimal chromium) {
      this.chromium = chromium;
      return this;
   }

   public NutrientReferenceIntake setMolybdenum(final BigDecimal molybdenum) {
      this.molybdenum = molybdenum;
      return this;
   }

   public NutrientReferenceIntake setVitaminA(final BigDecimal vitaminA) {
      this.vitaminA = vitaminA;
      return this;
   }

   public NutrientReferenceIntake setVitaminB1(final BigDecimal vitaminB1) {
      this.vitaminB1 = vitaminB1;
      return this;
   }

   public NutrientReferenceIntake setVitaminB2(final BigDecimal vitaminB2) {
      this.vitaminB2 = vitaminB2;
      return this;
   }

   public NutrientReferenceIntake setVitaminB6(final BigDecimal vitaminB6) {
      this.vitaminB6 = vitaminB6;
      return this;
   }

   public NutrientReferenceIntake setVitaminB12(final BigDecimal vitaminB12) {
      this.vitaminB12 = vitaminB12;
      return this;
   }

   public NutrientReferenceIntake setPantothenicAcid(final BigDecimal pantothenicAcid) {
      this.pantothenicAcid = pantothenicAcid;
      return this;
   }

   public NutrientReferenceIntake setVitaminC(final BigDecimal vitaminC) {
      this.vitaminC = vitaminC;
      return this;
   }

   public NutrientReferenceIntake setVitaminD(final BigDecimal vitaminD) {
      this.vitaminD = vitaminD;
      return this;
   }

   public NutrientReferenceIntake setVitaminE(final BigDecimal vitaminE) {
      this.vitaminE = vitaminE;
      return this;
   }

   public NutrientReferenceIntake setVitaminK(final BigDecimal vitaminK) {
      this.vitaminK = vitaminK;
      return this;
   }

   public NutrientReferenceIntake setFolic(final BigDecimal folic) {
      this.folic = folic;
      return this;
   }

   public NutrientReferenceIntake setNicotinicAcid(final BigDecimal nicotinicAcid) {
      this.nicotinicAcid = nicotinicAcid;
      return this;
   }

   public NutrientReferenceIntake setNicotinamide(final BigDecimal nicotinamide) {
      this.nicotinamide = nicotinamide;
      return this;
   }

   public NutrientReferenceIntake setCholine(final BigDecimal choline) {
      this.choline = choline;
      return this;
   }

   public NutrientReferenceIntake setBiotin(final BigDecimal biotin) {
      this.biotin = biotin;
      return this;
   }

   public NutrientReferenceIntake setRevision(final Integer revision) {
      this.revision = revision;
      return this;
   }

   public NutrientReferenceIntake setCrby(final String crby) {
      this.crby = crby;
      return this;
   }

   public NutrientReferenceIntake setCrtime(final LocalDateTime crtime) {
      this.crtime = crtime;
      return this;
   }

   public NutrientReferenceIntake setUpby(final String upby) {
      this.upby = upby;
      return this;
   }

   public NutrientReferenceIntake setUptime(final LocalDateTime uptime) {
      this.uptime = uptime;
      return this;
   }
}
