From 92cb843826dfab531b4406102fe7dcd31b6b0775 Mon Sep 17 00:00:00 2001
From: 刘磊 <1161824510@qq.com>
Date: 星期三, 08 一月 2025 14:41:12 +0800
Subject: [PATCH] 同步
---
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/BaseServices/ServiceBase.cs | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/BaseServices/ServiceBase.cs b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/BaseServices/ServiceBase.cs
index 6dffe4e..ee18736 100644
--- a/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/BaseServices/ServiceBase.cs
+++ b/Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Core/BaseServices/ServiceBase.cs
@@ -105,7 +105,7 @@
LinqExpressionType expressionType = searchParametersList[i].DisplayType.GetLinqCondition();
if (expressionType == LinqExpressionType.Equal)
{
- where += $"{searchParametersList[i].Name} = '{results[j].Item3}'";
+ where += $"{searchParametersList[i].Name} like '%{results[j].Item3}%'";
}
else
{
@@ -286,7 +286,7 @@
List<TDetail> list = detailDics.DicToIEnumerable<TDetail>();
- ((SqlSugarClient)BaseDal.Db).BeginTran();
+ ((SqlSugarScope)BaseDal.Db).BeginTran();
int id = BaseDal.Db.Insertable(entity).ExecuteReturnIdentity();
@@ -298,13 +298,13 @@
BaseDal.Db.Insertable(list).ExecuteCommand();
- ((SqlSugarClient)BaseDal.Db).CommitTran();
+ ((SqlSugarScope)BaseDal.Db).CommitTran();
content = WebResponseContent.Instance.OK();
}
catch (Exception ex)
{
- ((SqlSugarClient)BaseDal.Db).RollbackTran();
+ ((SqlSugarScope)BaseDal.Db).RollbackTran();
content = WebResponseContent.Instance.Error(ex.Message);
}
return content;
@@ -457,7 +457,7 @@
object mainId = typeof(TEntity).GetPropertyValue(entity, typeof(TEntity).GetKeyName());
if (mainId != null)
{
- ((SqlSugarClient)BaseDal.Db).BeginTran();
+ ((SqlSugarScope)BaseDal.Db).BeginTran();
if (dynamicDelKeys.Count > 0)
BaseDal.Db.Deleteable<object>().AS(detailType.Name).Where($"{detailType.GetKeyName()} in (@id)", new { id = dynamicDelKeys.ToArray() }).ExecuteCommandHasChange();
@@ -474,7 +474,7 @@
BaseDal.Db.Insertable(addRows).ExecuteCommand();
- ((SqlSugarClient)BaseDal.Db).CommitTran();
+ ((SqlSugarScope)BaseDal.Db).CommitTran();
content = WebResponseContent.Instance.OK();
}
@@ -486,7 +486,7 @@
}
catch (Exception ex)
{
- ((SqlSugarClient)BaseDal.Db).RollbackTran();
+ ((SqlSugarScope)BaseDal.Db).RollbackTran();
content = WebResponseContent.Instance.Error(ex.Message);
}
return content;
@@ -532,14 +532,14 @@
{
dynamicDelKeys.Add(keys[i]);
}
- ((SqlSugarClient)BaseDal.Db).BeginTran();
+ ((SqlSugarScope)BaseDal.Db).BeginTran();
if (dynamicDelKeys.Count > 0)
BaseDal.Db.Deleteable<object>().AS(detailType.Name).Where($"{name} in (@id)", new { id = dynamicDelKeys.ToArray() }).ExecuteCommandHasChange();
BaseDal.DeleteDataByIds(keys);
- ((SqlSugarClient)BaseDal.Db).CommitTran();
+ ((SqlSugarScope)BaseDal.Db).CommitTran();
return WebResponseContent.Instance.OK();
}
@@ -551,7 +551,7 @@
}
catch (Exception ex)
{
- ((SqlSugarClient)BaseDal.Db).RollbackTran();
+ ((SqlSugarScope)BaseDal.Db).RollbackTran();
return WebResponseContent.Instance.Error(ex.Message);
}
}
--
Gitblit v1.9.3