ChatRoomForGpt/ARW-net/ARW.Model/System/SysBase.cs
2023-04-04 18:15:13 +08:00

66 lines
2.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//using Dapper.Contrib.Extensions;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;
using SqlSugar;
using OfficeOpenXml.Attributes;
namespace ARW.Model.System
{
[EpplusTable(PrintHeaders = true, AutofitColumns = true, AutoCalculate = true, ShowTotal = true)]
public class SysBase
{
[SugarColumn(IsOnlyIgnoreUpdate = true)]//设置后修改不会有此字段
[JsonProperty(propertyName: "CreateBy")]
[EpplusIgnore]
public string Create_by { get; set; }
[SugarColumn(IsOnlyIgnoreUpdate = true)]//设置后修改不会有此字段
[JsonProperty(propertyName: "CreateTime")]
[EpplusTableColumn(NumberFormat = "yyyy-MM-dd HH:mm:ss")]
public DateTime Create_time { get; set; } = DateTime.Now;
[JsonIgnore]
[JsonProperty(propertyName: "UpdateBy")]
[SugarColumn(IsOnlyIgnoreInsert = true)]
[EpplusIgnore]
public string Update_by { get; set; }
//[JsonIgnore]
[SugarColumn(IsOnlyIgnoreInsert = true)]//设置后插入数据不会有此字段
[JsonProperty(propertyName: "UpdateTime")]
[EpplusIgnore]
public DateTime? Update_time { get; set; }
public string Remark { get; set; }
/// <summary>
/// 搜索时间起始时间
/// </summary>
/// <summary>
/// Write需穿一个bool值false时insertupdate等操作会忽略此列和Computed的作用差不多看了源码也没发现与Computed有什么不一样的地方有了解的朋友可以赐教下哈
/// ExplicitKey指定此列为主键不自动增长类型例如guidExplicitKey与Key地区别下面会详细讲
/// Key指定此列为主键自动增长主键可忽略忽略后默认查找
/// [Computed]计算属性打上此标签对象地insertupdate等操作会忽略此列
/// </summary>
[SugarColumn(IsIgnore = true)]
[JsonIgnore]
[EpplusIgnore]
public DateTime? BeginTime { get; set; }
/// <summary>
/// 用于搜索使用
/// </summary>
[SugarColumn(IsIgnore = true)]
[JsonIgnore]
[EpplusIgnore]
public DateTime? EndTime { get; set; }
[JsonProperty(propertyName: "IsDelete")]
[SugarColumn(IsNullable = true)]
[EpplusIgnore]
public bool IsDelete { get; set; }
}
}