| | |
| | | public ISqlSugarClient Db => BaseDal.Db; |
| | | |
| | | private PropertyInfo[] _propertyInfo { get; set; } = null; |
| | | private PropertyInfo[] TProperties |
| | | public PropertyInfo[] TProperties |
| | | { |
| | | get |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | where += $"{searchParametersList[i].Name} like '%{searchParametersList[i].Value}%'"; |
| | | where += $"[{searchParametersList[i].Name}] like '%{searchParametersList[i].Value}%'"; |
| | | } |
| | | } |
| | | else |
| | |
| | | } |
| | | else |
| | | { |
| | | where += $" and {searchParametersList[i].Name} like '%{searchParametersList[i].Value}%'"; |
| | | where += $" and [{searchParametersList[i].Name}] like '%{searchParametersList[i].Value}%'"; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (string.IsNullOrEmpty(where)) |
| | | where += $"{searchParametersList[i].Name} {searchParametersList[i].DisplayType} '{searchParametersList[i].Value}'"; |
| | | if (searchParametersList[i].DisplayType.GetLinqCondition() == LinqExpressionType.ThanOrEqual) |
| | | { |
| | | if (string.IsNullOrEmpty(where)) |
| | | where += $"{searchParametersList[i].Name} >= '{searchParametersList[i].Value}'"; |
| | | else |
| | | where += $" and {searchParametersList[i].Name} {searchParametersList[i].DisplayType.GetLinqCondition()} '{searchParametersList[i].Value}'"; |
| | | } |
| | | else if (searchParametersList[i].DisplayType.GetLinqCondition() == LinqExpressionType.LessThanOrEqual) |
| | | { |
| | | if (string.IsNullOrEmpty(where)) |
| | | where += $"{searchParametersList[i].Name} <= '{searchParametersList[i].Value}'"; |
| | | else |
| | | where += $" and {searchParametersList[i].Name} <= '{searchParametersList[i].Value}'"; |
| | | } |
| | | else |
| | | where += $" and {searchParametersList[i].Name} {searchParametersList[i].DisplayType} '{searchParametersList[i].Value}'"; |
| | | { |
| | | if (string.IsNullOrEmpty(where)) |
| | | where += $"{searchParametersList[i].Name} {searchParametersList[i].DisplayType} '{searchParametersList[i].Value}'"; |
| | | else |
| | | where += $" and {searchParametersList[i].Name} {searchParametersList[i].DisplayType} '{searchParametersList[i].Value}'"; |
| | | } |
| | | } |
| | | } |
| | | return where; |
| | |
| | | /// <param name="pageData"></param> |
| | | /// <param name="propertyInfo"></param> |
| | | /// <returns></returns> |
| | | private Dictionary<string, OrderByType> GetPageDataSort(PageDataOptions pageData, PropertyInfo[] propertyInfo) |
| | | public Dictionary<string, OrderByType> GetPageDataSort(PageDataOptions pageData, PropertyInfo[] propertyInfo) |
| | | { |
| | | if (!string.IsNullOrEmpty(pageData.Sort)) |
| | | { |