根据后面的参数,拼接sql语句。如:sql = select * from tab where 1=1 if (编号) sql += and no=1 if(姓名) sql += and name=kitty