where sm.iStatus=1 and 1=1 ---iStatus订单状态=1
${if(len(客户名称)=0,"","and Cus.cCusAbbName='"+客户名称+"'")} ---这里我想模糊查询
${if(len(状态)=0,"","and sd.cdefine28='"+状态+"'")}
${if(len(采购订单)=0,"","and M.cPOID='"+采购订单+"'")}
${if(len(规格型号)=0,"","and I.cInvStd='"+规格型号+"'")} ---- 这里我想模糊查询
${if(len(业务员)=0,"","and P.cPersonName='"+业务员+"'")} ---这里我想模糊查询
${if(len(年度)=0,"","and 2017='"+年度+"'")}
${if(len(开始时间)=0,"","and SM.dDate between '"+开始时间+"' and '"+结束时间+"'")}