ETLMessageBakController.java
1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.tianbo.controller;
import com.tianbo.common.ModelAndPage;
import com.tianbo.service.EtlmessageService;
import com.tianbo.util.dao.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
/**
* Created by Mr.Xu on 2017/9/14.
*/
@Controller
@RequestMapping("/messagebak")
public class ETLMessageBakController {
@Autowired
private EtlmessageService etlmessageService;
@RequestMapping("/showlist")
public ModelAndView findEtlMessage(@ModelAttribute Page page) throws Exception{
int pagelenth=10;
int start = 0;
if(page.getBegin()>=0){ start = page.getBegin(); }
if (page.getLength()>0){ pagelenth = page.getLength();}
ModelAndView modelAndView=new ModelAndView();
ModelAndPage modelAndPage=new ModelAndPage();
modelAndPage=etlmessageService.findEtlMessage(start,pagelenth);
modelAndView.addObject("modelAndPage",modelAndPage);
modelAndView.setViewName("messagebak/list");
return modelAndView;
}
@RequestMapping("list")
public String list(){return "messagebak/list";}
}