中间加AND
select * from 表名 where 字段名='${自定义}' and 字段名='${自定义}' and是并且的意思
或者or
select * from 表名 where 字段名='${自定义}' or 字段名='${自定义}' or 是或者的意思
SQL里的条件这样写,可以实现同时按任意一个或两个条件查询
where 1=1
${if(len(学号)<>0, " and studentno='"+学号+"'","")}
${if(len(班级)<>0, " and classno<='"+班级+"'","")}
使用if公式:select*from table where 1=1
${if(len(学号)=0,""," and studentno = '"+学号+"'")}
${if(len(班级)=0,""," and classno= '"+班级+"'")}