86 lines
2.4 KiB
C#
86 lines
2.4 KiB
C#
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace YLErp.DBModels
|
|
{
|
|
[Table("correlation")]
|
|
public class CorrelationTable : DBModelWithOperator, IDataEntity, IDataTraceV2, IClonable<CorrelationTable>
|
|
{
|
|
public static string LogClass = "相关性数据表";
|
|
|
|
/// <summary>
|
|
/// 是否每日最后使用标签
|
|
/// </summary>
|
|
public const string LatestState = "latest";
|
|
public const string OldState = "old";
|
|
|
|
public bool IsLatest
|
|
{
|
|
get
|
|
{
|
|
return DayLastState == LatestState && ValueDate == DateTime.Now.Date;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// lastest为是每日最后一条
|
|
/// </summary>
|
|
[DisplayName("是否每日最后一条")]
|
|
public string DayLastState { get; set; }
|
|
|
|
[DisplayName("过期状态")]
|
|
public string LiveState { get; set; }
|
|
|
|
/// <summary>
|
|
/// 为当前使用或是历史,当前使用相同group应只有一条,一般是最新的是当前的
|
|
/// </summary>
|
|
[DisplayName("状态")]
|
|
public string State { get; set; }
|
|
|
|
/// <summary>
|
|
/// 标的资产信息1
|
|
/// </summary>
|
|
[DisplayName("标的资产信息1")]
|
|
public int? UnderlyingId1 { get; set; }
|
|
/// <summary>
|
|
/// 标的资产1
|
|
/// </summary>
|
|
[DisplayName("标的资产1")]
|
|
public string UnderlyingCode1 { get; set; }
|
|
/// <summary>
|
|
/// 标的资产信息2
|
|
/// </summary>
|
|
[DisplayName("标的资产信息2")]
|
|
public int? UnderlyingId2 { get; set; }
|
|
/// <summary>
|
|
/// 标的资产2
|
|
/// </summary>
|
|
[DisplayName("标的资产2")]
|
|
public string UnderlyingCode2 { get; set; }
|
|
/// <summary>
|
|
/// 估值日
|
|
/// </summary>
|
|
[DisplayName("估值日")]
|
|
public DateTime? ValueDate { get; set; }
|
|
/// <summary>
|
|
/// 相关性
|
|
/// </summary>
|
|
[DisplayName("相关性")]
|
|
public double? Correlation { get; set; }
|
|
|
|
public CorrelationTable Clone()
|
|
{
|
|
return (CorrelationTable)MemberwiseClone();
|
|
}
|
|
|
|
public string GetDataTraceKeyId()
|
|
{
|
|
return id.ToString();
|
|
}
|
|
|
|
public string GetDataTraceKeyInfo()
|
|
{
|
|
return $"相关性:{UnderlyingCode1},{UnderlyingCode2}";
|
|
}
|
|
}
|
|
}
|