| | |
| | | import com.whyc.mapper.CallBack; |
| | | import com.whyc.pojo.BattAlarmHis; |
| | | import com.whyc.pojo.BattTestInfData; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.ThreadLocalUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | }); |
| | | return list; |
| | | } |
| | | //取该单体最后一笔放电记录 |
| | | public BattTestInfData getMonNumData(int binfId, Integer testRecordCount, Integer recordNum, int monNum) { |
| | | String sql="select * from db_dis_batt.batt_test_inf_"+binfId+" " + |
| | | " where binf_id="+binfId+" " + |
| | | " and test_record_count="+testRecordCount+ |
| | | " and record_num="+recordNum+ |
| | | " and mon_num="+monNum; |
| | | List<BattTestInfData> list=sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | | List list=new ArrayList(); |
| | | while (rs.next()){ |
| | | BattTestInfData data=new BattTestInfData(); |
| | | data.setNum(rs.getInt("num")); |
| | | data.setBinfId(rs.getInt("binf_id")); |
| | | data.setTestRecordCount(rs.getInt("test_record_count")); |
| | | data.setTestStarttime(rs.getTimestamp("test_starttime")); |
| | | data.setRecordTime(rs.getTimestamp("record_time")); |
| | | data.setTestType(rs.getInt("test_type")); |
| | | data.setRecordNum(rs.getInt("record_num")); |
| | | data.setTestTimelong(rs.getInt("test_timelong")); |
| | | data.setOnlineVol(rs.getFloat("online_vol")); |
| | | data.setGroupVol(rs.getFloat("group_vol")); |
| | | data.setTestCurr(rs.getFloat("test_curr")); |
| | | data.setTestCap(rs.getFloat("test_cap")); |
| | | data.setMonNum(rs.getInt("mon_num")); |
| | | data.setMonVol(rs.getFloat("mon_vol")); |
| | | data.setMonTmp(rs.getFloat("mon_tmp")); |
| | | list.add(data); |
| | | } |
| | | return list; |
| | | } |
| | | }); |
| | | return list.stream().findFirst().orElse((BattTestInfData) ActionUtil.objeNull); |
| | | } |
| | | } |