这是一段jsp的查询代码,麻烦解释下功能是如何实现的,详细一点 80
sql="";sql="selecttop"+page_record+"*fromshangpinxinxiwhereissh='是'andidnotin(selectt...
sql="";
sql="select top "+page_record+" * from shangpinxinxi where issh='是' and id not in (select top "+((curpage-1)*page_record)+" id from shangpinxinxi where issh='是' order by id desc) ";
if(request.getParameter("bianhao")=="" ||request.getParameter("bianhao")==null ){}else{sql=sql+" and bianhao like '%"+new String(request.getParameter("bianhao").getBytes("8859_1"))+"%'";}
if(request.getParameter("mingcheng")=="" ||request.getParameter("mingcheng")==null ){}else{sql=sql+" and mingcheng like '%"+new String(request.getParameter("mingcheng").getBytes("8859_1"))+"%'";}
if(request.getParameter("leibie")=="所有" ||request.getParameter("leibie")==null ){}else{sql=sql+" and leibie like '%"+new String(request.getParameter("leibie").getBytes("8859_1"))+"%'";}
if(request.getParameter("faburen")=="" ||request.getParameter("faburen")==null ){}else{sql=sql+" and faburen like '%"+new String(request.getParameter("faburen").getBytes("8859_1"))+"%'";}
sql=sql+" order by id desc";
RS_result=connDbBean.executeQuery(sql);
String id="";
String bianhao="";String mingcheng="";String leibie="";String tupian="";String jianjie="";String qijia="";String jiezhishijian="";String faburen="";String issh="";
String addtime="";
int i=0;
while(RS_result.next()){
i=i+1;
id=RS_result.getString("id"); 展开
sql="select top "+page_record+" * from shangpinxinxi where issh='是' and id not in (select top "+((curpage-1)*page_record)+" id from shangpinxinxi where issh='是' order by id desc) ";
if(request.getParameter("bianhao")=="" ||request.getParameter("bianhao")==null ){}else{sql=sql+" and bianhao like '%"+new String(request.getParameter("bianhao").getBytes("8859_1"))+"%'";}
if(request.getParameter("mingcheng")=="" ||request.getParameter("mingcheng")==null ){}else{sql=sql+" and mingcheng like '%"+new String(request.getParameter("mingcheng").getBytes("8859_1"))+"%'";}
if(request.getParameter("leibie")=="所有" ||request.getParameter("leibie")==null ){}else{sql=sql+" and leibie like '%"+new String(request.getParameter("leibie").getBytes("8859_1"))+"%'";}
if(request.getParameter("faburen")=="" ||request.getParameter("faburen")==null ){}else{sql=sql+" and faburen like '%"+new String(request.getParameter("faburen").getBytes("8859_1"))+"%'";}
sql=sql+" order by id desc";
RS_result=connDbBean.executeQuery(sql);
String id="";
String bianhao="";String mingcheng="";String leibie="";String tupian="";String jianjie="";String qijia="";String jiezhishijian="";String faburen="";String issh="";
String addtime="";
int i=0;
while(RS_result.next()){
i=i+1;
id=RS_result.getString("id"); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询