whycxzp
2025-04-10 f26dc28abc0f5efc0ab0143d3554474ebbc6c169
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
package com.whyc.service;
 
import com.github.pagehelper.PageInfo;
import com.whyc.dto.Response;
import com.whyc.pojo.db_power_history.BattRealTimeDataHistory;
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 BattRealTimeDataHistoryService {
 
    @Autowired
    private SubTablePageInfoUtil subTablePageInfoUtil;
 
    public Response<PageInfo> getPage(int pageNum, int pageSize, int battGroupId,
                                                               String startTime, String endTime) throws ParseException, InterruptedException {
 
        PageInfo<Object> pageInfo = subTablePageInfoUtil.getPageInfoByMonthTable(pageNum, pageSize,
                ThreadLocalUtil.parse(startTime, 1), ThreadLocalUtil.parse(endTime, 1),
                "db_power_history",
                "tb_batt_realdata_" + battGroupId,
                new BattRealTimeDataHistory()
        );
        return new Response<PageInfo>().set(1, pageInfo);
    }
 
}