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;
}
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;
}
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);
}
Aggregations