[fix]代码生成器,数字字段为0有意义
This commit is contained in:
parent
9dcd39afe1
commit
8ad43ea1a0
|
@ -1685,7 +1685,7 @@ public class EntityBuilder : ClassBuilder
|
||||||
foreach (var dc in columns)
|
foreach (var dc in columns)
|
||||||
{
|
{
|
||||||
if (dc.DataType != null && dc.DataType.IsInt())
|
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))
|
else if (dc.DataType == typeof(String))
|
||||||
{
|
{
|
||||||
if (nullable && dc.Nullable)
|
if (nullable && dc.Nullable)
|
||||||
|
@ -1787,7 +1787,7 @@ public class EntityBuilder : ClassBuilder
|
||||||
foreach (var dc in columns)
|
foreach (var dc in columns)
|
||||||
{
|
{
|
||||||
if (dc.DataType != null && dc.DataType.IsInt())
|
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))
|
else if (dc.DataType == typeof(String))
|
||||||
{
|
{
|
||||||
if (Option.Nullable && dc.Nullable)
|
if (Option.Nullable && dc.Nullable)
|
||||||
|
|
Binary file not shown.
|
@ -266,7 +266,7 @@ public partial class Area : IArea, IEntity<IArea>
|
||||||
/// <returns>实体对象</returns>
|
/// <returns>实体对象</returns>
|
||||||
public static Area? FindByID(Int32 id)
|
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);
|
if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.ID == id);
|
||||||
|
@ -282,7 +282,7 @@ public partial class Area : IArea, IEntity<IArea>
|
||||||
/// <returns>实体列表</returns>
|
/// <returns>实体列表</returns>
|
||||||
public static IList<Area> FindAllByParentID(Int32 parentId)
|
public static IList<Area> FindAllByParentID(Int32 parentId)
|
||||||
{
|
{
|
||||||
if (parentId <= 0) return [];
|
if (parentId < 0) return [];
|
||||||
|
|
||||||
// 实体缓存
|
// 实体缓存
|
||||||
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.ParentID == parentId);
|
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.ParentID == parentId);
|
||||||
|
|
|
@ -338,7 +338,7 @@ public partial class Parameter : IParameter, IEntity<IParameter>
|
||||||
/// <returns>实体对象</returns>
|
/// <returns>实体对象</returns>
|
||||||
public static Parameter? FindByID(Int32 id)
|
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);
|
if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.ID == id);
|
||||||
|
@ -356,7 +356,7 @@ public partial class Parameter : IParameter, IEntity<IParameter>
|
||||||
/// <returns>实体对象</returns>
|
/// <returns>实体对象</returns>
|
||||||
public static Parameter? FindByUserIDAndCategoryAndName(Int32 userId, String? category, String? name)
|
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 (category == null) return null;
|
||||||
if (name == null) return null;
|
if (name == null) return null;
|
||||||
|
|
||||||
|
@ -371,7 +371,7 @@ public partial class Parameter : IParameter, IEntity<IParameter>
|
||||||
/// <returns>实体列表</returns>
|
/// <returns>实体列表</returns>
|
||||||
public static IList<Parameter> FindAllByUserID(Int32 userId)
|
public static IList<Parameter> FindAllByUserID(Int32 userId)
|
||||||
{
|
{
|
||||||
if (userId <= 0) return [];
|
if (userId < 0) return [];
|
||||||
|
|
||||||
// 实体缓存
|
// 实体缓存
|
||||||
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.UserID == userId);
|
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.UserID == userId);
|
||||||
|
@ -385,7 +385,7 @@ public partial class Parameter : IParameter, IEntity<IParameter>
|
||||||
/// <returns>实体列表</returns>
|
/// <returns>实体列表</returns>
|
||||||
public static IList<Parameter> FindAllByUserIDAndCategory(Int32 userId, String? category)
|
public static IList<Parameter> FindAllByUserIDAndCategory(Int32 userId, String? category)
|
||||||
{
|
{
|
||||||
if (userId <= 0) return [];
|
if (userId < 0) return [];
|
||||||
if (category == null) return [];
|
if (category == null) return [];
|
||||||
|
|
||||||
// 实体缓存
|
// 实体缓存
|
||||||
|
|
|
@ -289,7 +289,7 @@ public partial class MemberLog : IMemberLog, IEntity<IMemberLog>
|
||||||
/// <returns>实体对象</returns>
|
/// <returns>实体对象</returns>
|
||||||
public static MemberLog? FindByID(Int64 id)
|
public static MemberLog? FindByID(Int64 id)
|
||||||
{
|
{
|
||||||
if (id <= 0) return null;
|
if (id < 0) return null;
|
||||||
|
|
||||||
return Find(_.ID == id);
|
return Find(_.ID == id);
|
||||||
}
|
}
|
||||||
|
@ -313,7 +313,7 @@ public partial class MemberLog : IMemberLog, IEntity<IMemberLog>
|
||||||
public static IList<MemberLog> FindAllByCategoryAndLinkID(String? category, Int32 linkId)
|
public static IList<MemberLog> FindAllByCategoryAndLinkID(String? category, Int32 linkId)
|
||||||
{
|
{
|
||||||
if (category == null) return [];
|
if (category == null) return [];
|
||||||
if (linkId <= 0) return [];
|
if (linkId < 0) return [];
|
||||||
|
|
||||||
return FindAll(_.Category == category & _.LinkID == linkId);
|
return FindAll(_.Category == category & _.LinkID == linkId);
|
||||||
}
|
}
|
||||||
|
@ -323,7 +323,7 @@ public partial class MemberLog : IMemberLog, IEntity<IMemberLog>
|
||||||
/// <returns>实体列表</returns>
|
/// <returns>实体列表</returns>
|
||||||
public static IList<MemberLog> FindAllByCreateUserID(Int32 createUserId)
|
public static IList<MemberLog> FindAllByCreateUserID(Int32 createUserId)
|
||||||
{
|
{
|
||||||
if (createUserId <= 0) return [];
|
if (createUserId < 0) return [];
|
||||||
|
|
||||||
return FindAll(_.CreateUserID == createUserId);
|
return FindAll(_.CreateUserID == createUserId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -280,7 +280,7 @@ public partial class Log : ILog, IEntity<ILog>
|
||||||
/// <returns>实体对象</returns>
|
/// <returns>实体对象</returns>
|
||||||
public static Log? FindByID(Int64 id)
|
public static Log? FindByID(Int64 id)
|
||||||
{
|
{
|
||||||
if (id <= 0) return null;
|
if (id < 0) return null;
|
||||||
|
|
||||||
return Find(_.ID == id);
|
return Find(_.ID == id);
|
||||||
}
|
}
|
||||||
|
@ -304,7 +304,7 @@ public partial class Log : ILog, IEntity<ILog>
|
||||||
public static IList<Log> FindAllByCategoryAndLinkID(String? category, Int32 linkId)
|
public static IList<Log> FindAllByCategoryAndLinkID(String? category, Int32 linkId)
|
||||||
{
|
{
|
||||||
if (category == null) return [];
|
if (category == null) return [];
|
||||||
if (linkId <= 0) return [];
|
if (linkId < 0) return [];
|
||||||
|
|
||||||
return FindAll(_.Category == category & _.LinkID == linkId);
|
return FindAll(_.Category == category & _.LinkID == linkId);
|
||||||
}
|
}
|
||||||
|
@ -314,7 +314,7 @@ public partial class Log : ILog, IEntity<ILog>
|
||||||
/// <returns>实体列表</returns>
|
/// <returns>实体列表</returns>
|
||||||
public static IList<Log> FindAllByCreateUserID(Int32 createUserId)
|
public static IList<Log> FindAllByCreateUserID(Int32 createUserId)
|
||||||
{
|
{
|
||||||
if (createUserId <= 0) return [];
|
if (createUserId < 0) return [];
|
||||||
|
|
||||||
return FindAll(_.CreateUserID == createUserId);
|
return FindAll(_.CreateUserID == createUserId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -475,7 +475,7 @@ public partial class User : IUser, IEntity<IUser>
|
||||||
/// <returns>实体对象</returns>
|
/// <returns>实体对象</returns>
|
||||||
public static User? FindByID(Int32 id)
|
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);
|
if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.ID == id);
|
||||||
|
@ -546,7 +546,7 @@ public partial class User : IUser, IEntity<IUser>
|
||||||
/// <returns>实体列表</returns>
|
/// <returns>实体列表</returns>
|
||||||
public static IList<User> FindAllByRoleID(Int32 roleId)
|
public static IList<User> FindAllByRoleID(Int32 roleId)
|
||||||
{
|
{
|
||||||
if (roleId <= 0) return [];
|
if (roleId < 0) return [];
|
||||||
|
|
||||||
// 实体缓存
|
// 实体缓存
|
||||||
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.RoleID == roleId);
|
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.RoleID == roleId);
|
||||||
|
|
|
@ -291,7 +291,7 @@ public partial class UserLog : IUserLog, IEntity<IUserLog>
|
||||||
/// <returns>实体对象</returns>
|
/// <returns>实体对象</returns>
|
||||||
public static UserLog? FindByID(Int64 id)
|
public static UserLog? FindByID(Int64 id)
|
||||||
{
|
{
|
||||||
if (id <= 0) return null;
|
if (id < 0) return null;
|
||||||
|
|
||||||
return Find(_.ID == id);
|
return Find(_.ID == id);
|
||||||
}
|
}
|
||||||
|
@ -315,7 +315,7 @@ public partial class UserLog : IUserLog, IEntity<IUserLog>
|
||||||
public static IList<UserLog> FindAllByCategoryAndLinkID(String? category, Int32 linkId)
|
public static IList<UserLog> FindAllByCategoryAndLinkID(String? category, Int32 linkId)
|
||||||
{
|
{
|
||||||
if (category == null) return [];
|
if (category == null) return [];
|
||||||
if (linkId <= 0) return [];
|
if (linkId < 0) return [];
|
||||||
|
|
||||||
return FindAll(_.Category == category & _.LinkID == linkId);
|
return FindAll(_.Category == category & _.LinkID == linkId);
|
||||||
}
|
}
|
||||||
|
@ -325,7 +325,7 @@ public partial class UserLog : IUserLog, IEntity<IUserLog>
|
||||||
/// <returns>实体列表</returns>
|
/// <returns>实体列表</returns>
|
||||||
public static IList<UserLog> FindAllByCreateUserID(Int32 createUserId)
|
public static IList<UserLog> FindAllByCreateUserID(Int32 createUserId)
|
||||||
{
|
{
|
||||||
if (createUserId <= 0) return [];
|
if (createUserId < 0) return [];
|
||||||
|
|
||||||
return FindAll(_.CreateUserID == createUserId);
|
return FindAll(_.CreateUserID == createUserId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -256,7 +256,7 @@ public partial class Tenant : ITenant, IEntity<ITenant>
|
||||||
/// <returns>实体对象</returns>
|
/// <returns>实体对象</returns>
|
||||||
public static Tenant? FindById(Int32 id)
|
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);
|
if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.Id == id);
|
||||||
|
|
|
@ -229,7 +229,7 @@ public partial class TenantUser : ITenantUser, IEntity<ITenantUser>
|
||||||
/// <returns>实体对象</returns>
|
/// <returns>实体对象</returns>
|
||||||
public static TenantUser? FindById(Int32 id)
|
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);
|
if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.Id == id);
|
||||||
|
@ -246,8 +246,8 @@ public partial class TenantUser : ITenantUser, IEntity<ITenantUser>
|
||||||
/// <returns>实体对象</returns>
|
/// <returns>实体对象</returns>
|
||||||
public static TenantUser? FindByTenantIdAndUserId(Int32 tenantId, Int32 userId)
|
public static TenantUser? FindByTenantIdAndUserId(Int32 tenantId, Int32 userId)
|
||||||
{
|
{
|
||||||
if (tenantId <= 0) return null;
|
if (tenantId < 0) return null;
|
||||||
if (userId <= 0) return null;
|
if (userId < 0) return null;
|
||||||
|
|
||||||
// 实体缓存
|
// 实体缓存
|
||||||
if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.TenantId == tenantId && e.UserId == userId);
|
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<ITenantUser>
|
||||||
/// <returns>实体列表</returns>
|
/// <returns>实体列表</returns>
|
||||||
public static IList<TenantUser> FindAllByTenantId(Int32 tenantId)
|
public static IList<TenantUser> FindAllByTenantId(Int32 tenantId)
|
||||||
{
|
{
|
||||||
if (tenantId <= 0) return [];
|
if (tenantId < 0) return [];
|
||||||
|
|
||||||
// 实体缓存
|
// 实体缓存
|
||||||
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.TenantId == tenantId);
|
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.TenantId == tenantId);
|
||||||
|
@ -273,7 +273,7 @@ public partial class TenantUser : ITenantUser, IEntity<ITenantUser>
|
||||||
/// <returns>实体列表</returns>
|
/// <returns>实体列表</returns>
|
||||||
public static IList<TenantUser> FindAllByUserId(Int32 userId)
|
public static IList<TenantUser> FindAllByUserId(Int32 userId)
|
||||||
{
|
{
|
||||||
if (userId <= 0) return [];
|
if (userId < 0) return [];
|
||||||
|
|
||||||
// 实体缓存
|
// 实体缓存
|
||||||
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.UserId == userId);
|
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.UserId == userId);
|
||||||
|
|
|
@ -373,7 +373,7 @@ public partial class Menu : IMenu, IEntity<IMenu>
|
||||||
/// <returns>实体对象</returns>
|
/// <returns>实体对象</returns>
|
||||||
public static Menu? FindByID(Int32 id)
|
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);
|
if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.ID == id);
|
||||||
|
@ -403,7 +403,7 @@ public partial class Menu : IMenu, IEntity<IMenu>
|
||||||
/// <returns>实体对象</returns>
|
/// <returns>实体对象</returns>
|
||||||
public static Menu? FindByParentIDAndName(Int32 parentId, String name)
|
public static Menu? FindByParentIDAndName(Int32 parentId, String name)
|
||||||
{
|
{
|
||||||
if (parentId <= 0) return null;
|
if (parentId < 0) return null;
|
||||||
if (name.IsNullOrEmpty()) return null;
|
if (name.IsNullOrEmpty()) return null;
|
||||||
|
|
||||||
// 实体缓存
|
// 实体缓存
|
||||||
|
@ -417,7 +417,7 @@ public partial class Menu : IMenu, IEntity<IMenu>
|
||||||
/// <returns>实体列表</returns>
|
/// <returns>实体列表</returns>
|
||||||
public static IList<Menu> FindAllByParentID(Int32 parentId)
|
public static IList<Menu> FindAllByParentID(Int32 parentId)
|
||||||
{
|
{
|
||||||
if (parentId <= 0) return [];
|
if (parentId < 0) return [];
|
||||||
|
|
||||||
// 实体缓存
|
// 实体缓存
|
||||||
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.ParentID == parentId);
|
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.ParentID == parentId);
|
||||||
|
|
|
@ -306,7 +306,7 @@ public partial class Role : IRole, IEntity<IRole>
|
||||||
/// <returns>实体对象</returns>
|
/// <returns>实体对象</returns>
|
||||||
public static Role? FindByID(Int32 id)
|
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);
|
if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.ID == id);
|
||||||
|
|
|
@ -381,7 +381,7 @@ public partial class Department : IDepartment, IEntity<IDepartment>
|
||||||
/// <returns>实体对象</returns>
|
/// <returns>实体对象</returns>
|
||||||
public static Department? FindByID(Int32 id)
|
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);
|
if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.ID == id);
|
||||||
|
@ -411,7 +411,7 @@ public partial class Department : IDepartment, IEntity<IDepartment>
|
||||||
/// <returns>实体列表</returns>
|
/// <returns>实体列表</returns>
|
||||||
public static IList<Department> FindAllByParentIDAndName(Int32 parentId, String name)
|
public static IList<Department> FindAllByParentIDAndName(Int32 parentId, String name)
|
||||||
{
|
{
|
||||||
if (parentId <= 0) return [];
|
if (parentId < 0) return [];
|
||||||
if (name.IsNullOrEmpty()) return [];
|
if (name.IsNullOrEmpty()) return [];
|
||||||
|
|
||||||
// 实体缓存
|
// 实体缓存
|
||||||
|
@ -438,7 +438,7 @@ public partial class Department : IDepartment, IEntity<IDepartment>
|
||||||
/// <returns>实体列表</returns>
|
/// <returns>实体列表</returns>
|
||||||
public static IList<Department> FindAllByTenantId(Int32 tenantId)
|
public static IList<Department> FindAllByTenantId(Int32 tenantId)
|
||||||
{
|
{
|
||||||
if (tenantId <= 0) return [];
|
if (tenantId < 0) return [];
|
||||||
|
|
||||||
// 实体缓存
|
// 实体缓存
|
||||||
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.TenantId == tenantId);
|
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.TenantId == tenantId);
|
||||||
|
|
|
@ -248,7 +248,7 @@ public partial class Log
|
||||||
/// <returns>实体对象</returns>
|
/// <returns>实体对象</returns>
|
||||||
public static Log? FindByID(Int64 id)
|
public static Log? FindByID(Int64 id)
|
||||||
{
|
{
|
||||||
if (id <= 0) return null;
|
if (id < 0) return null;
|
||||||
|
|
||||||
return Find(_.ID == id);
|
return Find(_.ID == id);
|
||||||
}
|
}
|
||||||
|
@ -272,7 +272,7 @@ public partial class Log
|
||||||
public static IList<Log> FindAllByCategoryAndLinkID(String? category, Int64 linkId)
|
public static IList<Log> FindAllByCategoryAndLinkID(String? category, Int64 linkId)
|
||||||
{
|
{
|
||||||
if (category == null) return [];
|
if (category == null) return [];
|
||||||
if (linkId <= 0) return [];
|
if (linkId < 0) return [];
|
||||||
|
|
||||||
return FindAll(_.Category == category & _.LinkID == linkId);
|
return FindAll(_.Category == category & _.LinkID == linkId);
|
||||||
}
|
}
|
||||||
|
@ -282,7 +282,7 @@ public partial class Log
|
||||||
/// <returns>实体列表</returns>
|
/// <returns>实体列表</returns>
|
||||||
public static IList<Log> FindAllByCreateUserID(Int32 createUserId)
|
public static IList<Log> FindAllByCreateUserID(Int32 createUserId)
|
||||||
{
|
{
|
||||||
if (createUserId <= 0) return [];
|
if (createUserId < 0) return [];
|
||||||
|
|
||||||
return FindAll(_.CreateUserID == createUserId);
|
return FindAll(_.CreateUserID == createUserId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -468,7 +468,7 @@ public partial class User
|
||||||
/// <returns>实体对象</returns>
|
/// <returns>实体对象</returns>
|
||||||
public static User? FindByID(Int32 id)
|
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);
|
if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.ID == id);
|
||||||
|
@ -539,7 +539,7 @@ public partial class User
|
||||||
/// <returns>实体列表</returns>
|
/// <returns>实体列表</returns>
|
||||||
public static IList<User> FindAllByRoleID(Int32 roleId)
|
public static IList<User> FindAllByRoleID(Int32 roleId)
|
||||||
{
|
{
|
||||||
if (roleId <= 0) return [];
|
if (roleId < 0) return [];
|
||||||
|
|
||||||
// 实体缓存
|
// 实体缓存
|
||||||
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.RoleID == roleId);
|
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.RoleID == roleId);
|
||||||
|
@ -552,7 +552,7 @@ public partial class User
|
||||||
/// <returns>实体列表</returns>
|
/// <returns>实体列表</returns>
|
||||||
public static IList<User> FindAllByDepartmentID(Int32 departmentId)
|
public static IList<User> FindAllByDepartmentID(Int32 departmentId)
|
||||||
{
|
{
|
||||||
if (departmentId <= 0) return [];
|
if (departmentId < 0) return [];
|
||||||
|
|
||||||
// 实体缓存
|
// 实体缓存
|
||||||
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.DepartmentID == departmentId);
|
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.DepartmentID == departmentId);
|
||||||
|
|
|
@ -262,7 +262,7 @@ public partial class CorePerson
|
||||||
/// <returns>实体列表</returns>
|
/// <returns>实体列表</returns>
|
||||||
public static IList<CorePerson> FindAllByBuildID(Int32 buildId)
|
public static IList<CorePerson> FindAllByBuildID(Int32 buildId)
|
||||||
{
|
{
|
||||||
if (buildId <= 0) return [];
|
if (buildId < 0) return [];
|
||||||
|
|
||||||
// 实体缓存
|
// 实体缓存
|
||||||
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.BuildID == buildId);
|
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.BuildID == buildId);
|
||||||
|
|
|
@ -127,7 +127,7 @@ public partial class CorePerson : Entity<CorePerson>
|
||||||
/// <returns>实体对象</returns>
|
/// <returns>实体对象</returns>
|
||||||
public static CorePerson FindByPersonID(Int32 personId)
|
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);
|
if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.PersonID == personId);
|
||||||
|
@ -143,7 +143,7 @@ public partial class CorePerson : Entity<CorePerson>
|
||||||
/// <returns>实体列表</returns>
|
/// <returns>实体列表</returns>
|
||||||
public static IList<CorePerson> FindAllByBuild_ID(Int32 build_ID)
|
public static IList<CorePerson> FindAllByBuild_ID(Int32 build_ID)
|
||||||
{
|
{
|
||||||
if (build_ID <= 0) return new List<CorePerson>();
|
if (build_ID < 0) return new List<CorePerson>();
|
||||||
|
|
||||||
// 实体缓存
|
// 实体缓存
|
||||||
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.Build_ID == build_ID);
|
if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.Build_ID == build_ID);
|
||||||
|
|
Loading…
Reference in New Issue