header.html
GoodsController.java
@RequestMapping(value = "selectGoods", method = RequestMethod.POST) public String selectGoods(Model model,HttpSession session,GoodsForm goodsForm,Device device){ log.info("检索相关商品"); model.addAttribute("commodityType", goodsService.getType()); Listlist=goodsService.searchGoodsListrelative(goodsForm); model.addAttribute("list",list); model.addAttribute("orderTypeId", 1); UVO uvo = (UVO)session.getAttribute("UVO"); if (uvo == null) { uvo = new UVO(); session.setAttribute("UVO", uvo); } CartForm cartForm = new CartForm(); cartForm.setGuestId(uvo.getGuestId()); model.addAttribute("cartList", cartService.searchCartList(cartForm)); model.addAttribute("goodsForm", goodsForm); if(device.isNormal()) { return "shop/list"; } else { return "mobile/list"; } }
GoodsService.java
public ListsearchGoodsListrelative(GoodsForm frm) { List result = queryDao.executeForObjectList("Goods.selectGoodsListrelative", frm); return result; }
GoodsSqlMap.xml