| | |
| | | import com.whyc.dto.paramter.TestDataInfDoc; |
| | | import com.whyc.mapper.BatttestdataInfMapper; |
| | | import com.whyc.mapper.BatttestdataMapper; |
| | | import com.whyc.mapper.CommonMapper; |
| | | import com.whyc.pojo.BattalarmData; |
| | | import com.whyc.pojo.BatttestdataClear; |
| | | import com.whyc.pojo.BatttestdataId; |
| | |
| | | |
| | | @Resource |
| | | private BatttestdataInfMapper tinfMapper; |
| | | |
| | | @Resource |
| | | private CommonMapper commonMapper; |
| | | |
| | | //查询历史数据 |
| | | public Response findhistory(int battGroupId, int testRecordCount, int dataNew) { |
| | |
| | | break; |
| | | } |
| | | } |
| | | //查询表是否存在,不存在需要先创建表 |
| | | String tableName = commonMapper.existTable("db_batt_testdata", "tb_batttestdata_clear_"+battGroupId); |
| | | if(tableName==null){ |
| | | subService.creatClear(battGroupId); |
| | | } |
| | | //存入clear表 |
| | | subService.insertClear(battGroupId,testRecordCount,recordNum); |
| | | //删除记录(超过这个recordNum的数据) |
| | |
| | | } |
| | | //测试恢复放电数据 |
| | | public Response recoverTdata(int battGroupId, int testRecordCount) { |
| | | //先查询出所有的记录 |
| | | List<BatttestdataClear> list=subService.getRecoveInf(battGroupId,testRecordCount); |
| | | //先存入clear表 |
| | | subService.insertRecover(battGroupId,testRecordCount); |
| | | if(list!=null){ |
| | | for (BatttestdataClear clear:list) { |
| | | UpdateWrapper wrapper=new UpdateWrapper(); |
| | | wrapper.set("record_num",clear.getRecordNum()); |
| | | wrapper.eq("battGroupId",battGroupId); |
| | | wrapper.eq("test_record_count",testRecordCount); |
| | | tinfMapper.update((BatttestdataInf) ActionUtil.objeNull,wrapper); |
| | | //查询表是否存在,不存在需要先创建表 |
| | | String tableName = commonMapper.existTable("db_batt_testdata", "tb_batttestdata_clear_"+battGroupId); |
| | | if(tableName==null){ |
| | | subService.creatClear(battGroupId); |
| | | }else{ |
| | | //先查询出所有的clear记录 |
| | | List<BatttestdataClear> list=subService.getRecoveInf(battGroupId,testRecordCount); |
| | | //恢复至testdata |
| | | subService.insertRecover(battGroupId,testRecordCount); |
| | | //恢复inf |
| | | if(list!=null){ |
| | | for (BatttestdataClear clear:list) { |
| | | UpdateWrapper wrapper=new UpdateWrapper(); |
| | | wrapper.set("record_num",clear.getRecordNum()); |
| | | wrapper.eq("battGroupId",battGroupId); |
| | | wrapper.eq("test_record_count",testRecordCount); |
| | | tinfMapper.update((BatttestdataInf) ActionUtil.objeNull,wrapper); |
| | | } |
| | | } |
| | | //删除记录(超过这个recordNum的数据) |
| | | subService.deleteRecover(battGroupId,testRecordCount); |
| | | } |
| | | //删除记录(超过这个recordNum的数据) |
| | | subService.deleteRecover(battGroupId,testRecordCount); |
| | | return new Response().set(1,true); |
| | | } |
| | | } |