| | |
| | | * 题库列表 |
| | | */ |
| | | @RequestMapping(value = "/list", method = RequestMethod.GET) |
| | | public @ResponseBody Result pageList(String keyword,Short status, Integer pageSize, Integer pageNum) { |
| | | public @ResponseBody Result pageList(String keyword,Short status, Integer pageSize, Integer pageNum,String typeStatus) { |
| | | //判断是否是教师 |
| | | // String teacherId = ClientUtils.isAdmin() ? null : teacherService.getTeacherIdByUserId(ClientUtils.getUserId()); |
| | | String teacherId = ClientUtils.isAdmin() ? null : ClientUtils.getUserId(); |
| | |
| | | hqlCount = hqlCount.concat(" and createId=?"); |
| | | queryParam.add(teacherId); |
| | | } |
| | | if (StringUtils.isNotBlank(typeStatus)) { |
| | | hqlCount = hqlCount.concat(" and typeStatus=?"); |
| | | queryParam.add(typeStatus); |
| | | } |
| | | |
| | | int totalCount = commonDAO.findCount(hqlCount,queryParam); |
| | | // page赋值 |
| | |
| | | hqlBuffer.append(" and g.createId=?"); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(typeStatus)) { |
| | | hqlBuffer.append(" and g.typeStatus=?"); |
| | | } |
| | | hqlBuffer.append(" order by g.createTime DESC"); |
| | | List<Object[]> list = commonDAO.findList(hqlBuffer.toString(), page,queryParam,Object[].class); |
| | | if(list!=null&& list.size()>0){ |