diff --git a/XCode/Code/EntityBuilder.cs b/XCode/Code/EntityBuilder.cs index 4a4e1cf4b..126ce8be9 100644 --- a/XCode/Code/EntityBuilder.cs +++ b/XCode/Code/EntityBuilder.cs @@ -1685,7 +1685,7 @@ public class EntityBuilder : ClassBuilder foreach (var dc in columns) { if (dc.DataType != null && dc.DataType.IsInt()) - WriteLine("if ({0} <= 0) return null;", dc.CamelName()); + WriteLine("if ({0} < 0) return null;", dc.CamelName()); else if (dc.DataType == typeof(String)) { if (nullable && dc.Nullable) @@ -1787,7 +1787,7 @@ public class EntityBuilder : ClassBuilder foreach (var dc in columns) { if (dc.DataType != null && dc.DataType.IsInt()) - WriteLine("if ({0} <= 0) return [];", dc.CamelName(), ClassName); + WriteLine("if ({0} < 0) return [];", dc.CamelName(), ClassName); else if (dc.DataType == typeof(String)) { if (Option.Nullable && dc.Nullable) diff --git a/XCode/Membership/xcodetool.exe b/XCode/Membership/xcodetool.exe index 73be8fc7b..48abd79b2 100644 Binary files a/XCode/Membership/xcodetool.exe and b/XCode/Membership/xcodetool.exe differ diff --git a/XUnitTest.XCode/Code/Entity/地区.cs b/XUnitTest.XCode/Code/Entity/地区.cs index ed70b3698..c51b90b02 100644 --- a/XUnitTest.XCode/Code/Entity/地区.cs +++ b/XUnitTest.XCode/Code/Entity/地区.cs @@ -266,7 +266,7 @@ public partial class Area : IArea, IEntity /// 实体对象 public static Area? FindByID(Int32 id) { - if (id <= 0) return null; + if (id < 0) return null; // 实体缓存 if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.ID == id); @@ -282,7 +282,7 @@ public partial class Area : IArea, IEntity /// 实体列表 public static IList FindAllByParentID(Int32 parentId) { - if (parentId <= 0) return []; + if (parentId < 0) return []; // 实体缓存 if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.ParentID == parentId); diff --git a/XUnitTest.XCode/Code/Entity/字典参数.cs b/XUnitTest.XCode/Code/Entity/字典参数.cs index bd3a33f4f..598a4d0ac 100644 --- a/XUnitTest.XCode/Code/Entity/字典参数.cs +++ b/XUnitTest.XCode/Code/Entity/字典参数.cs @@ -338,7 +338,7 @@ public partial class Parameter : IParameter, IEntity /// 实体对象 public static Parameter? FindByID(Int32 id) { - if (id <= 0) return null; + if (id < 0) return null; // 实体缓存 if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.ID == id); @@ -356,7 +356,7 @@ public partial class Parameter : IParameter, IEntity /// 实体对象 public static Parameter? FindByUserIDAndCategoryAndName(Int32 userId, String? category, String? name) { - if (userId <= 0) return null; + if (userId < 0) return null; if (category == null) return null; if (name == null) return null; @@ -371,7 +371,7 @@ public partial class Parameter : IParameter, IEntity /// 实体列表 public static IList FindAllByUserID(Int32 userId) { - if (userId <= 0) return []; + if (userId < 0) return []; // 实体缓存 if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.UserID == userId); @@ -385,7 +385,7 @@ public partial class Parameter : IParameter, IEntity /// 实体列表 public static IList FindAllByUserIDAndCategory(Int32 userId, String? category) { - if (userId <= 0) return []; + if (userId < 0) return []; if (category == null) return []; // 实体缓存 diff --git a/XUnitTest.XCode/Code/Entity/成员日志.cs b/XUnitTest.XCode/Code/Entity/成员日志.cs index 56477b2cd..4be3bd788 100644 --- a/XUnitTest.XCode/Code/Entity/成员日志.cs +++ b/XUnitTest.XCode/Code/Entity/成员日志.cs @@ -289,7 +289,7 @@ public partial class MemberLog : IMemberLog, IEntity /// 实体对象 public static MemberLog? FindByID(Int64 id) { - if (id <= 0) return null; + if (id < 0) return null; return Find(_.ID == id); } @@ -313,7 +313,7 @@ public partial class MemberLog : IMemberLog, IEntity public static IList FindAllByCategoryAndLinkID(String? category, Int32 linkId) { if (category == null) return []; - if (linkId <= 0) return []; + if (linkId < 0) return []; return FindAll(_.Category == category & _.LinkID == linkId); } @@ -323,7 +323,7 @@ public partial class MemberLog : IMemberLog, IEntity /// 实体列表 public static IList FindAllByCreateUserID(Int32 createUserId) { - if (createUserId <= 0) return []; + if (createUserId < 0) return []; return FindAll(_.CreateUserID == createUserId); } diff --git a/XUnitTest.XCode/Code/Entity/日志.cs b/XUnitTest.XCode/Code/Entity/日志.cs index 0b3e09dcd..31c231ea2 100644 --- a/XUnitTest.XCode/Code/Entity/日志.cs +++ b/XUnitTest.XCode/Code/Entity/日志.cs @@ -280,7 +280,7 @@ public partial class Log : ILog, IEntity /// 实体对象 public static Log? FindByID(Int64 id) { - if (id <= 0) return null; + if (id < 0) return null; return Find(_.ID == id); } @@ -304,7 +304,7 @@ public partial class Log : ILog, IEntity public static IList FindAllByCategoryAndLinkID(String? category, Int32 linkId) { if (category == null) return []; - if (linkId <= 0) return []; + if (linkId < 0) return []; return FindAll(_.Category == category & _.LinkID == linkId); } @@ -314,7 +314,7 @@ public partial class Log : ILog, IEntity /// 实体列表 public static IList FindAllByCreateUserID(Int32 createUserId) { - if (createUserId <= 0) return []; + if (createUserId < 0) return []; return FindAll(_.CreateUserID == createUserId); } diff --git a/XUnitTest.XCode/Code/Entity/用户.cs b/XUnitTest.XCode/Code/Entity/用户.cs index 7548f2d6b..9a105ce6d 100644 --- a/XUnitTest.XCode/Code/Entity/用户.cs +++ b/XUnitTest.XCode/Code/Entity/用户.cs @@ -475,7 +475,7 @@ public partial class User : IUser, IEntity /// 实体对象 public static User? FindByID(Int32 id) { - if (id <= 0) return null; + if (id < 0) return null; // 实体缓存 if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.ID == id); @@ -546,7 +546,7 @@ public partial class User : IUser, IEntity /// 实体列表 public static IList FindAllByRoleID(Int32 roleId) { - if (roleId <= 0) return []; + if (roleId < 0) return []; // 实体缓存 if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.RoleID == roleId); diff --git a/XUnitTest.XCode/Code/Entity/用户日志.cs b/XUnitTest.XCode/Code/Entity/用户日志.cs index 68acc2df0..8f7f32a06 100644 --- a/XUnitTest.XCode/Code/Entity/用户日志.cs +++ b/XUnitTest.XCode/Code/Entity/用户日志.cs @@ -291,7 +291,7 @@ public partial class UserLog : IUserLog, IEntity /// 实体对象 public static UserLog? FindByID(Int64 id) { - if (id <= 0) return null; + if (id < 0) return null; return Find(_.ID == id); } @@ -315,7 +315,7 @@ public partial class UserLog : IUserLog, IEntity public static IList FindAllByCategoryAndLinkID(String? category, Int32 linkId) { if (category == null) return []; - if (linkId <= 0) return []; + if (linkId < 0) return []; return FindAll(_.Category == category & _.LinkID == linkId); } @@ -325,7 +325,7 @@ public partial class UserLog : IUserLog, IEntity /// 实体列表 public static IList FindAllByCreateUserID(Int32 createUserId) { - if (createUserId <= 0) return []; + if (createUserId < 0) return []; return FindAll(_.CreateUserID == createUserId); } diff --git a/XUnitTest.XCode/Code/Entity/租户.cs b/XUnitTest.XCode/Code/Entity/租户.cs index aace8e214..76e5f87f2 100644 --- a/XUnitTest.XCode/Code/Entity/租户.cs +++ b/XUnitTest.XCode/Code/Entity/租户.cs @@ -256,7 +256,7 @@ public partial class Tenant : ITenant, IEntity /// 实体对象 public static Tenant? FindById(Int32 id) { - if (id <= 0) return null; + if (id < 0) return null; // 实体缓存 if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.Id == id); diff --git a/XUnitTest.XCode/Code/Entity/租户关系.cs b/XUnitTest.XCode/Code/Entity/租户关系.cs index eb7996413..1da2fa42e 100644 --- a/XUnitTest.XCode/Code/Entity/租户关系.cs +++ b/XUnitTest.XCode/Code/Entity/租户关系.cs @@ -229,7 +229,7 @@ public partial class TenantUser : ITenantUser, IEntity /// 实体对象 public static TenantUser? FindById(Int32 id) { - if (id <= 0) return null; + if (id < 0) return null; // 实体缓存 if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.Id == id); @@ -246,8 +246,8 @@ public partial class TenantUser : ITenantUser, IEntity /// 实体对象 public static TenantUser? FindByTenantIdAndUserId(Int32 tenantId, Int32 userId) { - if (tenantId <= 0) return null; - if (userId <= 0) return null; + if (tenantId < 0) return null; + if (userId < 0) return null; // 实体缓存 if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.TenantId == tenantId && e.UserId == userId); @@ -260,7 +260,7 @@ public partial class TenantUser : ITenantUser, IEntity /// 实体列表 public static IList FindAllByTenantId(Int32 tenantId) { - if (tenantId <= 0) return []; + if (tenantId < 0) return []; // 实体缓存 if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.TenantId == tenantId); @@ -273,7 +273,7 @@ public partial class TenantUser : ITenantUser, IEntity /// 实体列表 public static IList FindAllByUserId(Int32 userId) { - if (userId <= 0) return []; + if (userId < 0) return []; // 实体缓存 if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.UserId == userId); diff --git a/XUnitTest.XCode/Code/Entity/菜单.cs b/XUnitTest.XCode/Code/Entity/菜单.cs index 85a9075ad..e6d88712e 100644 --- a/XUnitTest.XCode/Code/Entity/菜单.cs +++ b/XUnitTest.XCode/Code/Entity/菜单.cs @@ -373,7 +373,7 @@ public partial class Menu : IMenu, IEntity /// 实体对象 public static Menu? FindByID(Int32 id) { - if (id <= 0) return null; + if (id < 0) return null; // 实体缓存 if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.ID == id); @@ -403,7 +403,7 @@ public partial class Menu : IMenu, IEntity /// 实体对象 public static Menu? FindByParentIDAndName(Int32 parentId, String name) { - if (parentId <= 0) return null; + if (parentId < 0) return null; if (name.IsNullOrEmpty()) return null; // 实体缓存 @@ -417,7 +417,7 @@ public partial class Menu : IMenu, IEntity /// 实体列表 public static IList FindAllByParentID(Int32 parentId) { - if (parentId <= 0) return []; + if (parentId < 0) return []; // 实体缓存 if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.ParentID == parentId); diff --git a/XUnitTest.XCode/Code/Entity/角色.cs b/XUnitTest.XCode/Code/Entity/角色.cs index fcf374f7e..33dc7548f 100644 --- a/XUnitTest.XCode/Code/Entity/角色.cs +++ b/XUnitTest.XCode/Code/Entity/角色.cs @@ -306,7 +306,7 @@ public partial class Role : IRole, IEntity /// 实体对象 public static Role? FindByID(Int32 id) { - if (id <= 0) return null; + if (id < 0) return null; // 实体缓存 if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.ID == id); diff --git a/XUnitTest.XCode/Code/Entity/部门.cs b/XUnitTest.XCode/Code/Entity/部门.cs index 462513802..163f0bce9 100644 --- a/XUnitTest.XCode/Code/Entity/部门.cs +++ b/XUnitTest.XCode/Code/Entity/部门.cs @@ -381,7 +381,7 @@ public partial class Department : IDepartment, IEntity /// 实体对象 public static Department? FindByID(Int32 id) { - if (id <= 0) return null; + if (id < 0) return null; // 实体缓存 if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.ID == id); @@ -411,7 +411,7 @@ public partial class Department : IDepartment, IEntity /// 实体列表 public static IList FindAllByParentIDAndName(Int32 parentId, String name) { - if (parentId <= 0) return []; + if (parentId < 0) return []; if (name.IsNullOrEmpty()) return []; // 实体缓存 @@ -438,7 +438,7 @@ public partial class Department : IDepartment, IEntity /// 实体列表 public static IList FindAllByTenantId(Int32 tenantId) { - if (tenantId <= 0) return []; + if (tenantId < 0) return []; // 实体缓存 if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.TenantId == tenantId); diff --git a/XUnitTest.XCode/Code/entity_log_normal.cs b/XUnitTest.XCode/Code/entity_log_normal.cs index e754978c1..f0e7efbf6 100644 --- a/XUnitTest.XCode/Code/entity_log_normal.cs +++ b/XUnitTest.XCode/Code/entity_log_normal.cs @@ -248,7 +248,7 @@ public partial class Log /// 实体对象 public static Log? FindByID(Int64 id) { - if (id <= 0) return null; + if (id < 0) return null; return Find(_.ID == id); } @@ -272,7 +272,7 @@ public partial class Log public static IList FindAllByCategoryAndLinkID(String? category, Int64 linkId) { if (category == null) return []; - if (linkId <= 0) return []; + if (linkId < 0) return []; return FindAll(_.Category == category & _.LinkID == linkId); } @@ -282,7 +282,7 @@ public partial class Log /// 实体列表 public static IList FindAllByCreateUserID(Int32 createUserId) { - if (createUserId <= 0) return []; + if (createUserId < 0) return []; return FindAll(_.CreateUserID == createUserId); } diff --git a/XUnitTest.XCode/Code/entity_user_normal.cs b/XUnitTest.XCode/Code/entity_user_normal.cs index 269353f6b..001860233 100644 --- a/XUnitTest.XCode/Code/entity_user_normal.cs +++ b/XUnitTest.XCode/Code/entity_user_normal.cs @@ -468,7 +468,7 @@ public partial class User /// 实体对象 public static User? FindByID(Int32 id) { - if (id <= 0) return null; + if (id < 0) return null; // 实体缓存 if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.ID == id); @@ -539,7 +539,7 @@ public partial class User /// 实体列表 public static IList FindAllByRoleID(Int32 roleId) { - if (roleId <= 0) return []; + if (roleId < 0) return []; // 实体缓存 if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.RoleID == roleId); @@ -552,7 +552,7 @@ public partial class User /// 实体列表 public static IList FindAllByDepartmentID(Int32 departmentId) { - if (departmentId <= 0) return []; + if (departmentId < 0) return []; // 实体缓存 if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.DepartmentID == departmentId); diff --git a/XUnitTest.XCode/Model/Code/entity_city.cs b/XUnitTest.XCode/Model/Code/entity_city.cs index 1e47e7a11..11a3cdc02 100644 --- a/XUnitTest.XCode/Model/Code/entity_city.cs +++ b/XUnitTest.XCode/Model/Code/entity_city.cs @@ -262,7 +262,7 @@ public partial class CorePerson /// 实体列表 public static IList FindAllByBuildID(Int32 buildId) { - if (buildId <= 0) return []; + if (buildId < 0) return []; // 实体缓存 if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.BuildID == buildId); diff --git a/XUnitTest.XCode/Model/Code/entity_city_biz.cs b/XUnitTest.XCode/Model/Code/entity_city_biz.cs index 20f849022..4aa1a5579 100644 --- a/XUnitTest.XCode/Model/Code/entity_city_biz.cs +++ b/XUnitTest.XCode/Model/Code/entity_city_biz.cs @@ -127,7 +127,7 @@ public partial class CorePerson : Entity /// 实体对象 public static CorePerson FindByPersonID(Int32 personId) { - if (personId <= 0) return null; + if (personId < 0) return null; // 实体缓存 if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.PersonID == personId); @@ -143,7 +143,7 @@ public partial class CorePerson : Entity /// 实体列表 public static IList FindAllByBuild_ID(Int32 build_ID) { - if (build_ID <= 0) return new List(); + if (build_ID < 0) return new List(); // 实体缓存 if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.Build_ID == build_ID);