Search in sources :

Example 1 with SysRolePermissionExample

use of com.megagao.production.ssm.domain.authority.SysRolePermissionExample in project production_ssm by megagao.

the class PermissionServiceImpl method getList.

@Override
public EUDataGridResult getList(int page, int rows, SysRolePermission sysRolePermission) throws Exception {
    // 查询列表
    SysRolePermissionExample example = new SysRolePermissionExample();
    // 分页处理
    PageHelper.startPage(page, rows);
    List<SysRolePermission> list = sysRolePermissionMapper.selectByExample(example);
    // 创建一个返回值对象
    EUDataGridResult result = new EUDataGridResult();
    result.setRows(list);
    // 取记录总条数
    PageInfo<SysRolePermission> pageInfo = new PageInfo<>(list);
    result.setTotal(pageInfo.getTotal());
    return result;
}
Also used : SysRolePermission(com.megagao.production.ssm.domain.authority.SysRolePermission) PageInfo(com.github.pagehelper.PageInfo) EUDataGridResult(com.megagao.production.ssm.domain.customize.EUDataGridResult) SysRolePermissionExample(com.megagao.production.ssm.domain.authority.SysRolePermissionExample)

Example 2 with SysRolePermissionExample

use of com.megagao.production.ssm.domain.authority.SysRolePermissionExample in project production_ssm by megagao.

the class PermissionServiceImpl method getByRoleId.

@Override
public SysRolePermission getByRoleId(String string) throws Exception {
    SysRolePermissionExample example = new SysRolePermissionExample();
    SysRolePermissionExample.Criteria criteria = example.createCriteria();
    criteria.andSysRoleIdEqualTo(string);
    return sysRolePermissionMapper.selectByExample(example).get(0);
}
Also used : SysRolePermissionExample(com.megagao.production.ssm.domain.authority.SysRolePermissionExample)

Aggregations

SysRolePermissionExample (com.megagao.production.ssm.domain.authority.SysRolePermissionExample)2 PageInfo (com.github.pagehelper.PageInfo)1 SysRolePermission (com.megagao.production.ssm.domain.authority.SysRolePermission)1 EUDataGridResult (com.megagao.production.ssm.domain.customize.EUDataGridResult)1