求助!
大家有没有遇到或开发过这种东西,在页面拼接sql的where条件。求样例
下图表格作为页面
GET http://localhost:10008/RsAlarmRule?Where("t=>t.LevelOption==4").Count()
_cPagedControl.RemoteLoadAndCallback = t =>
{
var userMap = RpcHttp.Current.GetJson<List<RsUserMap.BeanGetResponse>>($"{nameof(RsUserMap)}").Data;
_userIdNameMap = userMap.ToDictionary(t => t.Id, response => response.Name);
var condition = $"{DataGrid?.GetQueryFilterString()}{SearchControlEx?.GetQueryFilterString()}";
var rowsTotal = RpcHttp.Current.GetJson<int>($"{nameof(RsAlarmRule)}?{condition}.Count()").Data;
var skip = t.CountPerPage * (t.IndexPage - 1);
skip = skip >= 0 ? skip : 0;
condition = $"{condition}{DataGrid?.GetQuerySortString()}{PagedControl?.GetQueryPageString(skip, t.CountPerPage)}";
var userData = RpcHttp.Current.GetJson<ObservableCollection<ParentAndItems<TbAlarmRule, TbAlarmRuleItemBase>>>($"{nameof(RsAlarmRuleComplex)}?{condition}",TypeNameHandling.All).Data;
return new PagedControl.BeanRemoteCallback(rowsTotal, t.IndexPage, userData);
};