| | |
| | | List<BatttestdataInf> searchDischargeTest(Integer battGroupId, Date recordStartTime, Date recordEndTime); |
| | | |
| | | //查往年的放电记录 |
| | | List<BatttestdataInf> searchDischargeTest_WJ(Integer battGroupId, Date recordStartTime, Date recordEndTime); |
| | | List<BatttestdataInf> searchDischargeTest_WJ(Integer battGroupId, Date recordStartTime); |
| | | //机房历史放电数据续航能力查询(实时) |
| | | List<BattState> searchBattLifeNow(@Param("binf") Battinf binf); |
| | | |
| | |
| | | //1.查出符合条件的电池组(核容数据)按照时间倒叙排序(本年度) |
| | | BatttestdataInf getGroupAnalysisQB(int BattGroupId); |
| | | |
| | | BatttestdataInf getGroupAnalysisQB_WJ(int BattGroupId,Date nowDateStart,Date nowDateEnd); |
| | | |
| | | //1.查出符合条件的电池组(核容数据)按照时间倒叙排序的第一个(上一年度) |
| | | BatttestdataInf getGroupAnalysisQBOld(int BattGroupId); |
| | | |
| | | //1.查出符合条件的电池组(核容数据)按照时间倒叙排序的第一个(上一年度) |
| | | BatttestdataInf getGroupAnalysisQBOld_WJ(int BattGroupId,Date oldDate); |
| | | |
| | | //本年度上一次正常核容的放电记录编号 |
| | | BatttestdataInf searchHrYear(int battGroupId); |
| | | //能效统计 |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.Year; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if( list.size()==0){ |
| | | //查往年的放电记录 |
| | | list = mapper.searchDischargeTest_WJ(battGroupId, recordStartTime, recordEndTime); |
| | | list = mapper.searchDischargeTest_WJ(battGroupId, recordStartTime); |
| | | if( list.size()==0){ |
| | | map.put("wj", "N"); |
| | | }else{ |
| | |
| | | capAlarm = 0.8f; |
| | | capChange = 0.6f; |
| | | } |
| | | //获取当前年 |
| | | int year = Year.now().getValue(); |
| | | Date nowDateStart=ThreadLocalUtil.parse(year+"-01-01 00:00:00",1); |
| | | Date nowDateEnd=ThreadLocalUtil.parse(year+"-12-31 23:59:59",1); |
| | | Date oldDate=ThreadLocalUtil.parse((year-1)+"-01-01 00:00:00",1); |
| | | //小于capAlarm |
| | | int alarmNum = 0; |
| | | //小于capChange |
| | |
| | | int disNum = 0; |
| | | int olddisNum = 0; |
| | | //1.查出符合条件的电池组(核容数据)按照时间倒叙排序的第一个(本年度) |
| | | BatttestdataInf inf = mapper.getGroupAnalysisQB(battgroupId); |
| | | BatttestdataInf inf = mapper.getGroupAnalysisQB_WJ(battgroupId,nowDateStart,nowDateEnd); |
| | | //1.查出符合条件的电池组(核容数据)按照时间倒叙排序的第一个(上一年度) |
| | | BatttestdataInf oldinf = mapper.getGroupAnalysisQBOld(battgroupId); |
| | | BatttestdataInf oldinf = mapper.getGroupAnalysisQBOld_WJ(battgroupId,oldDate); |
| | | if (inf != null) { |
| | | disNum=1; |
| | | int hourRate = BattCapFactory.GetHourRate(monCapStd, inf.getTestCurr()); |
| | |
| | | <if test="battGroupId!=null"> |
| | | and battgroupid=#{battGroupId} |
| | | </if> |
| | | <if test="recordStartTime!=null and recordEndTime!=null"> |
| | | and record_time<#{recordStartTime} and record_time>#{recordEndTime} |
| | | <if test="recordStartTime!=null"> |
| | | and record_time<#{recordStartTime} |
| | | </if> |
| | | </where> |
| | | ORDER BY tb_batttestdata_inf.BattGroupId asc, test_starttime desc |
| | |
| | | limit 1 |
| | | </select> |
| | | |
| | | <select id="getGroupAnalysisQB_WJ" resultType="batttestdataInf"> |
| | | select tb_batttestdata_inf.BattGroupId |
| | | , test_curr |
| | | , max_monvol |
| | | , min_monvol |
| | | , test_cap |
| | | , test_starttime |
| | | , test_timelong |
| | | , test_stoptype |
| | | from db_batt_testdata.tb_batttestdata_inf |
| | | where db_batt_testdata.tb_batttestdata_inf.data_available = 1 |
| | | and test_type = 3 |
| | | and (test_stoptype in (3, 4, 6) |
| | | or (test_stoptype = 2 and test_timelong >= 7200)) |
| | | and record_time>=#{nowDateStart} and record_time<=#{nowDateEnd} |
| | | and tb_batttestdata_inf.BattGroupId=#{battGroupId} |
| | | ORDER BY tb_batttestdata_inf.BattGroupId asc, test_starttime desc |
| | | limit 1 |
| | | </select> |
| | | |
| | | <select id="getGroupAnalysisQBOld" resultType="batttestdataInf"> |
| | | select tb_batttestdata_inf.BattGroupId |
| | | , test_curr |
| | |
| | | ORDER BY tb_batttestdata_inf.BattGroupId asc, test_starttime desc |
| | | limit 1 |
| | | </select> |
| | | |
| | | <select id="getGroupAnalysisQBOld_WJ" resultType="batttestdataInf"> |
| | | select tb_batttestdata_inf.BattGroupId |
| | | , test_curr |
| | | , max_monvol |
| | | , min_monvol |
| | | , test_cap |
| | | , test_starttime |
| | | , test_timelong |
| | | , test_stoptype |
| | | from db_batt_testdata.tb_batttestdata_inf |
| | | where db_batt_testdata.tb_batttestdata_inf.data_available = 1 |
| | | and test_type = 3 |
| | | and (test_stoptype in (3, 4, 6) |
| | | or (test_stoptype = 2 and test_timelong >= 7200)) |
| | | and record_time<#{oldDate} |
| | | and tb_batttestdata_inf.BattGroupId=#{battGroupId} |
| | | ORDER BY tb_batttestdata_inf.BattGroupId asc, test_starttime desc |
| | | limit 1 |
| | | </select> |
| | | <select id="getEnergyStatistics" resultType="GroupTestCapRes"> |
| | | SELECT DISTINCT |
| | | stationId,IFNULL(test_starttime,0) as testStartTime,IFNULL(YEAR(test_starttime),0) AS yearTime |