whycxzp
2025-03-24 b81c329ac5c9885f7c1b79b7aea9f8a0a5c8d18a
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
package com.whyc.service;
 
import com.github.pagehelper.PageInfo;
import com.whyc.dto.Response;
import com.whyc.pojo.db_power_alarm.PowerAlarmHistory;
import com.whyc.util.SubTablePageInfoUtil;
import com.whyc.util.ThreadLocalUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.text.ParseException;
 
@Service
public class PowerAlarmHistoryService {
    @Autowired
    private SubTablePageInfoUtil util;
 
    //查询电源历史时间告警
    public Response getHisPage(Integer almLevel, String startTime, String endTime, int pageNum, int pageSize) throws ParseException {
        PowerAlarmHistory his=new PowerAlarmHistory();
        his.setAlmLevel(almLevel);
        PageInfo pageInfo=util.getPageInfo(pageNum,pageSize, ThreadLocalUtil.parse(startTime,1),ThreadLocalUtil.parse(endTime,1)
                ,"db_power_alarm","power_alarm_history",his);
        return new Response().setII(1,pageInfo.getList()!=null,pageInfo,"查询历史-分页");
    }
}