1、修复update中IN的故障

2、修复where条件中Like无法模糊筛选
pull/1/head
潘建东 8 months ago
parent f3e60a45d7
commit b8b2f979d2

@ -40,34 +40,34 @@ namespace ZKLT.Hadoop.API
app.UseCors("all");
#endregion
app.UseHadoop((c) =>
{
c.Host = "127.0.0.1";
c.Account = "root";
c.PassWord = "root";
c.Key = "hadoopdb";
c.Port = 3306;
});
//app.UseHadoop((c) =>
//{
// c.Host = "172.17.0.1";
// c.Host = "127.0.0.1";
// c.Account = "root";
// c.PassWord = "root";
// c.Key = "testdb";
// c.Port = 4000;
// c.Key = "hadoopdb";
// c.Port = 3306;
//});
//app.UseHadoop((c) =>
//{
// c.Host = "118.195.165.218";
// c.Host = "172.17.0.1";
// c.Account = "root";
// c.PassWord = "root";
// c.Key = "testdb";
// c.Port = 4000;
//});
app.UseHadoop((c) =>
{
c.Host = "118.195.165.218";
c.Account = "root";
c.PassWord = "root";
c.Key = "testdb";
c.Port = 4000;
});
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{

@ -72,6 +72,10 @@ namespace ZKLT.Hadoop
{
param.Add(_guid, _data[_item.Name]!);
}
else if (_item.Value.ToString() == HDP_WhereType.LIKE)
{
param.Add(_guid,$@"%{((JValue)_data[_item.Name]!).Value!}%" );
}
else {
param.Add(_guid, ((JValue)_data[_item.Name]!).Value!);
}
@ -525,6 +529,15 @@ namespace ZKLT.Hadoop
{
throw new ArgumentNullException("条件无效");
}
List<JObject> _where = new List<JObject>();
if (where.Type == JTokenType.Object)
{
_where.Add((JObject)where);
}
else if (where.Type == JTokenType.Array)
{
_where.AddRange(((JArray)where).ToObject<JObject[]>()!);
}
if (data == null || data.Count == 0)
{
throw new ArgumentNullException("数据无效");
@ -564,7 +577,7 @@ namespace ZKLT.Hadoop
for (var i = 0; i < table.Columns.Length; i++)
{
var _column = table.Columns[i];
if (_row.ContainsKey(_column.Key!))
if (_row.ContainsKey(_column.Key!) && !_where.Any(x => x.ContainsKey(_column.Key!)))
{
_colstr.Append($@"`{_column.Key!}`=@{_column.Key!},");
_params.Add(_column.Key!, ((JValue)_row[_column.Key!]!).Value!);

Loading…
Cancel
Save