@在SQL语句中是怎么使用的
String sql = "select * from Shippers where 1=1 ";
if( ShipperId !="")
sql += " and ShipperID="+ ShipperId;
if(CompanyName!="")
sql += " and CompanyName='"+ Phone+"'";
if(Phone!="")
sql += " and Phone='"+ Phone+"'";
Console.WriteLine(sql);
这段代码可真麻烦,有什么办法用@优化它们吗?谁会优化一下