|
@@ -204,6 +204,7 @@ namespace Util
|
|
string fieldQueryKind = queryField.fieldQueryKind;
|
|
string fieldQueryKind = queryField.fieldQueryKind;
|
|
string fieldQueryModel = queryField.fieldQueryModel;
|
|
string fieldQueryModel = queryField.fieldQueryModel;
|
|
string fieldQueryValue = queryField.fieldQueryValue;
|
|
string fieldQueryValue = queryField.fieldQueryValue;
|
|
|
|
+ if(fieldQueryValue.Contains("${")) fieldQueryValue = GetDbExpressionVal(fieldQueryValue, projectId, content, dic, startData);
|
|
fieldQueryValue = MatchExpressionVal(fieldQueryValue);
|
|
fieldQueryValue = MatchExpressionVal(fieldQueryValue);
|
|
string fieldQueryValueType = queryField.fieldQueryValueType;
|
|
string fieldQueryValueType = queryField.fieldQueryValueType;
|
|
if(fieldQueryKind == "1") //模糊匹配
|
|
if(fieldQueryKind == "1") //模糊匹配
|
|
@@ -351,7 +352,7 @@ namespace Util
|
|
}
|
|
}
|
|
else if(fieldQueryKind == "3") //范围匹配
|
|
else if(fieldQueryKind == "3") //范围匹配
|
|
{
|
|
{
|
|
- string[] val = fieldQueryValue.Split(':');
|
|
|
|
|
|
+ string[] val = RangeSplit(fieldQueryValue);
|
|
if(fieldQueryModel == "request_param")
|
|
if(fieldQueryModel == "request_param")
|
|
{
|
|
{
|
|
Dictionary<string, string> req = getRequestParams(projectId, content);
|
|
Dictionary<string, string> req = getRequestParams(projectId, content);
|
|
@@ -697,7 +698,7 @@ namespace Util
|
|
}
|
|
}
|
|
else if(fieldQueryKind == "3") //范围匹配
|
|
else if(fieldQueryKind == "3") //范围匹配
|
|
{
|
|
{
|
|
- string[] val = fieldQueryValue.Split(':');
|
|
|
|
|
|
+ string[] val = RangeSplit(fieldQueryValue);
|
|
if(fieldQueryModel == "request_param")
|
|
if(fieldQueryModel == "request_param")
|
|
{
|
|
{
|
|
Dictionary<string, string> req = getRequestParams(projectId, content);
|
|
Dictionary<string, string> req = getRequestParams(projectId, content);
|
|
@@ -792,7 +793,8 @@ namespace Util
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- sql = queryTable.customSql;
|
|
|
|
|
|
+ sql = queryTable.customSql + " limit " + skip + "," + size;
|
|
|
|
+ sql = MatchExpressionVal(sql);
|
|
}
|
|
}
|
|
|
|
|
|
var db = initDb(queryTable.databaseId);
|
|
var db = initDb(queryTable.databaseId);
|
|
@@ -939,7 +941,7 @@ namespace Util
|
|
}
|
|
}
|
|
else if(fieldQueryKind == "3") //范围匹配
|
|
else if(fieldQueryKind == "3") //范围匹配
|
|
{
|
|
{
|
|
- string[] val = fieldQueryValue.Split(':');
|
|
|
|
|
|
+ string[] val = RangeSplit(fieldQueryValue);
|
|
if(fieldQueryModel == "request_param")
|
|
if(fieldQueryModel == "request_param")
|
|
{
|
|
{
|
|
Dictionary<string, string> req = getRequestParams(projectId, content);
|
|
Dictionary<string, string> req = getRequestParams(projectId, content);
|
|
@@ -1201,7 +1203,7 @@ namespace Util
|
|
{
|
|
{
|
|
string val = GetQueryTableData(condiDic, returnField);
|
|
string val = GetQueryTableData(condiDic, returnField);
|
|
if(val == returnField) val = "0";
|
|
if(val == returnField) val = "0";
|
|
- expresssion = expresssion.Replace(returnField, Function.CheckInt(val));
|
|
|
|
|
|
+ expresssion = expresssion.Replace(returnField, Function.CheckNum(val));
|
|
|
|
|
|
string title = GetQueryTableTitle(condiDic, returnField);
|
|
string title = GetQueryTableTitle(condiDic, returnField);
|
|
checkTitle = checkTitle.Replace(returnField, title);
|
|
checkTitle = checkTitle.Replace(returnField, title);
|
|
@@ -1265,7 +1267,7 @@ namespace Util
|
|
}
|
|
}
|
|
else if(fieldQueryKind == "3") //范围匹配
|
|
else if(fieldQueryKind == "3") //范围匹配
|
|
{
|
|
{
|
|
- string[] val = checkVal.Split(':');
|
|
|
|
|
|
+ string[] val = RangeSplit(checkVal);
|
|
string valLeft = val[0];
|
|
string valLeft = val[0];
|
|
string valRight = val[1];
|
|
string valRight = val[1];
|
|
if(fieldQueryModel == "request_param")
|
|
if(fieldQueryModel == "request_param")
|
|
@@ -1613,7 +1615,7 @@ namespace Util
|
|
foreach(string returnField in returnFields)
|
|
foreach(string returnField in returnFields)
|
|
{
|
|
{
|
|
string val = GetQueryTableData(condiDic, returnField);
|
|
string val = GetQueryTableData(condiDic, returnField);
|
|
- expresssion = expresssion.Replace(returnField, Function.CheckInt(val));
|
|
|
|
|
|
+ expresssion = expresssion.Replace(returnField, Function.CheckNum(val));
|
|
|
|
|
|
string title = GetQueryTableTitle(condiDic, returnField);
|
|
string title = GetQueryTableTitle(condiDic, returnField);
|
|
checkTitle = checkTitle.Replace(returnField, title);
|
|
checkTitle = checkTitle.Replace(returnField, title);
|
|
@@ -1684,7 +1686,7 @@ namespace Util
|
|
}
|
|
}
|
|
else if(fieldQueryKind == "3") //范围匹配
|
|
else if(fieldQueryKind == "3") //范围匹配
|
|
{
|
|
{
|
|
- string[] val = checkVal.Split(':');
|
|
|
|
|
|
+ string[] val = RangeSplit(checkVal);
|
|
string valLeft = val[0];
|
|
string valLeft = val[0];
|
|
string valRight = val[1];
|
|
string valRight = val[1];
|
|
if(fieldQueryModel == "request_param")
|
|
if(fieldQueryModel == "request_param")
|
|
@@ -2324,7 +2326,7 @@ namespace Util
|
|
}
|
|
}
|
|
else if(fieldQueryKind == "3") //范围匹配
|
|
else if(fieldQueryKind == "3") //范围匹配
|
|
{
|
|
{
|
|
- string[] val = fieldQueryValue.Split(':');
|
|
|
|
|
|
+ string[] val = RangeSplit(fieldQueryValue);
|
|
if(fieldQueryModel == "request_param")
|
|
if(fieldQueryModel == "request_param")
|
|
{
|
|
{
|
|
Dictionary<string, string> req = getRequestParams(projectId, content);
|
|
Dictionary<string, string> req = getRequestParams(projectId, content);
|
|
@@ -2670,7 +2672,7 @@ namespace Util
|
|
}
|
|
}
|
|
else if(fieldQueryKind == "3") //范围匹配
|
|
else if(fieldQueryKind == "3") //范围匹配
|
|
{
|
|
{
|
|
- string[] val = fieldQueryValue.Split(':');
|
|
|
|
|
|
+ string[] val = RangeSplit(fieldQueryValue);
|
|
if(fieldQueryModel == "request_param")
|
|
if(fieldQueryModel == "request_param")
|
|
{
|
|
{
|
|
Dictionary<string, string> req = getRequestParams(projectId, content);
|
|
Dictionary<string, string> req = getRequestParams(projectId, content);
|
|
@@ -2885,7 +2887,7 @@ namespace Util
|
|
if(condiDic.Any(m => m.FieldEnName == returnField))
|
|
if(condiDic.Any(m => m.FieldEnName == returnField))
|
|
{
|
|
{
|
|
string val = GetQueryTableData(condiDic, returnField);
|
|
string val = GetQueryTableData(condiDic, returnField);
|
|
- expresssion = expresssion.Replace(returnField, Function.CheckInt(val));
|
|
|
|
|
|
+ expresssion = expresssion.Replace(returnField, Function.CheckNum(val));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
DataTable dt = new();
|
|
DataTable dt = new();
|
|
@@ -3039,5 +3041,10 @@ namespace Util
|
|
return "1900-01-01";
|
|
return "1900-01-01";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public static string[] RangeSplit(string str)
|
|
|
|
+ {
|
|
|
|
+ if(str.Contains(" - ")) return str.Split(" - ", StringSplitOptions.None);
|
|
|
|
+ return str.Split(':');
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|