diff --git a/XCode/Membership/Member.xml b/XCode/Membership/Member.xml
index 74cbe924d..d16a9cf31 100644
--- a/XCode/Membership/Member.xml
+++ b/XCode/Membership/Member.xml
@@ -186,7 +186,7 @@
-
+
-
+
diff --git a/XCode/Membership/Membership.htm b/XCode/Membership/Membership.htm
index 5d5a297ad..020eba921 100644
--- a/XCode/Membership/Membership.htm
+++ b/XCode/Membership/Membership.htm
@@ -1,37 +1,37 @@
用户(User)
diff --git a/XCode/Membership/make.bat b/XCode/Membership/xcodetool.bat
similarity index 100%
rename from XCode/Membership/make.bat
rename to XCode/Membership/xcodetool.bat
diff --git a/XCode/Membership/xcodetool.exe b/XCode/Membership/xcodetool.exe
index 30b7b8330..c3e71545f 100644
Binary files a/XCode/Membership/xcodetool.exe and b/XCode/Membership/xcodetool.exe differ
diff --git "a/XCode/Membership/\345\234\260\345\214\272.Biz.cs" "b/XCode/Membership/\345\234\260\345\214\272.Biz.cs"
index 0c60b393f..c957c4afb 100644
--- "a/XCode/Membership/\345\234\260\345\214\272.Biz.cs"
+++ "b/XCode/Membership/\345\234\260\345\214\272.Biz.cs"
@@ -314,45 +314,6 @@ public static IList FindAllByParentID(Int32 parentid)
return rs;
}
-
- /// 根据拼音查找
- /// 拼音
- /// 实体列表
- public static IList FindAllByPinYin(String pinYin)
- {
- if (pinYin.IsNullOrEmpty()) return new List();
-
- // 实体缓存
- if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.PinYin.EqualIgnoreCase(pinYin));
-
- return FindAll(_.PinYin == pinYin);
- }
-
- /// 根据简拼查找
- /// 简拼
- /// 实体列表
- public static IList FindAllByJianPin(String jianPin)
- {
- if (jianPin.IsNullOrEmpty()) return new List();
-
- // 实体缓存
- if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.JianPin.EqualIgnoreCase(jianPin));
-
- return FindAll(_.JianPin == jianPin);
- }
-
- /// 根据地址编码查找
- /// 地址编码
- /// 实体列表
- public static IList FindAllByGeoHash(String geoHash)
- {
- if (geoHash.IsNullOrEmpty()) return new List();
-
- // 实体缓存
- if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.GeoHash.EqualIgnoreCase(geoHash));
-
- return FindAll(_.GeoHash == geoHash);
- }
#endregion
#region 高级查询
diff --git "a/XCode/Membership/\345\234\260\345\214\272.cs" "b/XCode/Membership/\345\234\260\345\214\272.cs"
index b3f476e83..a225f9a51 100644
--- "a/XCode/Membership/\345\234\260\345\214\272.cs"
+++ "b/XCode/Membership/\345\234\260\345\214\272.cs"
@@ -261,6 +261,44 @@ public override Object? this[String name]
#endregion
#region 扩展查询
+ /// 根据拼音查找
+ /// 拼音
+ /// 实体列表
+ public static IList FindAllByPinYin(String? pinYin)
+ {
+ if (pinYin == null) return [];
+
+ // 实体缓存
+ if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.PinYin.EqualIgnoreCase(pinYin));
+
+ return FindAll(_.PinYin == pinYin);
+ }
+
+ /// 根据简拼查找
+ /// 简拼
+ /// 实体列表
+ public static IList FindAllByJianPin(String? jianPin)
+ {
+ if (jianPin == null) return [];
+
+ // 实体缓存
+ if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.JianPin.EqualIgnoreCase(jianPin));
+
+ return FindAll(_.JianPin == jianPin);
+ }
+
+ /// 根据地址编码查找
+ /// 地址编码
+ /// 实体列表
+ public static IList FindAllByGeoHash(String? geoHash)
+ {
+ if (geoHash == null) return [];
+
+ // 实体缓存
+ if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.GeoHash.EqualIgnoreCase(geoHash));
+
+ return FindAll(_.GeoHash == geoHash);
+ }
#endregion
#region 字段名
diff --git "a/XCode/Membership/\345\255\227\345\205\270\345\217\202\346\225\260.Biz.cs" "b/XCode/Membership/\345\255\227\345\205\270\345\217\202\346\225\260.Biz.cs"
index 504710c38..30864fd93 100644
--- "a/XCode/Membership/\345\255\227\345\205\270\345\217\202\346\225\260.Biz.cs"
+++ "b/XCode/Membership/\345\255\227\345\205\270\345\217\202\346\225\260.Biz.cs"
@@ -73,32 +73,6 @@ public static IList FindAllByUserID(Int32 userId, String? category)
? Meta.Cache.FindAll(e => e.UserID == userId && e.Category == category)
: FindAll(_.UserID == userId & _.Category == category);
}
-
- /// 根据类别、名称查找
- /// 类别
- /// 名称
- /// 实体列表
- public static IList FindAllByCategoryAndName(String category, String name)
- {
-
- // 实体缓存
- if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.Category.EqualIgnoreCase(category) && e.Name.EqualIgnoreCase(name));
-
- return FindAll(_.Category == category & _.Name == name);
- }
-
- /// 根据用户、类别、名称查找
- /// 用户
- /// 类别
- /// 名称
- /// 实体对象
- public static Parameter FindByUserIDAndCategoryAndName(Int32 userId, String category, String name)
- {
- // 实体缓存
- if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.UserID == userId && e.Category.EqualIgnoreCase(category) && e.Name.EqualIgnoreCase(name));
-
- return Find(_.UserID == userId & _.Category == category & _.Name == name);
- }
#endregion
#region 高级查询
diff --git "a/XCode/Membership/\345\255\227\345\205\270\345\217\202\346\225\260.cs" "b/XCode/Membership/\345\255\227\345\205\270\345\217\202\346\225\260.cs"
index 06bef70d7..2500751a4 100644
--- "a/XCode/Membership/\345\255\227\345\205\270\345\217\202\346\225\260.cs"
+++ "b/XCode/Membership/\345\255\227\345\205\270\345\217\202\346\225\260.cs"
@@ -333,17 +333,52 @@ public override Object? this[String name]
#endregion
#region 扩展查询
+ /// 根据用户、类别、名称查找
+ /// 用户
+ /// 类别
+ /// 名称
+ /// 实体对象
+ public static Parameter? FindByUserIDAndCategoryAndName(Int32 userId, String? category, String name)
+ {
+ if (userId < 0) return null;
+ if (category == null) return null;
+ if (name.IsNullOrEmpty()) return null;
+
+ // 实体缓存
+ if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.UserID == userId && e.Category.EqualIgnoreCase(category) && e.Name.EqualIgnoreCase(name));
+
+ return Find(_.UserID == userId & _.Category == category & _.Name == name);
+ }
+
/// 根据用户、类别查找
/// 用户
/// 类别
/// 实体列表
- public static IList FindAllByUserIDAndCategory(Int32 userId, String category)
+ public static IList FindAllByUserIDAndCategory(Int32 userId, String? category)
{
if (userId < 0) return [];
if (category == null) return [];
+ // 实体缓存
+ if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.UserID == userId && e.Category.EqualIgnoreCase(category));
+
return FindAll(_.UserID == userId & _.Category == category);
}
+
+ /// 根据类别、名称查找
+ /// 类别
+ /// 名称
+ /// 实体列表
+ public static IList FindAllByCategoryAndName(String? category, String name)
+ {
+ if (category == null) return [];
+ if (name.IsNullOrEmpty()) return [];
+
+ // 实体缓存
+ if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.Category.EqualIgnoreCase(category) && e.Name.EqualIgnoreCase(name));
+
+ return FindAll(_.Category == category & _.Name == name);
+ }
#endregion
#region 字段名
diff --git "a/XCode/Membership/\346\227\245\345\277\227.Biz.cs" "b/XCode/Membership/\346\227\245\345\277\227.Biz.cs"
index 22b0aa831..72a26c0f4 100644
--- "a/XCode/Membership/\346\227\245\345\277\227.Biz.cs"
+++ "b/XCode/Membership/\346\227\245\345\277\227.Biz.cs"
@@ -192,30 +192,6 @@ public static IList FindAllByCreateUserIDAndID(Int32 createUserId, Int64 id
return FindAll(_.CreateUserID == createUserId & _.ID == id);
}
- /// 根据操作、类别查找
- /// 操作
- /// 类别
- /// 实体列表
- public static IList FindAllByActionAndCategory(String action, String category)
- {
- // 实体缓存
- if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.Action.EqualIgnoreCase(action) && e.Category.EqualIgnoreCase(category));
-
- return FindAll(_.Action == action & _.Category == category);
- }
-
- /// 根据类别、链接查找
- /// 类别
- /// 链接
- /// 实体列表
- public static IList FindAllByCategoryAndLinkID(String category, Int64 linkId)
- {
- // 实体缓存
- if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.Category.EqualIgnoreCase(category) && e.LinkID == linkId);
-
- return FindAll(_.Category == category & _.LinkID == linkId);
- }
-
/// 根据创建用户查找
/// 创建用户
/// 实体列表
@@ -256,17 +232,4 @@ public static IList FindAllByCreateUserID(Int32 createUserId)
///
public override String ToString() => $"{Category} {Action} {UserName} {CreateTime:yyyy-MM-dd HH:mm:ss} {Remark}";
#endregion
-}
-
-///// 日志接口
-//public partial interface ILog
-//{
-// /// 保存
-// ///
-// Int32 Save();
-
-// /// 异步保存
-// /// 延迟保存的时间。默认0ms近实时保存
-// ///
-// Boolean SaveAsync(Int32 msDelay = 0);
-//}
\ No newline at end of file
+}
\ No newline at end of file
diff --git "a/XCode/Membership/\346\227\245\345\277\227.cs" "b/XCode/Membership/\346\227\245\345\277\227.cs"
index e4efb0a3a..91fd34109 100644
--- "a/XCode/Membership/\346\227\245\345\277\227.cs"
+++ "b/XCode/Membership/\346\227\245\345\277\227.cs"
@@ -273,6 +273,29 @@ public override Object? this[String name]
#endregion
#region 扩展查询
+ /// 根据操作、类别查找
+ /// 操作
+ /// 类别
+ /// 实体列表
+ public static IList FindAllByActionAndCategory(String action, String? category)
+ {
+ if (action.IsNullOrEmpty()) return [];
+ if (category == null) return [];
+
+ return FindAll(_.Action == action & _.Category == category);
+ }
+
+ /// 根据类别、链接查找
+ /// 类别
+ /// 链接
+ /// 实体列表
+ public static IList FindAllByCategoryAndLinkID(String? category, Int64 linkId)
+ {
+ if (category == null) return [];
+ if (linkId < 0) return [];
+
+ return FindAll(_.Category == category & _.LinkID == linkId);
+ }
#endregion
#region 数据清理
diff --git "a/XCode/Membership/\347\224\250\346\210\267.Biz.cs" "b/XCode/Membership/\347\224\250\346\210\267.Biz.cs"
index 70c7f1a52..8a3d86e1e 100644
--- "a/XCode/Membership/\347\224\250\346\210\267.Biz.cs"
+++ "b/XCode/Membership/\347\224\250\346\210\267.Biz.cs"
@@ -218,45 +218,6 @@ public static User FindForLogin(String account)
return user;
}
- /// 根据邮件查找
- /// 邮件
- /// 实体列表
- public static IList FindAllByMail(String mail)
- {
- if (mail.IsNullOrEmpty()) return new List();
-
- // 实体缓存
- if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.Mail.EqualIgnoreCase(mail));
-
- return FindAll(_.Mail == mail);
- }
-
- /// 根据手机查找
- /// 手机
- /// 实体列表
- public static IList FindAllByMobile(String mobile)
- {
- if (mobile.IsNullOrEmpty()) return new List();
-
- // 实体缓存
- if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.Mobile.EqualIgnoreCase(mobile));
-
- return FindAll(_.Mobile == mobile);
- }
-
- /// 根据代码查找
- /// 代码
- /// 实体列表
- public static IList FindAllByCode(String code)
- {
- if (code.IsNullOrEmpty()) return new List();
-
- // 实体缓存
- if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.Code.EqualIgnoreCase(code));
-
- return FindAll(_.Code == code);
- }
-
/// 根据角色查找
/// 角色
/// 实体列表
diff --git "a/XCode/Membership/\347\224\250\346\210\267.cs" "b/XCode/Membership/\347\224\250\346\210\267.cs"
index 7db1769f5..32a71e4e4 100644
--- "a/XCode/Membership/\347\224\250\346\210\267.cs"
+++ "b/XCode/Membership/\347\224\250\346\210\267.cs"
@@ -480,6 +480,45 @@ public override Object? this[String name]
#endregion
#region 扩展查询
+ /// 根据邮件查找
+ /// 邮件
+ /// 实体列表
+ public static IList FindAllByMail(String? mail)
+ {
+ if (mail == null) return [];
+
+ // 实体缓存
+ if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.Mail.EqualIgnoreCase(mail));
+
+ return FindAll(_.Mail == mail);
+ }
+
+ /// 根据手机查找
+ /// 手机
+ /// 实体列表
+ public static IList FindAllByMobile(String? mobile)
+ {
+ if (mobile == null) return [];
+
+ // 实体缓存
+ if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.Mobile.EqualIgnoreCase(mobile));
+
+ return FindAll(_.Mobile == mobile);
+ }
+
+ /// 根据代码查找
+ /// 代码
+ /// 实体列表
+ public static IList FindAllByCode(String? code)
+ {
+ if (code == null) return [];
+
+ // 实体缓存
+ if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.Code.EqualIgnoreCase(code));
+
+ return FindAll(_.Code == code);
+ }
+
/// 根据部门查找
/// 部门
/// 实体列表
diff --git "a/XCode/Membership/\347\247\237\346\210\267.Biz.cs" "b/XCode/Membership/\347\247\237\346\210\267.Biz.cs"
index 6d15a7e30..69e757de7 100644
--- "a/XCode/Membership/\347\247\237\346\210\267.Biz.cs"
+++ "b/XCode/Membership/\347\247\237\346\210\267.Biz.cs"
@@ -80,19 +80,6 @@ public static IList FindAllByName(String name)
return FindAll(_.Name == name);
}
- /// 根据编码查找
- /// 编码
- /// 实体对象
- public static Tenant FindByCode(String code)
- {
- if (code.IsNullOrEmpty()) return null;
-
- // 实体缓存
- if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.Code.EqualIgnoreCase(code));
-
- return Find(_.Code == code);
- }
-
/// 根据管理员编号查询
///
///
diff --git "a/XCode/Membership/\347\247\237\346\210\267.cs" "b/XCode/Membership/\347\247\237\346\210\267.cs"
index 0e7748956..8cf18a0d5 100644
--- "a/XCode/Membership/\347\247\237\346\210\267.cs"
+++ "b/XCode/Membership/\347\247\237\346\210\267.cs"
@@ -251,6 +251,18 @@ public override Object? this[String name]
#endregion
#region 扩展查询
+ /// 根据编码查找
+ /// 编码
+ /// 实体对象
+ public static Tenant? FindByCode(String? code)
+ {
+ if (code == null) return null;
+
+ // 实体缓存
+ if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.Code.EqualIgnoreCase(code));
+
+ return Find(_.Code == code);
+ }
#endregion
#region 字段名
diff --git "a/XCode/Membership/\351\203\250\351\227\250.Biz.cs" "b/XCode/Membership/\351\203\250\351\227\250.Biz.cs"
index 008a7869b..93d2a61de 100644
--- "a/XCode/Membership/\351\203\250\351\227\250.Biz.cs"
+++ "b/XCode/Membership/\351\203\250\351\227\250.Biz.cs"
@@ -219,19 +219,6 @@ public static IList FindAllByParentIDAndName(Int32 parentId, String
return FindAll(_.ParentID == parentId & _.Name == name);
}
- /// 根据代码查找
- /// 代码
- /// 实体列表
- public static IList FindAllByCode(String code)
- {
- if (code.IsNullOrEmpty()) return new List();
-
- // 实体缓存
- if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.Code.EqualIgnoreCase(code));
-
- return FindAll(_.Code == code);
- }
-
/// 根据租户查找
/// 租户
/// 实体列表
diff --git "a/XCode/Membership/\351\203\250\351\227\250.cs" "b/XCode/Membership/\351\203\250\351\227\250.cs"
index f06884729..d8b3468c2 100644
--- "a/XCode/Membership/\351\203\250\351\227\250.cs"
+++ "b/XCode/Membership/\351\203\250\351\227\250.cs"
@@ -385,7 +385,7 @@ public override Object? this[String name]
{
if (tenantId < 0) return null;
if (parentId < 0) return null;
- if (name == null) return null;
+ if (name.IsNullOrEmpty()) return null;
// 实体缓存
if (Meta.Session.Count < 1000) return Meta.Cache.Find(e => e.TenantId == tenantId && e.ParentID == parentId && e.Name.EqualIgnoreCase(name));
@@ -407,6 +407,19 @@ public static IList FindAllByTenantIdAndParentID(Int32 tenantId, Int
return FindAll(_.TenantId == tenantId & _.ParentID == parentId);
}
+
+ /// 根据代码查找
+ /// 代码
+ /// 实体列表
+ public static IList FindAllByCode(String? code)
+ {
+ if (code == null) return [];
+
+ // 实体缓存
+ if (Meta.Session.Count < 1000) return Meta.Cache.FindAll(e => e.Code.EqualIgnoreCase(code));
+
+ return FindAll(_.Code == code);
+ }
#endregion
#region 字段名
diff --git "a/XUnitTest.XCode/Code/Entity/\346\210\220\345\221\230\346\227\245\345\277\227.cs" "b/XUnitTest.XCode/Code/Entity/\346\210\220\345\221\230\346\227\245\345\277\227.cs"
index ea3be0d7b..4be3bd788 100644
--- "a/XUnitTest.XCode/Code/Entity/\346\210\220\345\221\230\346\227\245\345\277\227.cs"
+++ "b/XUnitTest.XCode/Code/Entity/\346\210\220\345\221\230\346\227\245\345\277\227.cs"
@@ -327,6 +327,16 @@ public static IList FindAllByCreateUserID(Int32 createUserId)
return FindAll(_.CreateUserID == createUserId);
}
+
+ /// 根据数据分区查找
+ /// 数据分区
+ /// 实体列表
+ public static IList FindAllByDs(String? ds)
+ {
+ if (ds == null) return [];
+
+ return FindAll(_.Ds == ds);
+ }
#endregion
#region 数据清理
diff --git "a/XUnitTest.XCode/Code/Entity/\347\224\250\346\210\267\346\227\245\345\277\227.cs" "b/XUnitTest.XCode/Code/Entity/\347\224\250\346\210\267\346\227\245\345\277\227.cs"
index e0506587e..8f7f32a06 100644
--- "a/XUnitTest.XCode/Code/Entity/\347\224\250\346\210\267\346\227\245\345\277\227.cs"
+++ "b/XUnitTest.XCode/Code/Entity/\347\224\250\346\210\267\346\227\245\345\277\227.cs"
@@ -329,6 +329,16 @@ public static IList FindAllByCreateUserID(Int32 createUserId)
return FindAll(_.CreateUserID == createUserId);
}
+
+ /// 根据数据时间查找
+ /// 数据时间
+ /// 实体列表
+ public static IList FindAllByDataTime(DateTime dataTime)
+ {
+ if (dataTime.Year < 1000) return [];
+
+ return FindAll(_.DataTime == dataTime);
+ }
#endregion
#region 数据清理