//查询条件
String urlParas = getPara("urlParas", "");
String name = getPara("name", "");
if(name.equals("") && !urlParas.equals("")){
try {
urlParas = URLDecoder.decode(urlParas,"UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
urlParas = "";
}
}else{
urlParas = "";
if(!name.equals("")){
urlParas += " and (";
urlParas += "A.name like '%" + name + "%'";
if(name.equals("苹果")){
urlParas += " or A.type=1";
}
if(name.equals("香蕉")){
urlParas += " or A.type=2";
}
if(name.equals("梨")){
urlParas += " or A.type=3";
}
urlParas += ")";
}
}
表名fruit,数据库内type属性定义,多表联查时定义为A表
type INT, --水果类型 (1:苹果;2:香蕉;3:梨)