From 6810059f83dfc0113f455af48f08ddca58347684 Mon Sep 17 00:00:00 2001 From: ddlucky Date: Mon, 22 May 2023 08:55:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=AD=E5=8F=A5=E5=BC=8F=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E7=9A=84=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Vue.Net/VOL.Core/BaseProvider/ServiceBase.cs | 21 ++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Vue.Net/VOL.Core/BaseProvider/ServiceBase.cs b/Vue.Net/VOL.Core/BaseProvider/ServiceBase.cs index 484a6b04..db6238af 100644 --- a/Vue.Net/VOL.Core/BaseProvider/ServiceBase.cs +++ b/Vue.Net/VOL.Core/BaseProvider/ServiceBase.cs @@ -180,15 +180,28 @@ namespace VOL.Core.BaseProvider - if (searchparam == HtmlElementType.like) item.Value = $"%{item.Value}%"; - + if (searchparam == HtmlElementType.like) + { + item.Value = $"%{item.Value}%"; + QuerySql += $" and {searchname} {searchparam} '{item.Value}' "; + } + else if (searchparam == HtmlElementType.StartWith) { searchparam = HtmlElementType.like; item.Value = $"{item.Value}%"; + QuerySql += $" and {searchname} {searchparam} '{item.Value}' "; } - - QuerySql += $" and {searchname} {searchparam} '{item.Value}' "; + else + if (searchparam == "in") + { + //searchparam = HtmlElementType.like; + //item.Value = $"{item.Value}%"; + var _str = item.Value.Replace(",", "','"); + QuerySql += $" and {searchname} in ('{_str}') "; + } + else + QuerySql += $" and {searchname} {searchparam} '{item.Value}' "; }