conditions+=$" AND Exists(select 1 from openjson(A.{name}) depts where Exists(select 1 from openjson('{jsonParam.columnValue.ToString()}') where value =depts.[value] ) )";
}
break;
case"NotEqualAny"://
if(jsonParam.columnValue!=null)
{
conditions+=$" AND NOT Exists(select 1 from openjson(A.{name}) depts where Exists(select 1 from openjson('{jsonParam.columnValue.ToString()}') where value =depts.[value] ) )";
conditions+=$" AND (Exists(select 1 from openjson(A.{name}) depts where Exists(select 1 from openjson('{jsonParam.columnValue.ToString()}') where value =depts.[value] ) ) OR "+
$"Exists(select 1 from openjson(A.Excl{name}) depts where Exists(select 1 from openjson('{jsonParam.columnValue.ToString()}') where value =depts.[value] ) ))";
break;
case"NotEqualAny"://
if(jsonParam.columnValue!=null)
conditions+=$" AND NOT (Exists(select 1 from openjson(A.{name}) depts where Exists(select 1 from openjson('{jsonParam.columnValue.ToString()}') where value =depts.[value] ) ) AND "+
$"Exists(select 1 from openjson(A.Excl{name}) depts where Exists(select 1 from openjson('{jsonParam.columnValue.ToString()}') where value =depts.[value] ) ))";
break;
default:
break;
}
continue;
}
if(!string.IsNullOrWhiteSpace(value))
conditions=DealConditions(conditions,name,value);
}
sql+=conditions;
countSql+=conditions;
inttotal=awaitDb.Ado.GetIntAsync(countSql);
sql="SELECT * FROM (SELECT *, ROW_NUMBER() OVER (ORDER BY "+filter.orderBy+") NUM FROM (SELECT * FROM ("+sql+" ";
sql+=") A ) B ) C";
sql+=" WHERE NUM <= "+filter.pageNum*filter.pageSize+" AND NUM >"+(filter.pageNum-1)*filter.pageSize;