StringBuffer buf = new StringBuffer();
buf.append("from Servicelist as sl where 1=1 and sl.visValid = 'y' ");
if(vcustomerId!=null&&!vcustomerId.equals("")&& !vcustomerId.equals("null")){
buf.append("and sl.vcustomerId like '%" + vcustomerId +"%' ");
}
if(vserviceId != null && !vserviceId.equals("")&& !vserviceId.equals("null")) {
buf.append("and sl.vserviceId like '%" + vserviceId + "%' " );
}
if(vname != null && !vname.equals("")&& !vname.equals("null")){
buf.append("and sl.vname like '%" + vname + "%' " );
}
if(vstate != null && !vstate.equals("") && !vstate.equals("null")&& !vstate.equals("0") ) {
if(!vstate.equals("4")) {
buf.append("and sl.vstate like '%" + vstate + "%'");
}else {
buf.append("and sl.vstate like '%*%'");
}
}
ServicelistDAO servicelistdao = new ServicelistDAO();
List list = servicelistdao.list(buf.toString(), startrownum, pagenum);