增加:
@RequestMapping(value="/createUser",method=RequestMethod.POST)
public String createUser(CreditVO creditVO,Model model)
{
if (creditVO!=null) {
creditService.createUser(creditVO);
}
/* Page page=new Page();
page.setCurrPageNo(pageNo);//设置当前页码
page.setPageSize(pageSize);//每页显示记录数
//计算sql语句的起始记录数及结束记录数的行数*/
/*int startRow=page.getStartRow();
int endRow=page.getEndRow();*/
int startRow=1;
int endRow=10;
Map<String, Object> map=new HashMap<String,Object>();
map.put("startRow", startRow);
map.put("endRow", endRow);
List<Credit> list=creditService.queryUserInfoMap(map);
model.addAttribute("creditVOList", list);
return "queryregister";
}
查询:
@RequestMapping(value="/intiqu",method=RequestMethod.POST)
public String queryUserInfoMap(Map<String, Object> map)
{
HttpServletRequest request=null;
List<Credit> list=null;
String status=request.getParameter("status");
//<input type="hidden" name="pageIndex" value="1"/>
//String currntPage=request.getParameter("pageIndex");
String currntPage="1";
if(currntPage==null)
currntPage="1";
int pageIndex=Integer.parseInt(currntPage);
//获取新闻记录总数量
int totalCount=creditService.gettotalCount();
//每页显示记录数
int pageSize=10;
/*获取总页数*/
Page pages=new Page();
pages.setCurrPageNo(pageIndex);
pages.setPageSize(pageSize);
pages.setRecordCount(totalCount);
int totalPage=pages.getTotalPageCount();
//控制首页和 末页
if(pageIndex<1)
pageIndex=1;
else if(pageIndex>totalPage)
pageIndex=totalPage;
Page page=new Page();
page.setCurrPageNo(pageIndex);//设置当前页码
page.setPageSize(pageSize);//每页显示记录数
//计算sql语句的起始记录数以及结束记录数的行数
int startRow=page.getStartRow();
int endRow=page.getEndRow();
map.put("startRow", startRow);
map.put("endRow", endRow);
list=creditService.queryUserInfoMap(map);
map.put("creditVOList", list);
map.put("status", status);
return "queryregister";
}