using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Core.Mes.Client.Comm
{
public class CoreConverter
{
///
/// 生成SQL where条件字符串 "and condition in('args[1],args[2],...')"
///
/// 列名
/// 参数项
///
public static String toSqlConditionString(String column, String[] args)
{
StringBuilder str = new StringBuilder();
if (args != null && args.Length > 0)
{
str.Append(" AND ");
str.Append(column.ToUpper());
str.Append(" IN(");
foreach (String arg in args)
{
str.Append("'");
str.Append(arg);
str.Append("',");
}
str.Remove(str.Length - 1, 1);
str.Append(")");
}
return str.ToString();
}
}
}