Search in sources :

Example 1 with DepartmentExample

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

the class DepartmentServiceImpl method searchDepartmentByDepartmentId.

@Override
public List<Department> searchDepartmentByDepartmentId(String departmentId) throws Exception {
    DepartmentExample example = new DepartmentExample();
    DepartmentExample.Criteria criteria = example.createCriteria();
    criteria.andDepartmentIdLike(departmentId);
    return departmentMapper.selectByExample(example);
}
Also used : DepartmentExample(com.megagao.production.ssm.domain.DepartmentExample)

Example 2 with DepartmentExample

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

the class DepartmentServiceImpl method getList.

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

Aggregations

DepartmentExample (com.megagao.production.ssm.domain.DepartmentExample)2 PageInfo (com.github.pagehelper.PageInfo)1 Department (com.megagao.production.ssm.domain.Department)1 EUDataGridResult (com.megagao.production.ssm.domain.customize.EUDataGridResult)1