| | |
| | | |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.whyc.dto.InterfaceParam; |
| | | import com.whyc.dto.ReportBattDTO; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.StandardFeatureCurve; |
| | | import com.whyc.dto.paramter.AlarmPar; |
| | |
| | | //查询表是否存在,不存在需要先创建表 |
| | | String tableName = commonMapper.existTable("web_site", "tb_standard_feature_curve_"+titleNameUnion); |
| | | if(tableName==null){ |
| | | mapper.createTable(titleNameUnion); |
| | | //mapper.createTable(titleNameUnion); |
| | | subService.createTable(titleNameUnion); |
| | | }else{ //存在表,先清空数据 |
| | | commonMapper.truncate("web_site", "tb_standard_feature_curve_"+titleNameUnion); |
| | | //commonMapper.truncate("web_site", "tb_standard_feature_curve_"+titleNameUnion); |
| | | subService.truncate("web_site", "tb_standard_feature_curve_"+titleNameUnion); |
| | | } |
| | | mapper.insertBatch(titleNameUnion,curveList2); |
| | | //mapper.insertBatch(titleNameUnion,curveList2); |
| | | subService.insertBatch(titleNameUnion,curveList2); |
| | | }); |
| | | |
| | | } |
| | |
| | | return list; |
| | | }*/ |
| | | public Response testTableDb() { |
| | | Date date1 = ThreadLocalUtil.parse("2020-03-22 15:11:23",1 ); |
| | | Date date2 = ThreadLocalUtil.parse("2020-03-23 15:11:23",1); |
| | | Date date1 = ThreadLocalUtil.parse("2023-04-11 16:08:20",1 ); |
| | | Date date2 = ThreadLocalUtil.parse("2023-04-11 16:09:20",1); |
| | | Date date3 = ThreadLocalUtil.parse("2022-06-25 03:47:37",1); |
| | | Date date4 =ThreadLocalUtil.parse("2022-06-27 03:47:37",1); |
| | | /*2,3 "2020-03-22 15:11:23" "2020-03-23 15:11:23" |
| | |
| | | param.setLimitStart(1); |
| | | param.setLimitEnd(10); |
| | | List list=subService.getListForInterface(param);*/ |
| | | /*10 2020-03-22 15:11:23 2020-03-23 15:11:23*/ |
| | | /*10 2020-03-22 15:11:23 2020-03-23 15:11:23 |
| | | PwrdevAlarmHistory data=new PwrdevAlarmHistory(); |
| | | data.setRecordYear("tb_pwrdev_alarm_history_2020"); |
| | | data.setAlmStartTime(date1); |
| | |
| | | data.setLimitEnd(10); |
| | | int count=subService.getCount(data); |
| | | List list=new ArrayList(); |
| | | list.add(count); |
| | | list.add(count);*/ |
| | | /*13 |
| | | DevAlarmPar param=new DevAlarmPar(); |
| | | param.setRecordYear("tb_devalarm_data_history_2023_03"); |
| | |
| | | /*时间格式测试2 |
| | | Date date= ThreadLocalUtil.parse(time1,2); |
| | | System.out.println(date);*/ |
| | | return new Response().setII(1,true,list,null); |
| | | /*1 |
| | | * |
| | | List list=subService.searchMaxNum2(date1,date2,"110000001_2023_04");*/ |
| | | /* |
| | | List<StandardFeatureCurve> list=new ArrayList(); |
| | | StandardFeatureCurve sf1=new StandardFeatureCurve(); |
| | | sf1.setTime("00:00:07"); |
| | | sf1.setValue(13.078000259399414); |
| | | list.add(sf1); |
| | | StandardFeatureCurve sf2=new StandardFeatureCurve(); |
| | | sf2.setTime("00:00:07"); |
| | | sf2.setValue(13.078000259399414); |
| | | list.add(sf2); |
| | | subService.insertBatch("122v150ah_0.15c",list); |
| | | subService.createTable("123v150ah_0.15c");*/ |
| | | /*6 |
| | | subService.delete(1000094,1);*/ |
| | | /*7 |
| | | subService.deleteByNum("tb_eleprice_1014",5);*/ |
| | | |
| | | Date date5=ThreadLocalUtil.parse("2023-08-01 10:39:16",1); |
| | | Date date6=ThreadLocalUtil.parse("2023-08-11 12:11:42",1); |
| | | /*10List list=subService.getListByStationId(date5,date6,"42010011","tb_battalarm_data_history_2023_08");*/ |
| | | /*12 |
| | | ElePrice ele=new ElePrice(); |
| | | ele.setTmpId(1015); |
| | | ele.setTmpStarttime(date5); |
| | | ele.setTmpStoptime(date6); |
| | | ele.setElePrice(20f); |
| | | subService.addElePrice(ele);*/ |
| | | /*15 |
| | | BattResData br=subService.getMinInfo(1000005,1);*/ |
| | | /*16 |
| | | Ld9testdataInf linf=new Ld9testdataInf(); |
| | | linf.setBattGroupId(1000003); |
| | | linf.setTestRecordCount(1); |
| | | List list=subService.searchlinftestdata(linf);*/ |
| | | /*17 |
| | | int tableNum= subService.judgeTable("1000012");*/ |
| | | /*18 |
| | | List list= subService.serchByCondition(date5,date6,"110000001_2023_04",7);*/ |
| | | /*19 |
| | | List list= subService.serchByInfo(1,1000003,3); |
| | | List list= subService.serchByCondition(1,1000003);*/ |
| | | /*20 |
| | | float monvol=subService.calcAvgVol(1000005,1);*/ |
| | | /*23 |
| | | subService.deleteEleprice("tb_eleprice_1001"); |
| | | subService.createEleprice("tb_eleprice_1016"); |
| | | List list=subService.getList("tb_eleprice_1002");*/ |
| | | /*24 |
| | | int tableNum= subService.judgeTable_realdata("1000003_2020_12");*/ |
| | | /*29 |
| | | BattRealdata realdata = new BattRealdata(); |
| | | realdata.setTableName("1000018_2023_09"); |
| | | realdata.setRecrodTime(date5); |
| | | realdata.setRecrodTime1(date6); |
| | | realdata.setMonNum(19); |
| | | realdata.setRoteN(7); |
| | | //List list=subService.searchMaxNum2(realdata); |
| | | //int maxNum=subService.searchMaxNum(realdata); |
| | | List list=subService.serchByCondition2(realdata);*/ |
| | | /*32 |
| | | List list= subService.getList(1000011,1);*/ |
| | | /*33 |
| | | List list= subService.getListByStationId_pwr(date5,date6,"42010020","tb_pwrdev_alarm_history_2023");*/ |
| | | /*35 |
| | | //List list= subService.serchByCondition(7,1,1000069,1); |
| | | Ld9testdata ld9testdata=new Ld9testdata(); |
| | | ld9testdata.setBattGroupId(1000069); |
| | | ld9testdata.setTestRecordCount(1); |
| | | //List list= subService.serchByInfo(ld9testdata); |
| | | Ld9testdataInf ld9inf=new Ld9testdataInf(); |
| | | ld9inf.setBattGroupId(1000069); |
| | | ld9inf.setTestRecordCount(1); |
| | | //List list= subService.getLD9AllGroupByTestRecordCount(ld9inf); |
| | | Map map= subService.getLD9AllGroupTimeLong(ld9inf);*/ |
| | | /*37 |
| | | //float vol=subService.calcAvgVol_stop(1000028,1); |
| | | //BattTestDataStop btsp=subService.findByMonNum(1000028,1); |
| | | BattTestDataStop stop=new BattTestDataStop(); |
| | | stop.setBattGroupId(1000028); |
| | | stop.setMonNum(1); |
| | | stop.setTestRecordCount(1); |
| | | stop.setMonVol(1.0f); |
| | | //float cap= subService.getRealCap(stop); |
| | | List list= subService.getTestDataStop(1000028,date5);*/ |
| | | /*38 |
| | | ReportBattDTO dto=new ReportBattDTO(); |
| | | dto.setBattGroupId(1000007); |
| | | dto.setTestType(5); |
| | | dto.setMonNum(0); |
| | | dto.setStationName("山西省-太原市-迎泽区-局机房119-局机房站-2"); |
| | | dto.setStationName1("山西省"); |
| | | List list= subService.searchByBattGroupId5(dto);*/ |
| | | /*45 |
| | | //List list= subService.getList_fbo(1000048,5); |
| | | int monCount=subService.getMonCuntBytestRecordCount(1000048,5);*/ |
| | | /*46 |
| | | ReportBattDTO dto=new ReportBattDTO(); |
| | | dto.setBattGroupId(1000007); |
| | | dto.setTestType(2); |
| | | dto.setMonNum(0); |
| | | dto.setStationName("山西省-太原市-迎泽区-局机房119-局机房站-2"); |
| | | dto.setStationName1("山西省"); |
| | | List list= subService.searchByBattGroupId(dto);*/ |
| | | /*49 |
| | | int flag=subService.updateFlag("AppServer_Reinit_BattGroupData_EN");*/ |
| | | /*52 |
| | | int judgeNUm= subService.judge(1000007);*/ |
| | | /*55 |
| | | List list=subService.getListByStationId_dev(date5,date6,"42010020","tb_devalarm_data_history_2023_08");*/ |
| | | /*60 |
| | | PwrdevAlarmParam param=new PwrdevAlarmParam(); |
| | | param.setPowerDeviceId(110000001); |
| | | param.setAlarmLimith(1f); |
| | | param.setAlarmLimitl(1f); |
| | | param.setAlarmLevel(2); |
| | | param.setUseralarmEn(0); |
| | | param.setAlarmId(110119l); |
| | | int flag=subService.updateParam(param);*/ |
| | | /*61 |
| | | //List list=subService.serchisStandard(1000059); |
| | | //List list=subService.serchCurrent(1000059); |
| | | //List list=subService.getResInfoByBattGroupId(1000059); |
| | | subService.deleteByTestRecordCount(1000059,1);*/ |
| | | /*93 |
| | | subService.truncate("db_batt_testdata","tb_battresdata_1000003");*/ |
| | | /*107*/ |
| | | int tableNum=subService.judgeTable_pwr("110000001_2023_04"); |
| | | return new Response().setII(1,true,tableNum,null); |
| | | } |
| | | } |