From 1b6ccb64675e5262a2f7135697edc7466ffc14bf Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期二, 04 三月 2025 17:20:05 +0800
Subject: [PATCH] 优化
---
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceBase.cs | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceBase.cs b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceBase.cs
index 140c9fc..aa0da5e 100644
--- a/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceBase.cs
+++ b/Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/BaseServices/ServiceBase.cs
@@ -31,7 +31,7 @@
public ISqlSugarClient Db => BaseDal.Db;
private PropertyInfo[] _propertyInfo { get; set; } = null;
- private PropertyInfo[] TProperties
+ public PropertyInfo[] TProperties
{
get
{
@@ -132,7 +132,15 @@
if (string.IsNullOrEmpty(where))
{
// 閽堝瀛楃涓茬被鍨嬬殑瀛楁浣跨敤妯$硦鏌ヨ
- where += $"{searchParametersList[i].Name} like '%{searchParametersList[i].Value}%'";
+ //where += $"{searchParametersList[i].Name} like '%{searchParametersList[i].Value}%'";
+ if (searchParametersList[i].Value.ToLower() == "true" || searchParametersList[i].Value.ToLower() == "false")
+ {
+ where += $" {searchParametersList[i].Name} = '{searchParametersList[i].Value.ToLower()}'";
+ }
+ else
+ {
+ where += $"{searchParametersList[i].Name} like '%{searchParametersList[i].Value}%'";
+ }
}
else
{
@@ -164,7 +172,7 @@
/// <param name="pageData"></param>
/// <param name="propertyInfo"></param>
/// <returns></returns>
- private Dictionary<string, OrderByType> GetPageDataSort(PageDataOptions pageData, PropertyInfo[] propertyInfo)
+ public Dictionary<string, OrderByType> GetPageDataSort(PageDataOptions pageData, PropertyInfo[] propertyInfo)
{
if (!string.IsNullOrEmpty(pageData.Sort))
{
--
Gitblit v1.9.3