%@page contentType="text/html;charset=utf-8" import="java.sql.*,java.util.*,jerehnet.jsp.database.*,jerehnet.jsp.util.*,java.text.SimpleDateFormat,java.util.regex.Matcher,java.util.regex.Pattern"%> <% PoolManager pool = new PoolManager(); if (pool == null) { pool = new PoolManager(); } Connection conn = null; Pagination pagination = new Pagination(); //设置每页显示条数 int pageCount = 6; //pageCount = Integer.parseInt(Common.getFormatInt(request.getParameter("pageCount"))); if(pageCount==0){ pageCount = 10; } pagination.setCountOfPage(pageCount); DataManager db = new DataManager(); String channelNo=Common.getFormatStr(request.getParameter("channelNo")); String keywords=Common.getFormatStr(request.getParameter("keywords")); String sdate=Common.getFormatStr(request.getParameter("sdate")); String edate=Common.getFormatStr(request.getParameter("edate")); String orderword=Common.getFormatStr(request.getParameter("orderword")); try { conn = pool.getConnection(); String offset = Common.getFormatInt(request.getParameter("offset")); //搜索条件形成 String searchStr = " where website_no='20150619082201914' and channel_node='20150619091043126' and is_show=1 "; if(!keywords.equals("")&&!keywords.equals("关键词搜索")){ searchStr+=" and title like '%"+keywords+"%' "; } if(!sdate.equals("")&&!edate.equals("")){ searchStr+=" and pub_date between '"+sdate+"' and '"+edate+"' "; } if(orderword.equals("")||orderword.equals("1")){ searchStr += " order by pub_date desc"; }else if(orderword.equals("2")){ searchStr += " order by view_count desc"; } String query = "select * from jrcms_information" + searchStr; ResultSet rs = pagination.getQueryResult(query, request, conn); int showPages = 10;//底部页数显示个数 String channelsql="select * from jrcms_website_channel where website_no='20150619082201914' and parent_no='20150619091106970' and is_show=1"; ResultSet channelRs=db.executeQuery(conn,channelsql); String channels=""; while(channelRs!=null&&channelRs.next()){ channels+="'"+channelRs.getString("no")+"',"; } channels=channels.substring(0, channels.lastIndexOf(",")); String newssql= "select top 6 * from jrcms_Information where website_no='20150619082201914' and channel_Node in("+channels+") and is_recommend='1' and is_show =1 order by pub_date desc,orderno "; ResultSet htrs = db.executeQuery(conn,newssql); %>