package com.ruoyi.index.domain;

import java.util.regex.Matcher;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.microsoft.sqlserver.jdbc.StringUtils;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 展示指标对象 index_v
 * 
 * @author ruoyi
 * @date 2021-12-28
 */
public class IndexV extends BaseEntity {
	private static final long serialVersionUID = 1L;

	/** ID */
	private Long id;

	/** 名称 */
	@Excel(name = "名称")
	private String name;

	/** 公式 */
	@Excel(name = "计算公式")
	private String formula;

	/** 公式 */
	@Excel(name = "展示公式")
	private String formula0;

	@Excel(name = "单位")
	private String unit;
	
	@Excel(name = "其他指标")
	private String others;

	@Excel(name = "年度指标")
	private Integer year;

	/** 说明 */
	@Excel(name = "说明")
	private String illustration;

	/** 删除标志（0代表存在 2代表删除） */
	private String delFlag;

	public void setId(Long id) {
		this.id = id;
	}

	public Long getId() {
		return id;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setFormula(String formula) {
		this.formula = formula;
	}

	public String getFormula() {
		return formula;
	}

	public String getFormula0() {
		if (StringUtils.isEmpty(formula0) && formula != null) {
			return formula.replaceAll("\\$\\{", "").replaceAll("\\}", "");
		}
		return formula0;
	}

	public void setFormula0(String formula0) {
		this.formula0 = formula0;
	}

	public void setIllustration(String illustration) {
		this.illustration = illustration;
	}

	public String getIllustration() {
		return illustration;
	}

	public void setDelFlag(String delFlag) {
		this.delFlag = delFlag;
	}

	public String getDelFlag() {
		return delFlag;
	}

	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	public Integer getYear() {
		return year;
	}

	public void setYear(Integer year) {
		this.year = year;
	}

	public String getOthers() {
		return others;
	}

	public void setOthers(String others) {
		this.others = others;
	}

	@Override
	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId()).append("name", getName())
				.append("formula", getFormula()).append("illustration", getIllustration()).append("remark", getRemark())
				.append("delFlag", getDelFlag()).append("createBy", getCreateBy()).append("createTime", getCreateTime())
				.append("updateBy", getUpdateBy()).append("updateTime", getUpdateTime()).toString();
	}
}
