在不用框架或者字符串拼接的情况下,实现多条件查询
sql语句:SELECT * FROM student
如果字段非空。正常传入:sql:SELECT * FROM student where stuno like ‘xx’ and pwd like ‘xx’ and id like ‘xx’
如果字段为空。在后端转成"%" 。则查询sql:SELECT * FROM student where stuno like ‘%’ and pwd like ‘%’ and id like ‘%’
这个方法在MySql上亲测可用。在其他数据库有待研究。