区间查询问题修复 #4

Merged
panjiandong merged 3 commits from dev into main 4 days ago

@ -1 +1 @@
docker build -f ./Dockerfile -t hadoop:1.0.7 ../../.
docker build -f ./Dockerfile -t hadoop:1.0.8 ../../.

@ -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";
}
}

@ -99,29 +99,30 @@ namespace ZKLT.Hadoop
_wherestr.AppendLine(@$"AND `{_item.Name}` {_Itemv[k]} @{_guid}");
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;
case HDP_WhereType.QUERYIN:
var _Command = JsonConvert.DeserializeObject<HDP_Command>(_Colv[k].ToString())!;
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.IN:
case HDP_WhereType.BETWEEN:
default:
_wherestr.AppendLine(@$"AND `{_item.Name}` {_Itemv[k]} @{_guid}");
if (_Colv[k]!.Type == JTokenType.Object || _data[_item.Name]!.Type == JTokenType.Array)
{
param.Add(_guid, _Colv[k]!);
}
else
{
param.Add(_guid, ((JValue)_Colv[k]!).Value!);
}
break;
}
}

Loading…
Cancel
Save