zhitong.yu
2024-05-11 b72f8f8d58417eb6fb29672d8ac17cfafa46775c
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
38
39
40
41
42
43
44
45
46
47
package com.hxzk.controller;
 
import com.github.pagehelper.PageInfo;
import com.hxzk.pojo.TbHistoryinwarning;
import com.hxzk.pojo.TbRealinwarning;
import com.hxzk.service.HistoryWarningService;
import com.hxzk.service.RealinWarningService;
import com.hxzk.util.result;
import com.hxzk.util.resultutil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
 
@RestController
@RequestMapping("/")
public class HistoryWarningController {
 
    @Autowired
    HistoryWarningService historyWarningService;
    //历史告警
    @GetMapping("findlishigaojing")
    result<List<TbHistoryinwarning>> findshishigaojing(Integer page, Integer limit){
        PageInfo<TbHistoryinwarning> cz= historyWarningService.findAll(page, limit);
        return resultutil.returnSuccess(cz.getTotal(), cz.getList());
    }
 
    @PostMapping("findtableLiShiGaoJing")
    result<List<TbHistoryinwarning>> findtableLiShiGaoJing(Integer page, Integer limit, TbHistoryinwarning historyinwarning){
        PageInfo<TbHistoryinwarning> cz= historyWarningService.findSearch(page, limit,historyinwarning);
        return resultutil.returnSuccess(cz.getTotal(), cz.getList());
    }
 
    public String gettime(){
        Date now = new Date();
        // 创建日期格式化对象,设置格式为 "yyyy-MM-dd HH:mm"
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        // 格式化日期对象,输出字符串结果
        String formattedDate = sdf.format(now);
        return formattedDate;
    }
}