一个搜索框实现多种属性搜索(二)

使用关键词进行替代搜索

String urlParas = getPara("urlParas","");
String indexes = getPara("indexes","");
if(indexes.equals("")&&!urlParas.equals("")){
  try {
  urlParas=URLDecoder.decode("urlParas", "utf-8");
  } catch (UnsupportedEncodingException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
  }
}else{
  urlParas = "";
  if(!indexes.equals("")){
  urlParas += " and (A.name like '%" + indexes + "%') or (B.hobby like '%" + indexes + "%')";
  }
}

转载于:https://www.cnblogs.com/FloraIgnace/p/7009575.html

你可能感兴趣的:(php,java,前端)