Search in sources :

Example 71 with PageInfo

use of com.github.pagehelper.PageInfo in project production_ssm by megagao.

the class CustomServiceImpl method searchCustomByCustomName.

@Override
public EUDataGridResult searchCustomByCustomName(int page, int rows, String customName) throws Exception {
    // 分页处理
    PageHelper.startPage(page, rows);
    List<Custom> list = customMapper.searchCustomByCustomName(customName);
    // 创建一个返回值对象
    EUDataGridResult result = new EUDataGridResult();
    result.setRows(list);
    // 取记录总条数
    PageInfo<Custom> pageInfo = new PageInfo<>(list);
    result.setTotal(pageInfo.getTotal());
    return result;
}
Also used : PageInfo(com.github.pagehelper.PageInfo) EUDataGridResult(com.megagao.production.ssm.domain.customize.EUDataGridResult) Custom(com.megagao.production.ssm.domain.Custom)

Example 72 with PageInfo

use of com.github.pagehelper.PageInfo in project free-framework by a601942905git.

the class RoleController method list.

/**
 * 获取角色列表信息
 * @return
 */
@GetMapping(RoleControllerMappingUrl.ROLE)
public String list(RoleParam roleParam) {
    PageInfo pageInfo = roleService.pageRole(roleParam);
    setRequestAttribute("pageInfo", pageInfo);
    setRequestAttribute("roleParam", roleParam);
    return RoleControllerMappingUrl.PAGE_LIST_RETURN;
}
Also used : PageInfo(com.github.pagehelper.PageInfo)

Example 73 with PageInfo

use of com.github.pagehelper.PageInfo in project sinsim by WilsonHu.

the class AbnormalRecordController method selectAbnormalRecordDetails.

/**
 * 根据 task_record.id 返回abnormalRecordDetail
 *
 * @param taskRecordId
 * @return
 */
@PostMapping("/selectAbnormalRecordDetails")
public Result selectAbnormalRecordDetails(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "0") Integer size, @RequestParam Integer taskRecordId) {
    PageHelper.startPage(page, size);
    List<AbnormalRecordDetail> abnormalRecordDetailList = abnormalRecordService.selectAbnormalRecordDetails(taskRecordId);
    PageInfo pageInfo = new PageInfo(abnormalRecordDetailList);
    return ResultGenerator.genSuccessResult(pageInfo);
}
Also used : PageInfo(com.github.pagehelper.PageInfo) AbnormalRecordDetail(com.eservice.api.model.abnormal_record.AbnormalRecordDetail) PostMapping(org.springframework.web.bind.annotation.PostMapping)

Example 74 with PageInfo

use of com.github.pagehelper.PageInfo in project sinsim by WilsonHu.

the class AbnormalRecordController method list.

@PostMapping("/list")
public Result list(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "0") Integer size) {
    PageHelper.startPage(page, size);
    List<AbnormalRecord> list = abnormalRecordService.findAll();
    PageInfo pageInfo = new PageInfo(list);
    return ResultGenerator.genSuccessResult(pageInfo);
}
Also used : PageInfo(com.github.pagehelper.PageInfo) AbnormalRecord(com.eservice.api.model.abnormal_record.AbnormalRecord) PostMapping(org.springframework.web.bind.annotation.PostMapping)

Example 75 with PageInfo

use of com.github.pagehelper.PageInfo in project sinsim by WilsonHu.

the class AbnormalController method validList.

@PostMapping("/validList")
public Result validList(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "0") Integer size) {
    PageHelper.startPage(page, size);
    List<Abnormal> list = abnormalService.findAll();
    List<Abnormal> resList = new ArrayList<Abnormal>();
    for (Abnormal item : list) {
        if (item.getValid() == 1) {
            resList.add(item);
        }
    }
    list.clear();
    PageInfo pageInfo = new PageInfo(resList);
    return ResultGenerator.genSuccessResult(pageInfo);
}
Also used : PageInfo(com.github.pagehelper.PageInfo) ArrayList(java.util.ArrayList) Abnormal(com.eservice.api.model.abnormal.Abnormal) PostMapping(org.springframework.web.bind.annotation.PostMapping)

Aggregations

PageInfo (com.github.pagehelper.PageInfo)273 PostMapping (org.springframework.web.bind.annotation.PostMapping)96 EUDataGridResult (com.megagao.production.ssm.domain.customize.EUDataGridResult)90 Test (org.junit.Test)21 UserMapper (com.github.pagehelper.mapper.UserMapper)17 User (com.github.pagehelper.model.User)17 SqlSession (org.apache.ibatis.session.SqlSession)17 ApiOperation (io.swagger.annotations.ApiOperation)14 TaskRecordDetail (com.eservice.api.model.task_record.TaskRecordDetail)11 Condition (tk.mybatis.mapper.entity.Condition)9 DataTablesResult (cn.exrick.common.pojo.DataTablesResult)7 ArrayList (java.util.ArrayList)7 Criteria (tk.mybatis.mapper.entity.Example.Criteria)6 TaskRecord (com.eservice.api.model.task_record.TaskRecord)4 Product (com.megagao.production.ssm.domain.Product)4 Task (com.megagao.production.ssm.domain.Task)4 ManufactureVO (com.megagao.production.ssm.domain.vo.ManufactureVO)4 WorkVO (com.megagao.production.ssm.domain.vo.WorkVO)4 MachineInfo (com.eservice.api.model.machine.MachineInfo)3 User (com.eservice.api.model.user.User)3