Search in sources :

Example 1 with SysDictTree

use of org.jeecg.modules.system.model.SysDictTree in project kms by mahonelau.

the class SysDictController method treeList.

/**
 * @功能:获取树形字典数据
 * @param sysDict
 * @param pageNo
 * @param pageSize
 * @param req
 * @return
 */
@SuppressWarnings("unchecked")
@RequestMapping(value = "/treeList", method = RequestMethod.GET)
public Result<List<SysDictTree>> treeList(SysDict sysDict, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
    Result<List<SysDictTree>> result = new Result<>();
    LambdaQueryWrapper<SysDict> query = new LambdaQueryWrapper<>();
    // 构造查询条件
    String dictName = sysDict.getDictName();
    if (oConvertUtils.isNotEmpty(dictName)) {
        query.like(true, SysDict::getDictName, dictName);
    }
    query.orderByDesc(true, SysDict::getCreateTime);
    List<SysDict> list = sysDictService.list(query);
    List<SysDictTree> treeList = new ArrayList<>();
    for (SysDict node : list) {
        treeList.add(new SysDictTree(node));
    }
    result.setSuccess(true);
    result.setResult(treeList);
    return result;
}
Also used : SysDictTree(org.jeecg.modules.system.model.SysDictTree) SysDict(org.jeecg.modules.system.entity.SysDict) Result(org.jeecg.common.api.vo.Result) LambdaQueryWrapper(com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper)

Example 2 with SysDictTree

use of org.jeecg.modules.system.model.SysDictTree in project jeecg-boot by jeecgboot.

the class SysDictController method treeList.

/**
 * @功能:获取树形字典数据
 * @param sysDict
 * @param pageNo
 * @param pageSize
 * @param req
 * @return
 */
@SuppressWarnings("unchecked")
@RequestMapping(value = "/treeList", method = RequestMethod.GET)
public Result<List<SysDictTree>> treeList(SysDict sysDict, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
    Result<List<SysDictTree>> result = new Result<>();
    LambdaQueryWrapper<SysDict> query = new LambdaQueryWrapper<>();
    // 构造查询条件
    String dictName = sysDict.getDictName();
    if (oConvertUtils.isNotEmpty(dictName)) {
        query.like(true, SysDict::getDictName, dictName);
    }
    query.orderByDesc(true, SysDict::getCreateTime);
    List<SysDict> list = sysDictService.list(query);
    List<SysDictTree> treeList = new ArrayList<>();
    for (SysDict node : list) {
        treeList.add(new SysDictTree(node));
    }
    result.setSuccess(true);
    result.setResult(treeList);
    return result;
}
Also used : SysDictTree(org.jeecg.modules.system.model.SysDictTree) SysDict(org.jeecg.modules.system.entity.SysDict) Result(org.jeecg.common.api.vo.Result) LambdaQueryWrapper(com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper)

Example 3 with SysDictTree

use of org.jeecg.modules.system.model.SysDictTree in project kykms by mahonelau.

the class SysDictController method treeList.

/**
 * @功能:获取树形字典数据
 * @param sysDict
 * @param pageNo
 * @param pageSize
 * @param req
 * @return
 */
@SuppressWarnings("unchecked")
@RequestMapping(value = "/treeList", method = RequestMethod.GET)
public Result<List<SysDictTree>> treeList(SysDict sysDict, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
    Result<List<SysDictTree>> result = new Result<>();
    LambdaQueryWrapper<SysDict> query = new LambdaQueryWrapper<>();
    // 构造查询条件
    String dictName = sysDict.getDictName();
    if (oConvertUtils.isNotEmpty(dictName)) {
        query.like(true, SysDict::getDictName, dictName);
    }
    query.orderByDesc(true, SysDict::getCreateTime);
    List<SysDict> list = sysDictService.list(query);
    List<SysDictTree> treeList = new ArrayList<>();
    for (SysDict node : list) {
        treeList.add(new SysDictTree(node));
    }
    result.setSuccess(true);
    result.setResult(treeList);
    return result;
}
Also used : SysDictTree(org.jeecg.modules.system.model.SysDictTree) SysDict(org.jeecg.modules.system.entity.SysDict) Result(org.jeecg.common.api.vo.Result) LambdaQueryWrapper(com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper)

Aggregations

LambdaQueryWrapper (com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper)3 Result (org.jeecg.common.api.vo.Result)3 SysDict (org.jeecg.modules.system.entity.SysDict)3 SysDictTree (org.jeecg.modules.system.model.SysDictTree)3