Search in sources :

Example 1 with SysResources

use of com.zyd.blog.persistence.beans.SysResources in project OneBlog by zhangyd-c.

the class SysResourcesServiceImpl method findPageBreakByCondition.

/**
 * 分页查询
 *
 * @param vo
 * @return
 */
@Override
public PageInfo<Resources> findPageBreakByCondition(ResourceConditionVO vo) {
    PageHelper.startPage(vo.getPageNumber(), vo.getPageSize());
    List<SysResources> sysResources = resourceMapper.findPageBreakByCondition(vo);
    if (CollectionUtils.isEmpty(sysResources)) {
        return null;
    }
    List<Resources> resources = this.getResources(sysResources);
    PageInfo bean = new PageInfo<SysResources>(sysResources);
    bean.setList(resources);
    return bean;
}
Also used : PageInfo(com.github.pagehelper.PageInfo) SysResources(com.zyd.blog.persistence.beans.SysResources) Resources(com.zyd.blog.business.entity.Resources) SysResources(com.zyd.blog.persistence.beans.SysResources)

Example 2 with SysResources

use of com.zyd.blog.persistence.beans.SysResources in project OneBlog by zhangyd-c.

the class SysResourcesServiceImpl method queryResourcesListWithSelected.

/**
 * 获取ztree使用的资源列表
 *
 * @param rid
 * @return
 */
@Override
public List<Map<String, Object>> queryResourcesListWithSelected(Long rid) {
    List<SysResources> sysResources = resourceMapper.queryResourcesListWithSelected(rid);
    if (CollectionUtils.isEmpty(sysResources)) {
        return null;
    }
    List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>();
    Map<String, Object> map = null;
    for (SysResources resources : sysResources) {
        map = new HashMap<String, Object>(3);
        map.put("id", resources.getId());
        map.put("pId", resources.getParentId());
        map.put("checked", resources.getChecked());
        map.put("name", resources.getName());
        mapList.add(map);
    }
    return mapList;
}
Also used : SysResources(com.zyd.blog.persistence.beans.SysResources)

Example 3 with SysResources

use of com.zyd.blog.persistence.beans.SysResources in project OneBlog by zhangyd-c.

the class SysResourcesServiceImpl method getByPrimaryKey.

@Override
public Resources getByPrimaryKey(Long primaryKey) {
    Assert.notNull(primaryKey, "PrimaryKey不可为空!");
    SysResources sysResources = resourceMapper.selectByPrimaryKey(primaryKey);
    return null == sysResources ? null : new Resources(sysResources);
}
Also used : SysResources(com.zyd.blog.persistence.beans.SysResources) Resources(com.zyd.blog.business.entity.Resources) SysResources(com.zyd.blog.persistence.beans.SysResources)

Aggregations

SysResources (com.zyd.blog.persistence.beans.SysResources)3 Resources (com.zyd.blog.business.entity.Resources)2 PageInfo (com.github.pagehelper.PageInfo)1