@RequestMapping(params = "datagrid") public void datagrid(StudentsEntity student, HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) { String school = student.getSchool(); String stuName = student.getStuName(); String stuGrade = student.getStuGrade(); String stuClass = student.getStuClass(); CriteriaQuery cq = new CriteriaQuery(StudentsEntity.class, dataGrid); if(StringUtils.isNotEmpty(school)) { cq.add(Restrictions.sqlRestriction("school like '%" + school + "%'")); } if(StringUtils.isNotEmpty(stuName)) { cq.add(Restrictions.sqlRestriction("stu_name like '%" + stuName + "%'")); } if(StringUtils.isNotEmpty(stuGrade)) { cq.add(Restrictions.sqlRestriction("stu_grade like '%" + stuGrade + "%'")); } if(StringUtils.isNotEmpty(stuClass)) { cq.add(Restrictions.sqlRestriction("stu_class like '%" + stuClass + "%'")); } this.studentsService.getDataGridReturn(cq, true); TagUtil.datagrid(response, dataGrid); }