diff --git a/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs b/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs index 695f92e6..db622b59 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs @@ -62,45 +62,7 @@ namespace Tiobon.Core.Services continue; } if (!string.IsNullOrWhiteSpace(value)) - { - var jsonParam = JsonConvert.DeserializeObject(value); - - switch (jsonParam.operationKey) - { - case "Include": - conditions += $" AND {name} LIKE '%{jsonParam.columnValue}%'"; - break; - case "NotInclude": - conditions += $" AND {name} NOT LIKE '%{jsonParam.columnValue}%'"; - break; - case "IsNull": - conditions += $" AND {name} IS NULL"; - break; - case "NotNull": - conditions += $" AND {name} IS NOT NULL"; - break; - case "Equal": - conditions += $" AND {name} ='{jsonParam.columnValue}'"; - break; - case "NotEqual": - conditions += $" AND {name} !='{jsonParam.columnValue}'"; - break; - case "GreaterOrEqual"://大于等于 - conditions += $" AND {name} >='{jsonParam.columnValue}'"; - break; - case "Greater"://大于 - conditions += $" AND {name} >'{jsonParam.columnValue}'"; - break; - case "LessOrEqual"://小于等于 - conditions += $" AND {name} <='{jsonParam.columnValue}'"; - break; - case "Less"://小于 - conditions += $" AND {name} <'{jsonParam.columnValue}'"; - break; - default: - break; - } - } + conditions = DealConditions(conditions, name, value); } sql += conditions;