优化 数据库模型

This commit is contained in:
小肥羊 2025-07-30 15:25:42 +08:00
parent 4276a2ba4a
commit 7075ec039d
3 changed files with 22 additions and 20 deletions

View File

@ -55,9 +55,10 @@ namespace Learn.Archives.Core.Model
/// <summary> /// <summary>
/// 学科成绩 /// 学科成绩
/// <para>json字符串 <see cref=" Dictionary(SubjectEnum,decimal)"/></para> /// <para>数据库JSON字段!!!</para>
/// </summary> /// </summary>
public string SubjectDic { get; set; } [SugarColumn(IsJson = true, ColumnDataType = "varchar(800)")]
public Dictionary<SubjectEnum, decimal>? SubjectDic { get; set; }
/// <summary> /// <summary>

View File

@ -1,4 +1,5 @@
using Learn.Archives.Core.Model.Interface; using Learn.Archives.Core.Model.Dto;
using Learn.Archives.Core.Model.Interface;
using SqlSugar; using SqlSugar;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Net; using System.Net;
@ -35,16 +36,6 @@ namespace Learn.Archives.Core.Model
/// </summary> /// </summary>
[SugarColumn(IsNullable = true)] [SugarColumn(IsNullable = true)]
public string? Remark { get; set; } public string? Remark { get; set; }
/// <summary>
/// 反馈问题数量
/// </summary>
public long FeedbackCount{ get; set; }
/// <summary>
/// 反馈问题已解决数量
/// </summary>
public long SolveFeedbackCount { get; set; }
/// <summary> /// <summary>
/// 赴校问题已解决 /// 赴校问题已解决
/// </summary> /// </summary>
@ -52,16 +43,16 @@ namespace Learn.Archives.Core.Model
/// <summary> /// <summary>
/// 反馈问题 /// 反馈问题
/// <para>序列化类型<see cref="Dto.FeedbackQuestionsDto[]"/></para> /// <para>数据库JSON字段!!!</para>
/// </summary> /// </summary>
[SugarColumn(IsNullable = true, ColumnDataType = "text")] [SugarColumn(IsNullable = true, IsJson = true,ColumnDataType ="text")]
public string? FeedbackQuestions { get; set; } public FeedbackQuestionsDto[]? FeedbackQuestions { get; set; }
/// <summary> /// <summary>
/// 解决方案的记录 /// 解决方案的记录
/// <para>序列化类型<see cref="Dto.SolutionRecordDto"/></para> /// <para>数据库JSON字段!!!</para>
/// </summary> /// </summary>
[SugarColumn(IsNullable = true, ColumnDataType = "text")] [SugarColumn(IsNullable = true, IsJson = true, ColumnDataType = "text")]
public string? SolutionRecord { get; set; } public SolutionRecordDto? SolutionRecord { get; set; }
/// <summary> /// <summary>
@ -74,6 +65,17 @@ namespace Learn.Archives.Core.Model
/// </summary> /// </summary>
[SugarColumn(IsNullable = true, Length = 1000)] [SugarColumn(IsNullable = true, Length = 1000)]
public string? ClassMeeting { get; set; } public string? ClassMeeting { get; set; }
/// <summary>
/// 反馈问题数量
/// </summary>
public long FeedbackCount => FeedbackQuestions?.Count() ?? 0;
/// <summary>
/// 反馈问题已解决数量
/// </summary>
public long SolveFeedbackCount => FeedbackQuestions?
.Count(s => s.EndTime != null) ?? 0;
/// <summary> /// <summary>
/// 开展过座谈 /// 开展过座谈
/// </summary> /// </summary>

View File

@ -32,6 +32,5 @@ namespace Learn.Archives.Core.Model
/// </summary> /// </summary>
public DateTime CreateTime { get; set; } = DateTime.Now; public DateTime CreateTime { get; set; } = DateTime.Now;
//todo 与产品确认赴校信息的流程来设计表
} }
} }