List<string> ConditionList = new List<string>();
List<string> tempParameters = new List<string>();//用来存(@a0,@a1,@a2)
string value = HttpContext.Current.Request[parameter.ParameterCode];//请求过来的数据
string[] valueArr = value.Split(",");
for (int i = 0; i < valueArr.Length; i++)
{
tempParameters.Add($"@{parameter.ParameterCode}{i}");//@a0
sqlParameters.Add(new SqlParameter()
{
ParameterName = $"@{parameter.ParameterCode}{i}",
Value = valueArr[i]
});
}
ConditionList.Add($"{parameter.TableCode}.{parameter.FieldsCode} in({string.Join(",", tempParameters)})");