- 优化 WhereDynamicFilter 支持 string 比较大小 > < >= <=;#479

This commit is contained in:
28810
2020-09-29 10:46:56 +08:00
parent 05ddec4f64
commit 837c38d158
5 changed files with 266 additions and 196 deletions

View File

@ -2174,13 +2174,33 @@ WHERE (((cast(a.""Id"" as character)) in (SELECT b.""Title""
""Field"" : ""CreateTime"",
""Operator"" : ""GreaterThanOrEqual"",
""Value"" : ""2010-10-10""
},
{
""Field"" : ""Name"",
""Operator"" : ""GreaterThan"",
""Value"" : ""val31"",
},
{
""Field"" : ""Name"",
""Operator"" : ""GreaterThanOrEqual"",
""Value"" : ""val32"",
},
{
""Field"" : ""Name"",
""Operator"" : ""LessThan"",
""Value"" : ""val33"",
},
{
""Field"" : ""Name"",
""Operator"" : ""LessThanOrEqual"",
""Value"" : ""val34"",
}
]
}
")).ToSql();
Assert.Equal(@"SELECT a.""Code"", a.""Name"", a.""CreateTime"", a.""testint"", a.""ParentCode""
FROM ""D_District"" a
WHERE (((a.""Code"") LIKE '%val1%' AND (a.""Name"") LIKE 'val2%' OR (a.""Name"") LIKE '%val3' OR a.""ParentCode"" = 'val4' OR a.""CreateTime"" >= '2010-10-10 00:00:00'))", sql);
WHERE (((a.""Code"") LIKE '%val1%' AND (a.""Name"") LIKE 'val2%' OR (a.""Name"") LIKE '%val3' OR a.""ParentCode"" = 'val4' OR a.""CreateTime"" >= '2010-10-10 00:00:00' OR a.""Name"" > 'val31' OR a.""Name"" >= 'val32' OR a.""Name"" < 'val33' OR a.""Name"" <= 'val34'))", sql);
sql = fsql.Select<VM_District_Parent>().WhereDynamicFilter(JsonConvert.DeserializeObject<DynamicFilterInfo>(@"
{