日期:2014-05-17 浏览次数:20849 次
<form name="" method="post" action="hindexnews_toinfosort.do" style="padding:0px; margin:0px;"> <ul> <li><input type="text" style="width:130px;" class="text_04" id="gq_name" name="gq_name" /></li> <li> <select class="text_04" style="width:100px;" id="infotype" name="infotype"> <option value="0000">---信息类型---</option> <option value="1">供</option> <option value="2">求</option> </select> </li> <li><input type="image" src="<%=path %>/images/dhcx_03.gif" onFocus="this.blur();"></li> </ul> </form>
/*** * 供求信息类别查询电话 * @author * @return */ public String toinfosort(){ HwebIndexDao dao=new HwebIndexDao(); inforowgq=hwebindexdao.findsecondinfo(); typeinfoList=dao.checkalltype(infoid,infotype,gq_name); if(page!=null){ currentpage=page; } fenye=new FenYe(30,typeinfoList.size(),Integer.parseInt(currentpage)); //System.out.println(sortLineList.size()); return "toinfosort"; }
/*** * 根据动态查询条件查询对应的 * @param sortid * @return */ public List<webInfoBean> checkalltype(String infoid,String infotype,String linename){ DBUtil dbUtil = new DBUtil(); List<webInfoBean> list=new ArrayList<webInfoBean>(); try { //动态sql 查询条件生成sql语句 StringBuilder strsql=new StringBuilder("select * from WEB_INFO where 1=1"); if(!SysUtility.isEmptyString(linename)){ strsql.append(" and INFO_TITLE like '%"+linename+"%'"); } strsql.append(" order by INFO_ID desc"); //System.out.println(strsql.toString()+"---------sql-------------"); dbUtil.createStatement(strsql.toString()); for(Object o:dbUtil.select(webInfoBean.class,"yyyy-MM-dd")){ list.add((webInfoBean)o); } } catch (Exception e) { log.error("HwebIndexDao.checkSort():", e); } finally { dbUtil.close(); } return list; }
<action name="hindexnews_*" method="{1}" class="com.wfwebsite.action.HindexNewsAction"> <result name="indexsecondinfo">/WEB-INF/homepage/indexSecondInfo.jsp</result> <result name="toinfosort">/WEB-INF/homepage/indexSecondInfoCheck.jsp</result> </action>