diff --git a/ZR.CodeGenerator/CodeGeneratorTool.cs b/ZR.CodeGenerator/CodeGeneratorTool.cs index 599113e..cf74cb4 100644 --- a/ZR.CodeGenerator/CodeGeneratorTool.cs +++ b/ZR.CodeGenerator/CodeGeneratorTool.cs @@ -357,7 +357,7 @@ namespace ZR.CodeGenerator sDatatype = sDatatype.ToLower(); string sTempDatatype = sDatatype switch { - "int" or "number" or "integer" or "smallint" => "int", + "int" or "number" or "integer" or "smallint" or "int4" or "int8" or "int2" => "int", "bigint" => "long", "tinyint" => "byte", "numeric" or "real" or "float" => "float", diff --git a/ZR.Model/System/ArticleCategory.cs b/ZR.Model/System/ArticleCategory.cs index 5c7b27f..d10569b 100644 --- a/ZR.Model/System/ArticleCategory.cs +++ b/ZR.Model/System/ArticleCategory.cs @@ -19,8 +19,8 @@ namespace ZR.Model.System public int CategoryId { get; set; } public string Name { get; set; } public int ParentId { get; set; } - [SugarColumn(ColumnName = "create_time")] - public DateTime CreateTime { get; set; } + [SugarColumn(ColumnName = "create_time", IsNullable = true)] + public DateTime? CreateTime { get; set; } [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] [SugarColumn(IsIgnore = true)] diff --git a/ZR.Model/System/CommonLang.cs b/ZR.Model/System/CommonLang.cs index 99ee3fd..8f27bb0 100644 --- a/ZR.Model/System/CommonLang.cs +++ b/ZR.Model/System/CommonLang.cs @@ -7,9 +7,6 @@ namespace ZR.Model.Models { /// /// 多语言配置,数据实体对象 - /// - /// @author mr.zhao - /// @date 2022-05-06 /// [Tenant("0")] [SugarTable("sys_common_lang")] @@ -26,7 +23,7 @@ namespace ZR.Model.Models /// 语言code /// [DisplayName("语言code")] - [SugarColumn(ColumnName = "lang_code")] + [SugarColumn(ColumnName = "lang_code", IsNullable = false)] public string LangCode { get; set; } /// @@ -40,7 +37,7 @@ namespace ZR.Model.Models /// 名称 /// [DisplayName("名称")] - [SugarColumn(ColumnName = "lang_name")] + [SugarColumn(ColumnName = "lang_name", IsNullable = false)] public string LangName { get; set; } /// diff --git a/ZR.Model/System/SysBase.cs b/ZR.Model/System/SysBase.cs index 9750ab4..5e1f58c 100644 --- a/ZR.Model/System/SysBase.cs +++ b/ZR.Model/System/SysBase.cs @@ -8,33 +8,34 @@ namespace ZR.Model.System //[EpplusTable(PrintHeaders = true, AutofitColumns = true, AutoCalculate = true, ShowTotal = true)] public class SysBase { - [SugarColumn(IsOnlyIgnoreUpdate = true, Length = 64)] + [SugarColumn(IsOnlyIgnoreUpdate = true, Length = 64, IsNullable = true)] [JsonProperty(propertyName: "CreateBy")] [ExcelIgnore] public string Create_by { get; set; } - [SugarColumn(IsOnlyIgnoreUpdate = true)] + [SugarColumn(IsOnlyIgnoreUpdate = true, IsNullable = true)] [JsonProperty(propertyName: "CreateTime")] [ExcelColumn(Format = "yyyy-MM-dd HH:mm:ss")] public DateTime Create_time { get; set; } = DateTime.Now; [JsonIgnore] [JsonProperty(propertyName: "UpdateBy")] - [SugarColumn(IsOnlyIgnoreInsert = true, Length = 64)] + [SugarColumn(IsOnlyIgnoreInsert = true, Length = 64, IsNullable = true)] [ExcelIgnore] public string Update_by { get; set; } //[JsonIgnore] - [SugarColumn(IsOnlyIgnoreInsert = true)] + [SugarColumn(IsOnlyIgnoreInsert = true, IsNullable = true)] [JsonProperty(propertyName: "UpdateTime")] [ExcelIgnore] public DateTime? Update_time { get; set; } + [SugarColumn(Length = 500)] public string Remark { get; set; } - [SugarColumn(IsIgnore = true)] + [SugarColumn(IsIgnore = true, IsNullable = true)] [JsonIgnore] [ExcelIgnore] public DateTime? BeginTime { get; set; } - [SugarColumn(IsIgnore = true)] + [SugarColumn(IsIgnore = true, IsNullable = true)] [JsonIgnore] [ExcelIgnore] public DateTime? EndTime { get; set; } diff --git a/ZR.Model/System/SysUser.cs b/ZR.Model/System/SysUser.cs index 27c132d..e9d31ae 100644 --- a/ZR.Model/System/SysUser.cs +++ b/ZR.Model/System/SysUser.cs @@ -21,26 +21,26 @@ namespace ZR.Model.System /// /// 登录用户名 /// - [SugarColumn(Length = 30, ColumnDescription = "用户账号", ColumnDataType = "varchar")] + [SugarColumn(Length = 30, ColumnDescription = "用户账号", IsNullable = false)] public string UserName { get; set; } /// /// 用户昵称 /// - [SugarColumn(Length = 30, ColumnDescription = "用户昵称", ColumnDataType = "varchar")] + [SugarColumn(Length = 30, ColumnDescription = "用户昵称", IsNullable = false)] public string NickName { get; set; } /// /// 用户类型(00系统用户) /// - [SugarColumn(Length = 2, ColumnDescription = "用户类型(00系统用户)", ColumnDataType = "varchar", DefaultValue = "00")] + [SugarColumn(Length = 2, ColumnDescription = "用户类型(00系统用户)", DefaultValue = "00")] public string UserType { get; set; } = "00"; //[SugarColumn(IsOnlyIgnoreInsert = true)] public string Avatar { get; set; } - [SugarColumn(Length = 50, ColumnDescription = "用户邮箱", ColumnDataType = "varchar")] + [SugarColumn(Length = 50, ColumnDescription = "用户邮箱")] public string Email { get; set; } [JsonIgnore] [ExcelIgnore] - [SugarColumn(Length = 100, ColumnDescription = "密码", ColumnDataType = "varchar")] + [SugarColumn(Length = 100, ColumnDescription = "密码", IsNullable = false)] public string Password { get; set; } /// /// 手机号 @@ -55,12 +55,13 @@ namespace ZR.Model.System /// 帐号状态(0正常 1停用) /// [ExcelIgnore] + [SugarColumn(DefaultValue = "0")] public int Status { get; set; } /// /// 删除标志(0代表存在 2代表删除) /// - //[SugarColumn(IsOnlyIgnoreInsert = true)] + [SugarColumn(DefaultValue = "0")] public int DelFlag { get; set; } /// @@ -79,6 +80,7 @@ namespace ZR.Model.System /// /// 部门Id /// + [SugarColumn(DefaultValue = "0")] public long DeptId { get; set; } #region 表额外字段