| | |
| | | import com.whyc.dto.DevA200AlarmDto; |
| | | import com.whyc.mapper.CallBack; |
| | | import com.whyc.pojo.db_alarm.DevLithiumAlarmDataYear; |
| | | import com.whyc.pojo.db_batt_testdata.BattTestDataId; |
| | | import com.whyc.pojo.db_lithium_testdata.BattLithiumTestData; |
| | | import com.whyc.util.ThreadLocalUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Autowired |
| | | private MybatisSqlExecuteService sqlExecuteService; |
| | | //获取设备某次记录详细的单体放电过程 |
| | | public List<BattTestDataId> getTdataById(Integer devId, Integer testRecordCount) { |
| | | public List<BattLithiumTestData> getTdataById(Integer devId, Integer testRecordCount) { |
| | | String sql="select * from db_batt_testdata.tb_batttestdata_" +devId |
| | | +" where need_test=1 and test_record_count="+testRecordCount+" "; |
| | | sql+=" ORDER BY record_num asc "; |
| | | List list = sqlExecuteService.executeQuery_call(sql, new CallBack() { |
| | | @Override |
| | | public List getResults(ResultSet rs) throws SQLException { |
| | | List<BattTestDataId> list=new ArrayList<>(); |
| | | List<BattLithiumTestData> list=new ArrayList<>(); |
| | | while (rs.next()){ |
| | | BattTestDataId tdata=new BattTestDataId(); |
| | | BattLithiumTestData tdata=new BattLithiumTestData(); |
| | | tdata.setNum(rs.getInt("num")); |
| | | tdata.setDevId(rs.getInt("dev_id")); |
| | | tdata.setBattIdx(rs.getInt("batt_idx")); |
| | |
| | | } |
| | | |
| | | //获取设备某次记录详细的单体放电过程 |
| | | public List<BattTestDataId> getTdataByIdWithListA200(Integer devId, Integer testRecordCount) { |
| | | public List<BattLithiumTestData> getTdataByIdWithListA200(Integer devId, Integer testRecordCount) { |
| | | String sql="select * from db_batt_testdata.tb_batttestdata_" +devId |
| | | +" where need_test=1 and test_record_count="+testRecordCount+" "; |
| | | sql+=" ORDER BY record_num asc "; |
| | |
| | | List list=new ArrayList<>(); |
| | | List<Float> monVols=null; |
| | | List<Integer> monNums=null; |
| | | BattTestDataId tdata=null; |
| | | BattLithiumTestData tdata=null; |
| | | int num=0; |
| | | try { |
| | | while (rs.next()){ |
| | |
| | | tdata.setMonNums(monNums); |
| | | list.add(tdata); |
| | | } |
| | | tdata=new BattTestDataId(); |
| | | tdata=new BattLithiumTestData(); |
| | | monVols=new ArrayList<>(); |
| | | monNums=new ArrayList<>(); |
| | | tdata.setDevId(rs.getInt("dev_id")); |
| | |
| | | } |
| | | |
| | | |
| | | public List<BattTestDataId> getTdataByIdWithListActm(Integer devId, Integer testRecordCount) { |
| | | public List<BattLithiumTestData> getTdataByIdWithListActm(Integer devId, Integer testRecordCount) { |
| | | String sql="select * from db_batt_testdata.tb_batttestdata_" +devId |
| | | +" where need_test=1 and test_record_count="+testRecordCount+" "; |
| | | sql+=" ORDER BY record_num asc "; |
| | |
| | | List<Float> monCaps=null; |
| | | List<Float> monWhs=null; |
| | | List<Integer> monNums=null; |
| | | BattTestDataId tdata=null; |
| | | BattLithiumTestData tdata=null; |
| | | int num=0; |
| | | try { |
| | | while (rs.next()){ |
| | |
| | | tdata.setMonWhs(monWhs); |
| | | list.add(tdata); |
| | | } |
| | | tdata=new BattTestDataId(); |
| | | tdata=new BattLithiumTestData(); |
| | | monVols=new ArrayList<>(); |
| | | monNums=new ArrayList<>(); |
| | | monCurrs=new ArrayList<>(); |