From 99ceabeb7ebc9ae0272ca8acdf9ead8d01730466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=AA=E5=8D=8E=E5=85=B5?= <455982533@qq.com> Date: Sat, 9 Nov 2024 18:54:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0NOT=20IN=E5=92=8CBETWEEN?= =?UTF-8?q?=E7=9A=84=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Hadoop/ZKLT.Hadoop.Model/HDP_WhereType.cs | 3 +++ Hadoop/ZKLT.Hadoop/TableService.cs | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Hadoop/ZKLT.Hadoop.Model/HDP_WhereType.cs b/Hadoop/ZKLT.Hadoop.Model/HDP_WhereType.cs index 893a2e3..b591fbb 100644 --- a/Hadoop/ZKLT.Hadoop.Model/HDP_WhereType.cs +++ b/Hadoop/ZKLT.Hadoop.Model/HDP_WhereType.cs @@ -24,8 +24,11 @@ namespace ZKLT.Hadoop.Model public const string IN = "IN"; + public const string NOTIN = "NOT IN"; + public const string BETWEEN = "BETWEEN"; public const string QUERYIN = "QUERYIN"; + } } diff --git a/Hadoop/ZKLT.Hadoop/TableService.cs b/Hadoop/ZKLT.Hadoop/TableService.cs index dc7c077..3dff2c2 100644 --- a/Hadoop/ZKLT.Hadoop/TableService.cs +++ b/Hadoop/ZKLT.Hadoop/TableService.cs @@ -100,6 +100,7 @@ namespace ZKLT.Hadoop param.Add(_guid, $@"%{((JValue)_Colv[k]!).Value!}%"); break; case HDP_WhereType.IN: + case HDP_WhereType.NOTIN: _wherestr.AppendLine(@$"AND `{_item.Name}` {_Itemv[k]} @{_guid}"); param.Add(_guid, _Colv[k]!); break; @@ -108,13 +109,17 @@ namespace ZKLT.Hadoop var _Query = QueryString(_Command.SourceId!, _Command.TableId!, _Command.Where, _Command.Data, _Command.Order, _Command.Col, param); _wherestr.AppendLine(@$"AND `{_item.Name}` IN ({_Query})"); break; + case HDP_WhereType.BETWEEN: + _wherestr.AppendLine(@$"AND `{_item.Name}` BETWEEN @{_guid}1 AND @{_guid}2"); + param.Add(_guid + "1", ((JArray)_Colv[k]!)[0].ToString()); + param.Add(_guid + "2", ((JArray)_Colv[k]!)[1].ToString()); + break; case HDP_WhereType.EQUAL: case HDP_WhereType.NOTEQUAL: case HDP_WhereType.MORE: case HDP_WhereType.LESS: case HDP_WhereType.MORETHEN: case HDP_WhereType.LESSTHEN: - case HDP_WhereType.BETWEEN: default: _wherestr.AppendLine(@$"AND `{_item.Name}` {_Itemv[k]} @{_guid}"); param.Add(_guid, ((JValue)_Colv[k]!).Value!);