//学生表格处理 ArrayList<WebStu> webStuArrayList = new ArrayList<WebStu>(); System.out.println(depts.length); for (int i = 0; i < depts.length; i++) { WebStu webStu = new WebStu(); String dept = depts[i]; webStu.setSdept(dept); sql = "select count(*) as num from student s, stupunchin sp where s.sno = sp.sno and s.sdept= ? and sp.sishot = ?"; Object[] obj2 = {dept, "是"}; int tbStuHotNum = FrontWebDao.findTotalCount(sql, obj2); webStu.setSishotNum(tbStuHotNum); sql = "select count(*) as num from student s, stupunchin sp where s.sno = sp.sno and s.sdept= ? and sp.siscough = ?"; int tbStuCoughNum = FrontWebDao.findTotalCount(sql, obj2); webStu.setSiscoughNum(tbStuCoughNum); sql = "select count(*) as num from student s, stupunchin sp where s.sno = sp.sno and s.sdept= ? and sp.sisseem = ?"; int tbStuSeemNum = FrontWebDao.findTotalCount(sql, obj2); webStu.setSisseemNum(tbStuSeemNum); sql = "select count(*) as num from student s, stupunchin sp where s.sno = sp.sno and s.sdept= ? and sp.sisdiagnose = ?"; int tbStuDiagNum = FrontWebDao.findTotalCount(sql, obj2); webStu.setSisdiagnoseNum(tbStuDiagNum); sql = "select count(*) as num from student s, stupunchin sp where s.sno = sp.sno and s.sdept= ? and sp.sstatus = ?"; Object[] obj3 = {dept, "异常"}; int tbStuStatusNum = FrontWebDao.findTotalCount(sql, obj3); webStu.setSstatusNum(tbStuStatusNum); webStuArrayList.add(webStu); } System.out.println(webStuArrayList); req.setAttribute("webStuArrayList", webStuArrayList);
//教师表格 ArrayList<WebTea> webTeaArrayList = new ArrayList<WebTea>(); for (int i = 0; i < depts.length; i++) {
//获取条件查询的参数 int currentPage1 = Integer.parseInt(currentPage); int rows1 = Integer.parseInt(rows);
//如果当前页数小于1,则设置当前页数为1 if (currentPage1 <= 0){ currentPage1 = 1; }
//设置StuPunch类的对象类型 PageBean<TeaPunch> pageBean = new PageBean<TeaPunch>();
//设置当前页码 pageBean.setCurrentPage(currentPage1);
//设置每页的记录数 pageBean.setRows(rows1);
sql = " select count(*) as num from teacher t, teapunchin tp where t.tno = tp.tno and t.tno like ? and t.tname like ? and tp.tpunchdate like ? and t.tdept = ?"; Object[] objects = {tno1, tname1, tpunchdate1, belong};
//计算总记录数,并设置 int totalCount = DeptAdminDao.findTotalCount(sql, objects); System.out.println(totalCount); pageBean.setTotalCount(totalCount);