org.beetl.sql.core.engine.PageQuery Java Examples
The following examples show how to use
org.beetl.sql.core.engine.PageQuery.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JasonConfig.java From springboot-plus with BSD 3-Clause "New" or "Revised" License | 6 votes |
@Override public void serialize(JsonResult value, JsonGenerator gen, SerializerProvider serializers) throws IOException { gen.writeStartObject(); if(value.getCode().equals("200")) { gen.writeObjectField("code", 0); }else { gen.writeObjectField("code", Integer.parseInt(value.getCode())); } gen.writeStringField("msg", value.getMsg()); Object data = value.getData(); if(data instanceof PageQuery ) { PageQuery query = (PageQuery)(data); gen.writeObjectField("count", query.getTotalRow()); gen.writeObjectField("data", query.getList()); }else { gen.writeObjectField("data", data); } gen.writeEndObject(); }
Example #2
Source File: FunctionConsoleService.java From springboot-plus with BSD 3-Clause "New" or "Revised" License | 6 votes |
public void queryByCondtion(PageQuery<CoreFunction> query) { functionDao.queryByCondtion(query); List<CoreFunction> list = query.getList(); this.queryListAfter(list); //处理父功能名称显示 FunctionItem root = platformService.buildFunction(); for(CoreFunction function:list) { Long parentId = function.getParentId(); String name = ""; if(parentId != 0) { FunctionItem item = root.findChild(parentId); name = item!=null?item.getName():""; } function.set("parentFunctionText", name); } }
Example #3
Source File: RoleConsoleService.java From springboot-plus with BSD 3-Clause "New" or "Revised" License | 6 votes |
public PageQuery<CoreUser> queryRoleUser(PageQuery query) { OrgItem root = platformService.buildOrg(); PageQuery<CoreUser> ret = roleDao.queryUser(query); List<CoreUser> list = ret.getList(); //从缓存里取出组织机构名称 for(CoreUser user:list) { Long orgId = user.getOrgId(); Integer orgId1 = (Integer)user.get("orgId1"); user.set("orgIdText", root.findChild(orgId).getName()); user.set("orgId1Text", root.findChild((long)orgId1).getName()); } //再次处理数据字典 this.queryListAfter(list); return ret; }
Example #4
Source File: UserConsoleService.java From springboot-plus with BSD 3-Clause "New" or "Revised" License | 6 votes |
public List<UserExcelExportData> queryExcel(PageQuery<CoreUser> query) { PageQuery<CoreUser> ret = userDao.queryByCondtion(query); List<CoreUser> list = ret.getList(); OrgItem orgRoot = platformService.buildOrg(); List<UserExcelExportData> items = new ArrayList<>(); for(CoreUser user:list) { UserExcelExportData userItem = new UserExcelExportData(); userItem.setCode(user.getCode()); userItem.setId(user.getId()); userItem.setName(user.getName()); CoreDict dict = dictService.findCoreDict(CoreDictType.USER_STATE,user.getState()); userItem.setStateText(dict.getName()); if(StringUtils.isNotEmpty(user.getJobType1())){ dict = dictService.findCoreDict("job_type",user.getJobType1()); userItem.setJobType1Text(dict.getName()); } String orgName = orgRoot.findChild(user.getOrgId()).getName(); userItem.setOrgText(orgName); items.add(userItem); } return items; }
Example #5
Source File: OrgConsoleService.java From springboot-plus with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** * 根据条件查询 * @param query */ public void queryByCondtion(PageQuery query) { orgDao.queryByCondtion(query); List<CoreOrg> list = query.getList(); queryListAfter(list); OrgItem root = platformService.buildOrg(); //处理父机构名称显示,没有用sql查询是考虑到跨数据库 for(CoreOrg org:list) { Long parentId = org.getParentOrgId(); OrgItem item = root.findChild(parentId); String name = item!=null?item.getName():""; org.set("parentOrgText", name); } }
Example #6
Source File: UserServiceTest.java From spring-boot-demo with MIT License | 5 votes |
@Test public void getUserByPage() { List<User> userList = userService.getUserList(); PageQuery<User> userByPage = userService.getUserByPage(1, 5); Assert.assertEquals(5, userByPage.getList().size()); Assert.assertEquals(userList.size(), userByPage.getTotalRow()); log.debug("【userByPage】= {}", JSONUtil.toJsonStr(userByPage)); }
Example #7
Source File: UserServiceTest.java From spring-boot-demo with MIT License | 5 votes |
@Test public void getUserByPage() { List<User> userList = userService.getUserList(); PageQuery<User> userByPage = userService.getUserByPage(1, 5); Assert.assertEquals(5, userByPage.getList().size()); Assert.assertEquals(userList.size(), userByPage.getTotalRow()); log.debug("【userByPage】= {}", JSONUtil.toJsonStr(userByPage)); }
Example #8
Source File: PageParam.java From springboot-plus with BSD 3-Clause "New" or "Revised" License | 5 votes |
@JsonIgnore public PageQuery getPageQuery() { PageQuery query = new PageQuery(); query.setParas(this); if (page != null) { query.setPageNumber(page); query.setPageSize(limit); } return query; }
Example #9
Source File: DictConsoleService.java From springboot-plus with BSD 3-Clause "New" or "Revised" License | 5 votes |
public List<CoreDict> queryExcel(PageQuery<CoreUser> query) { //同查询,不需要额外数据 PageQuery ret = dictDao.queryByCondition(query); queryListAfter(ret.getList()); return ret.getList(); }
Example #10
Source File: OrgConsoleController.java From springboot-plus with BSD 3-Clause "New" or "Revised" License | 5 votes |
@PostMapping(MODEL + "/user/list.json") @Function("org.query") @ResponseBody public JsonResult<PageQuery<CoreUser>> getUsers(OrgUserQuery userQuery) { PageQuery<CoreUser> page = userQuery.getPageQuery(); userConsoleService.queryByCondtion(page); return JsonResult.success(page); }
Example #11
Source File: OrgConsoleController.java From springboot-plus with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** * 组织机构列表 分页 * @param condtion 查询条件 * @return */ @PostMapping(MODEL + "/list.json") @Function("org.query") @ResponseBody public JsonResult<PageQuery<CoreOrg>> list(OrgQuery condtion) { PageQuery page = condtion.getPageQuery(); orgConsoleService.queryByCondtion(page); return JsonResult.success(page); }
Example #12
Source File: UserConsoleController.java From springboot-plus with BSD 3-Clause "New" or "Revised" License | 5 votes |
@PostMapping(MODEL + "/list.json") @Function("user.query") @ResponseBody public JsonResult<PageQuery<CoreUser>> index(UserQuery condtion) { PageQuery<CoreUser> page = condtion.getPageQuery(); userConsoleService.queryByCondtion(page); return JsonResult.success(page); }
Example #13
Source File: UserServiceTest.java From spring-boot-demo with MIT License | 5 votes |
@Test public void getUserByPage() { List<User> userList = userService.getUserList(); PageQuery<User> userByPage = userService.getUserByPage(1, 5); Assert.assertEquals(5, userByPage.getList().size()); Assert.assertEquals(userList.size(), userByPage.getTotalRow()); log.debug("【userByPage】= {}", JSONUtil.toJsonStr(userByPage)); }
Example #14
Source File: RoleConsoleController.java From springboot-plus with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** * 列表页、 分页数据 * * @param condtion * @return */ @PostMapping(MODEL + "/list.json") @Function("role.query") @ResponseBody public JsonResult<PageQuery> list(RoleQuery condtion) { PageQuery page = condtion.getPageQuery(); roleConsoleService.queryByCondtion(page); return JsonResult.success(page); }
Example #15
Source File: RoleConsoleController.java From springboot-plus with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** * 查询角色下授权用户列表 * * @param queryCondtion * 查询条件 * @return */ @PostMapping(MODEL + "/user/list.json") @Function("role.user.query") @ResponseBody public JsonResult<PageQuery<CoreUser>> userList(RoleUserQuery query) { PageQuery page = query.getPageQuery(); PageQuery<CoreUser> pageQuery = roleConsoleService.queryRoleUser(page); return JsonResult.success(page); }
Example #16
Source File: MenuController.java From springboot-plus with BSD 3-Clause "New" or "Revised" License | 5 votes |
@PostMapping(MODEL + "/list.json") @Function("menu.query") @ResponseBody public JsonResult<PageQuery> list(MenuQuery condtion) { PageQuery page = condtion.getPageQuery(); menuService.queryByCondtion(page); return JsonResult.success(page); }
Example #17
Source File: AuditConsoleController.java From springboot-plus with BSD 3-Clause "New" or "Revised" License | 5 votes |
@RequestMapping(MODEL + "/list.json") @Function("audit.query") @ResponseBody public JsonResult<PageQuery<CoreAudit>> list(AuditQuery condtion) { PageQuery<CoreAudit> page = condtion.getPageQuery(); auditConsoleService.queryByCondtion(page); return JsonResult.success(page); }
Example #18
Source File: DictConsoleController.java From springboot-plus with BSD 3-Clause "New" or "Revised" License | 5 votes |
@PostMapping(MODEL + "/list.json") @Function("dict.query") @ResponseBody public JsonResult<PageQuery> list(CoreDictQuery condtion) { PageQuery page = condtion.getPageQuery(); dictService.queryByCondition(page); return JsonResult.success(page); }
Example #19
Source File: DictConsoleController.java From springboot-plus with BSD 3-Clause "New" or "Revised" License | 5 votes |
@PostMapping(MODEL + "/excel/export.json") @Function("dict.export") @ResponseBody public JsonResult<String> export(HttpServletResponse response,UserQuery condtion) { String excelTemplate ="excelTemplates/admin/dict/dict_collection_template.xls"; PageQuery<CoreUser> page = condtion.getPageQuery(); //取出全部符合条件的 page.setPageSize(Integer.MAX_VALUE); page.setPageNumber(1); page.setTotalRow(Integer.MAX_VALUE); List<CoreDict> dicts =dictService.queryExcel(page); try(InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(excelTemplate)) { if(is==null) { throw new PlatformException("模板资源不存在:"+excelTemplate); } FileItem item = fileService.createFileTemp("dict_collection.xls"); OutputStream os = item.openOutpuStream(); Context context = new Context(); context.putVar("dicts", dicts); JxlsHelper.getInstance().processTemplate(is, os, context); os.close(); //下载参考FileSystemContorller return JsonResult.success(item.getPath()); } catch (IOException e) { throw new PlatformException(e.getMessage()); } }
Example #20
Source File: UserConsoleController.java From springboot-plus with BSD 3-Clause "New" or "Revised" License | 5 votes |
@PostMapping(MODEL + "/excel/export.json") @Function("user.export") @ResponseBody public JsonResult<String> export(HttpServletResponse response,UserQuery condtion) { String excelTemplate ="excelTemplates/admin/user/user_collection_template.xls"; PageQuery<CoreUser> page = condtion.getPageQuery(); //取出全部符合条件的 page.setPageSize(Integer.MAX_VALUE); page.setPageNumber(1); page.setTotalRow(Integer.MAX_VALUE); List<UserExcelExportData> users =userConsoleService.queryExcel(page); try(InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(excelTemplate)) { if(is==null) { throw new PlatformException("模板资源不存在:"+excelTemplate); } FileItem item = fileService.createFileTemp("user_collection.xls"); OutputStream os = item.openOutpuStream(); Context context = new Context(); context.putVar("users", users); JxlsHelper.getInstance().processTemplate(is, os, context); //下载参考FileSystemContorller return JsonResult.success(item.getPath()); } catch (IOException e) { throw new PlatformException(e.getMessage()); } }
Example #21
Source File: FunctionController.java From springboot-plus with BSD 3-Clause "New" or "Revised" License | 5 votes |
/** * 字典列表 分页 * * @param condtion * @return */ @RequestMapping(MODEL + "/list.json") @Function("function.query") @ResponseBody public JsonResult<PageQuery<CoreFunction>> list(FunctionQuery condtion) { PageQuery page = condtion.getPageQuery(); functionConsoleService.queryByCondtion(page); return JsonResult.success(page); }
Example #22
Source File: DictConsoleService.java From springboot-plus with BSD 3-Clause "New" or "Revised" License | 4 votes |
public PageQuery<CoreDict>queryByCondition(PageQuery query){ PageQuery ret = dictDao.queryByCondition(query); queryListAfter(ret.getList()); return ret; }
Example #23
Source File: service.java From springboot-plus with BSD 3-Clause "New" or "Revised" License | 4 votes |
queryByCondition(PageQuery query){ PageQuery ret = ${entity.code}Dao.queryByCondition(query); queryListAfter(ret.getList()); return ret; }
Example #24
Source File: RoleConsoleService.java From springboot-plus with BSD 3-Clause "New" or "Revised" License | 4 votes |
/** * 根据条件查询 * @param query */ public void queryByCondtion(PageQuery query) { roleDao.queryByCondtion(query); super.queryListAfter(query.getList()); }
Example #25
Source File: controller.java From springboot-plus with BSD 3-Clause "New" or "Revised" License | 4 votes |
@PostMapping(MODEL + "/list.json") \@Function("${entity.code}.query") \@ResponseBody public JsonResult<PageQuery> list(${entity.name}
Example #26
Source File: MenuConsoleService.java From springboot-plus with BSD 3-Clause "New" or "Revised" License | 4 votes |
public void queryByCondtion(PageQuery<CoreMenu> query) { menuDao.queryByCondtion(query); queryListAfter(query.getList()); }
Example #27
Source File: UserServiceImpl.java From spring-boot-demo with MIT License | 2 votes |
/** * 分页查询 * * @param currentPage 当前页 * @param pageSize 每页条数 * @return 分页用户列表 */ @Override public PageQuery<User> getUserByPage(Integer currentPage, Integer pageSize) { return userDao.createLambdaQuery().page(currentPage, pageSize); }
Example #28
Source File: RoleConsoleDao.java From springboot-plus with BSD 3-Clause "New" or "Revised" License | 2 votes |
/** * 根据条件分页查询 * @param query 查询条件 */ void queryByCondtion(PageQuery query);
Example #29
Source File: UserServiceImpl.java From spring-boot-demo with MIT License | 2 votes |
/** * 分页查询 * * @param currentPage 当前页 * @param pageSize 每页条数 * @return 分页用户列表 */ @Override public PageQuery<User> getUserByPage(Integer currentPage, Integer pageSize) { return userDao.createLambdaQuery().page(currentPage, pageSize); }
Example #30
Source File: UserService.java From spring-boot-demo with MIT License | 2 votes |
/** * 分页查询 * * @param currentPage 当前页 * @param pageSize 每页条数 * @return 分页用户列表 */ PageQuery<User> getUserByPage(Integer currentPage, Integer pageSize);