2
/** * 接收页面传递参数,插入数据库,并跳转列表 * @param sell * @param model * @return */ @RequestMapping("/insertSell.do") public String insertSell(SellInfo sell,Model model){ sellService.insert(sell); return "redirect:/login/sell.do"; } /** * 销售列表(包括查询结果显示) */ @RequestMapping("/sell.do") public String sell(Model model,String phone,HttpServletRequest request){ HttpSession session = request.getSession(); String storePhone = (String) session.getAttribute("storePhone"); if(session.getAttribute("user")==null || "".equals(session.getAttribute("user"))){ return "redirect:/login/login.do"; } /*Page page = sellService.findPage(phone,storePhone); //页面显示 Map show = sellService.storeShow(storePhone); model.addAttribute("show", show); model.addAttribute("sells", page.getLists()); model.addAttribute("rows",page.getRows()); model.addAttribute("pageSize", page.getPageSize()); model.addAttribute("totalPage", page.getTotalPage());*/ Map show = sellService.findAll(phone, storePhone); model.addAttribute("show", show); //条件查询时使用 model.addAttribute("phone", phone); return "sell"; }