修改存储过程
string selectSql = "select id,orderNO, orderdate, custCode, buyer, contact, exchName, taxRate, purchaseName,payPeriod, packType, shipAddress, toucher,createdate,remark from V_TM_PreSalesOrder where auditFalg=0 and orderdate between '" + fromDate + "' and '" + toDate + "'";
StringBuilder selectSqlBuilder = new StringBuilder();
selectSqlBuilder.Append(selectSql);
if (custList != null)
{
selectSqlBuilder.Append(" and custCode in (" + custList + ")");
}
if (orderNO != null)
{
selectSqlBuilder.Append(" and orderNo like '%" + orderNO + "%'");
}
这是以前写的查询语句是根据条件 拼成一句Sql语句 请问在存储过程里怎么写啊