<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page import="java.sql.ResultSet"%> <% int hot_ID = 0; String hot_goodsName = ""; float hot_nowprice = 0; String hot_picture = ""; String sql=""; if(request.getParameter("type")!=null && request.getParameter("type")!=""){ int type=Integer.parseInt(request.getParameter("type")); sql="select top 7 t1.ID,t1.GoodsName,t1.nowprice,t1.picture from tb_goods t1,tb_subType t2 where t1.typeID=t2.ID and t2.superType=" + type + " order by t1.hit desc,t1.ID asc"; }else if(request.getParameter("typeSystem")!=null && request.getParameter("typeSystem")!=""){ int typeSystem = Integer.parseInt(request.getParameter("typeSystem")); sql="select top 7 ID,GoodsName,nowprice,picture from tb_goods where typeID=" + typeSystem + " order by hit desc,ID asc"; }else{ sql="select top 7 ID,GoodsName,nowprice,picture from tb_goods order by hit desc"; } %>