using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JLHHJSvr.Com.Model
{
    public sealed class FormulaItem
    {
        /// <summary>
        /// 公式名
        /// </summary>
        public string formula_name { get; set; }
        /// <summary>
        /// 公式
        /// </summary>
        public string formula { get; set; }
        /// <summary>
        /// 转换后公式
        /// </summary>
        public string formula_transform { get; set; }
        /// <summary>
        /// 计算后值
        /// </summary>
        public decimal value { get; set; }
        /// <summary>
        /// 是否为常量
        /// </summary>
        public bool isConst { get; set; }
        /// <summary>
        /// 是否使用sql进行计算
        /// </summary>
        public bool isSql { get; set; }

        public override bool Equals(object o)
        {
            if (this == o)
            {
                return true;
            }
            //内存地址不相等，就得比属性
            if (o is FormulaItem)
            {
                FormulaItem item = (FormulaItem)o;
                return formula_name.Equals(item.formula_name);
            }
            return false;
        }

        public override int GetHashCode()
        {
            int hash = 17;
            hash = hash * 23 + formula_name.GetHashCode();
            return hash;
        }
    }
}
