2021-11-30 21:33:34 +08:00
|
|
|
|
using SqlSugar;
|
2021-09-18 16:10:34 +08:00
|
|
|
|
using System;
|
2021-11-30 21:33:34 +08:00
|
|
|
|
using System.Linq;
|
2021-09-17 18:19:53 +08:00
|
|
|
|
|
|
|
|
|
|
namespace ZR.Model.System.Generate
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 代码生成表字段
|
|
|
|
|
|
/// </summary>
|
2021-11-30 21:33:34 +08:00
|
|
|
|
[SugarTable("gen_table_column")]
|
|
|
|
|
|
[Tenant("0")]
|
2021-11-28 15:20:00 +08:00
|
|
|
|
public class GenTableColumn : SysBase
|
2021-09-17 18:19:53 +08:00
|
|
|
|
{
|
2021-11-30 21:33:34 +08:00
|
|
|
|
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
|
2021-09-17 18:19:53 +08:00
|
|
|
|
public int ColumnId { get; set; }
|
|
|
|
|
|
public string ColumnName { get; set; }
|
2021-11-30 21:33:34 +08:00
|
|
|
|
[SugarColumn(IsOnlyIgnoreUpdate = true)]
|
2021-09-17 18:19:53 +08:00
|
|
|
|
public int TableId { get; set; }
|
2021-09-18 16:10:34 +08:00
|
|
|
|
|
2021-11-30 21:33:34 +08:00
|
|
|
|
[SugarColumn(IsOnlyIgnoreUpdate = true)]
|
2021-09-17 18:19:53 +08:00
|
|
|
|
public string TableName { get; set; }
|
|
|
|
|
|
public string ColumnComment { get; set; }
|
2021-09-18 16:10:34 +08:00
|
|
|
|
|
2021-11-30 21:33:34 +08:00
|
|
|
|
[SugarColumn(IsOnlyIgnoreUpdate = true)]
|
2021-09-17 18:19:53 +08:00
|
|
|
|
public string ColumnType { get; set; }
|
|
|
|
|
|
public string CsharpType { get; set; }
|
|
|
|
|
|
public string CsharpField { get; set; }
|
2021-12-02 17:44:46 +08:00
|
|
|
|
[SugarColumn(IsIgnore = true)]
|
|
|
|
|
|
public string CsharpField2
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return CsharpField.Substring(0, 1).ToLower() + CsharpField[1..];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-09-18 16:10:34 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 是否主键(1是)
|
|
|
|
|
|
/// </summary>
|
2021-11-30 21:33:34 +08:00
|
|
|
|
[SugarColumn(IsOnlyIgnoreUpdate = true)]
|
2021-09-17 18:19:53 +08:00
|
|
|
|
public bool IsPk { get; set; }
|
2021-09-18 16:10:34 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 是否必填(1是)
|
|
|
|
|
|
/// </summary>
|
2021-09-17 18:19:53 +08:00
|
|
|
|
public bool IsRequired { get; set; }
|
2021-11-30 21:33:34 +08:00
|
|
|
|
[SugarColumn(IsOnlyIgnoreUpdate = true)]
|
2021-09-17 18:19:53 +08:00
|
|
|
|
public bool IsIncrement { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 是否插入
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool IsInsert { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 是否需要编辑
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool IsEdit { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// isList
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool IsList { get; set; }
|
|
|
|
|
|
public bool IsQuery { get; set; }
|
2021-09-18 16:10:34 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string HtmlType { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询类型(等于、不等于、大于、小于、范围)
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public string QueryType { get; set; } = "EQ";
|
2021-09-17 18:19:53 +08:00
|
|
|
|
public int Sort { get; set; }
|
2021-09-21 20:31:35 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 字典类型
|
|
|
|
|
|
/// </summary>
|
2021-12-02 17:44:46 +08:00
|
|
|
|
public string DictType { get; set; } = "";
|
2021-11-30 21:33:34 +08:00
|
|
|
|
|
|
|
|
|
|
#region 额外字段
|
|
|
|
|
|
[SugarColumn(IsIgnore = true)]
|
|
|
|
|
|
public string RequiredStr
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
string[] arr = new string[] { "int", "long" };
|
2021-12-02 17:44:46 +08:00
|
|
|
|
return (!IsRequired && (arr.Any(f => f.Contains(CsharpType))) || typeof(DateTime).Name == CsharpType) ? "?" : "";
|
2021-11-30 21:33:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-11-27 18:43:14 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 字典集合
|
|
|
|
|
|
/// </summary>
|
2021-11-28 15:20:00 +08:00
|
|
|
|
//[SqlSugar.SugarColumn(IsIgnore = true)]
|
|
|
|
|
|
//public List<SysDictData> DictDatas { get; set; }
|
2021-11-30 21:33:34 +08:00
|
|
|
|
#endregion
|
2021-09-17 18:19:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|