src/main/java/com/xtu/hrms/controller/EmprpController.java

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

package com.xtu.hrms.controller;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.xtu.hrms.bean.Emp;
import com.xtu.hrms.bean.Emprp;
import com.xtu.hrms.config.PaginationConstant;
import com.xtu.hrms.service.IEmpService;
import com.xtu.hrms.service.IEmprpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Controller
public class EmprpController {
    @Autowired
    IEmprpService emprpService;

    @Autowired
    IEmpService empService;
    // 查询所有
    @GetMapping("/emprps")
    public String list(Model model,@RequestParam(value="pageNum",defaultValue="1")Integer pageNum) {

        if(ObjectUtils.isEmpty(pageNum)){
            pageNum= PaginationConstant.CURRENT_NUM;
        }
        //设置分页(当前页,和每页显示数据条数)
        PageHelper.startPage(pageNum, PaginationConstant.PAGE_SIZE);

        //查找数据
        List<Emprp> emprps = emprpService.getEmprpAndEmp();

        PageInfo<Emprp> pageInfo=new PageInfo<>(emprps);

        //用Model传递对象到page页面
        model.addAttribute("pageInfo",pageInfo);
        return "emprp/emprp";
    }
    @GetMapping("/empemprps")
    public String Emplist(Model model,@RequestParam(value="pageNum",defaultValue="1")Integer pageNum) {

        if(ObjectUtils.isEmpty(pageNum)){
            pageNum= PaginationConstant.CURRENT_NUM;
        }
        //设置分页(当前页,和每页显示数据条数)
        PageHelper.startPage(pageNum, PaginationConstant.PAGE_SIZE);

        //查找数据
        List<Emprp> emprps = emprpService.getEmprpAndEmp();

        PageInfo<Emprp> pageInfo=new PageInfo<>(emprps);

        //用Model传递对象到page页面
        model.addAttribute("pageInfo",pageInfo);
        return "emprp/empemprp";
后面还有 73 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。