| | |
| | | package com.whyc.service; |
| | | |
| | | import com.whyc.dto.Real.BattHisRealDto; |
| | | import com.whyc.dto.Real.CompareDto; |
| | | import com.whyc.dto.Real.QuarterDto; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.CommonMapper; |
| | | import com.whyc.pojo.db_batt_testdata.BattresdataId; |
| | | import com.whyc.pojo.db_batt_testdata.BattresdataInf; |
| | | import com.whyc.pojo.db_data_history.BattRealdataId; |
| | | import com.whyc.pojo.db_station.BattInf; |
| | | 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.HashMap; |
| | | import java.util.List; |
| | | |
| | |
| | | String date=datelist.get(i); |
| | | String tableName ="db_data_history.tb_batt_realdata_"+battgroupId+"_"+date; |
| | | String existTableName = commonMapper.existTable("db_data_history", "tb_batt_realdata_"+battgroupId+"_"+date); |
| | | //判断表是否存在 |
| | | if(existTableName == null){ |
| | | continue; |
| | | } |
| | | //判断表是否存在 |
| | | List<QuarterDto> datalist=subTablePageInfoService.getBattRealHis(tableName,"mon_tmp"); |
| | | map.put(date,datalist); |
| | | //获取表中最大,最小,平均数据值 |
| | |
| | | } |
| | | return new Response().setII(1,map.size()>0,map,"获取电池组最近一季度的温度数据"); |
| | | } |
| | | //系统概览获取半小时核容设备信息 |
| | | public Response getHalfHourBattDevData(Integer battgroupId) { |
| | | String dateTime = ActionUtil.sdfwithOutday.format(new Date()); |
| | | String tableName ="db_data_history.tb_batt_realdata_"+battgroupId+"_"+dateTime; |
| | | String existTableName = commonMapper.existTable("db_data_history", "tb_batt_realdata_"+battgroupId+"_"+dateTime); |
| | | if(existTableName == null){ |
| | | return new Response().set(1,false,"当前电池组不存在前面小时数据"); |
| | | } |
| | | List<BattHisRealDto> datalist=subTablePageInfoService.getHalfHourBattDevData(tableName); |
| | | return new Response().setII(1,datalist.size()>0,datalist,"获取半小时内核容设备信息"); |
| | | } |
| | | } |