@RequestMapping(params = "getChildren") @ResponseBody public List<ComboTree> getChildren(HttpServletRequest request, ComboTree comboTree) { CriteriaQuery cq = new CriteriaQuery(TSTerritory.class); if (comboTree.getId() != null) { cq.eq("TSTerritory.id", comboTree.getId()); } else { cq.eq("TSTerritory.id", "1"); // 这个是全国最高级 } cq.addOrder("territoryCode", SortDirection.asc); cq.add(); List<TSTerritory> list = systemService.getListByCriteriaQuery(cq, false); ComboTreeModel comboTreeModel = new ComboTreeModel("id", "territoryName", "TSTerritorys"); List<ComboTree> comboTrees = systemService.ComboTree(list, comboTreeModel, null); return comboTrees; }
/** * 加载dataTables 默认查询条件 * * @param dataTables */ public void addJqCriteria(DataTables dataTables) { String search = dataTables.getSearch(); // 查询关键字 SortInfo[] sortInfo = dataTables.getSortColumns(); // 排序字段 String[] sColumns = dataTables.getsColumns().split(","); // 字段 if (StringUtil.isNotEmpty(search)) { for (String string : sColumns) { if (string.indexOf("_") == -1) { jqcriterionList.addPara(Restrictions.like(string, "%" + search + "%")); } } add(getOrCriterion(jqcriterionList)); } if (sortInfo.length > 0) { for (SortInfo sortInfo2 : sortInfo) { addOrder("" + sColumns[sortInfo2.getColumnId()] + "", sortInfo2.getSortOrder()); } } }
@RequestMapping(params = "exportXls") public String exportXls( FullStatisticsMonthEntity fullStatisticsMonth, HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid, ModelMap map) { CriteriaQuery cq = new CriteriaQuery(FullStatisticsMonthEntity.class, dataGrid); // 设置默认的排序及排序字雄姿英发 cq.addOrder("sumMonth", SortDirection.desc); org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql( cq, fullStatisticsMonth, request.getParameterMap()); List<FullStatisticsMonthEntity> fullStatisticsMonthList = this.fullStatisticsMonthService.getListByCriteriaQuery(cq, false); map.put(NormalExcelConstants.FILE_NAME, "全量统计"); map.put(NormalExcelConstants.CLASS, FullStatisticsMonthEntity.class); ExportParams exportParams = new ExportParams(); map.put(NormalExcelConstants.PARAMS, exportParams); map.put(NormalExcelConstants.DATA_LIST, fullStatisticsMonthList); return NormalExcelConstants.JEECG_EXCEL_VIEW; }