whyclxw
2025-06-04 e9e0e12c5d855b587784c4b1c3c86975d3b7df6f
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.whyc.service;
 
import com.whyc.dto.Real.PwrHisRealAcInDto;
import com.whyc.dto.Real.PwrHisRealDcoutInDto;
import com.whyc.dto.Response;
import com.whyc.mapper.CommonMapper;
import com.whyc.pojo.db_data_history.BattRealdataId;
import com.whyc.pojo.db_data_history.PwrdevHistorydataId;
import com.whyc.util.ActionUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
 
@Service
public class PwrdevHistorydataIdService {
    @Autowired
    private SubTablePageInfoService subTablePageInfoService;
    @Resource
    private CommonMapper commonMapper;
 
    //系统概览获取半小时交流输入统计
    public Response getHalfHourPwrHisAcinData(Integer powerId) {
        String dateTime = ActionUtil.sdfwithOutday.format(new Date());
        String tableName ="db_data_history.tb_pwrdev_historydata_"+powerId+"_"+dateTime;
        String existTableName = commonMapper.existTable("db_data_history", "tb_pwrdev_historydata_"+powerId+"_"+dateTime);
        if(existTableName == null){
            return new Response().set(1,false,"当前电池组不存在前面小时数据");
        }
        List<PwrHisRealAcInDto> datalist=subTablePageInfoService.getHalfHourPwrHisAcinData(tableName);
        return new Response().setII(1,datalist.size()>0,datalist,"获取半小时内交流输入统计");
 
    }
    //系统概览获取半小时直流输出统计
    public Response getHalfHourPwrHisDcoutData(Integer powerId) {
        String dateTime = ActionUtil.sdfwithOutday.format(new Date());
        String tableName ="db_data_history.tb_pwrdev_historydata_"+powerId+"_"+dateTime;
        String existTableName = commonMapper.existTable("db_data_history", "tb_pwrdev_historydata_"+powerId+"_"+dateTime);
        if(existTableName == null){
            return new Response().set(1,false,"当前电源不存在前面小时数据");
        }
        List<PwrHisRealDcoutInDto> datalist=subTablePageInfoService.getHalfHourPwrHisDcoutData(tableName);
        return new Response().setII(1,datalist.size()>0,datalist,"获取半小时内直流输出统计");
    }
}