From b102c292bfdc2c0318b672b86a74507c7b26bf93 Mon Sep 17 00:00:00 2001 From: 81041 <81041@DESKTOP-025NVD9> Date: 星期五, 04 一月 2019 10:19:16 +0800 Subject: [PATCH] 批量的查询 --- gx_tieta/src/com/fgkj/services/ram/Fbs9100_stateService.java | 12 ++++ gx_tieta/src/com/fgkj/dto/ram/Fbs9100_state.java | 65 +++++++++++---------- gx_tieta/src/com/fgkj/actions/ram/Fbs9100_stateAction.java | 10 +++ gx_tieta/src/com/fgkj/dao/impl/ram/Fbs9100_stateImpl.java | 86 ++++++++++++++++++++++++++++ 4 files changed, 138 insertions(+), 35 deletions(-) diff --git a/gx_tieta/src/com/fgkj/actions/ram/Fbs9100_stateAction.java b/gx_tieta/src/com/fgkj/actions/ram/Fbs9100_stateAction.java index 081c8ba..e45683d 100644 --- a/gx_tieta/src/com/fgkj/actions/ram/Fbs9100_stateAction.java +++ b/gx_tieta/src/com/fgkj/actions/ram/Fbs9100_stateAction.java @@ -109,7 +109,15 @@ result = tojson(model); return SUCCESS; } - + //鎵归噺璁剧疆鏀剧數鍙傛暟鏃舵煡璇㈠嚭褰撳墠鏀剧數鐨勭數姹犵粍锛�1u/2u鍒嗗紑锛� + public String seachDischarge(){ + BattInf binf=getGson().fromJson(json, BattInf.class); + User_inf uinf=(User_inf) getUser(); + binf.setNum(uinf.getUId()); + ServiceModel model = service.seachDischarge(binf); + result = tojson(model); + return SUCCESS; + } //11.1FBS9100璁惧閫氫俊鐘舵�佹煡璇� <-- 璺ㄥ煙 --> public String serchByCondition_ky(){ //isAllowHeaders(); //鍏佽璺ㄥ煙璁块棶 diff --git a/gx_tieta/src/com/fgkj/dao/impl/ram/Fbs9100_stateImpl.java b/gx_tieta/src/com/fgkj/dao/impl/ram/Fbs9100_stateImpl.java index 85977ab..b14a626 100644 --- a/gx_tieta/src/com/fgkj/dao/impl/ram/Fbs9100_stateImpl.java +++ b/gx_tieta/src/com/fgkj/dao/impl/ram/Fbs9100_stateImpl.java @@ -889,6 +889,80 @@ return list; } + //鎵归噺璁剧疆鏀剧數鍙傛暟鏃舵煡璇㈠嚭褰撳墠鏀剧數鐨勭數姹犵粍锛�1u/2u鍒嗗紑锛� + public List seachDischarge(Object obj) { + BattInf binf=(BattInf) obj; + String sql="select distinct dev_id,dev_alarmstate,dev_workstate,dev_temp,dev_version,dev_res_test_state,dev_testtype,dev_testgroupnum " + + ",dev_captest_onlinevol,dev_captest_groupvol,dev_captest_curr,dev_captest_cap,dev_captest_timelong " + + ",dev_conresist,dev_concurr,dev_condvoldp,dev_condcurr,dev_61850alarms,dev_last_captest_stop_type " + + ",db_battinf.tb_battinf.StationName,db_battinf.tb_battinf.StationName1,db_battinf.tb_battinf.StationName2,db_battinf.tb_battinf.StationName3,db_battinf.tb_battinf.StationName5 " + + ",db_battinf.tb_battinf.MonVolStd,db_battinf.tb_battinf.BattGroupId " + + " from db_ram_db.tb_fbs9100_state,db_battinf.tb_battinf,db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr " + + " where dev_workstate="+FBS9100_ComBase.DISCHARGE + + " and db_battinf.tb_battinf.fbsdeviceId=db_ram_db.tb_fbs9100_state.dev_id " + + " and (db_battinf.tb_battinf.GroupIndexInFBSDevice+1)=db_ram_db.tb_fbs9100_state.dev_testgroupnum " + + " and db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId=db_battinf.tb_battinf.BattGroupId " + + " and db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " + + " and db_user.tb_user_battgroup_baojigroup_usr.uId=? " + + " and db_battinf.tb_battinf.MonVolStd=? "; + List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[] {binf.getNum(),binf.getMonVolStd()}, new CallBack() { + + @Override + public List getResults(ResultSet rs) { + List list=new ArrayList(); + try { + while(rs.next()){ + Fbs9100_state fstate=new Fbs9100_state(); + int dev_alarmstate=rs.getInt("dev_alarmstate"); + String ContactorState="寮�鍏抽棴鍚�"; + if(dev_alarmstate==1 || + dev_alarmstate==2 || + dev_alarmstate==3 || + dev_alarmstate==4 || + dev_alarmstate==6 ){ + ContactorState="寮�鍏虫柇寮�"; + }else{ + ContactorState="寮�鍏抽棴鍚�"; + } + fstate.setDev_testgroupnum(rs.getInt("dev_testgroupnum")); //琚祴鐢垫睜缁勫彿 + fstate.setDev_alarmstate(rs.getInt("dev_alarmstate")); + fstate.setDev_res_test_state(rs.getInt("dev_res_test_state")); + fstate.setDev_testtype(rs.getInt("dev_testtype")); + fstate.setNote(ContactorState); + fstate.setDev_workstate(rs.getInt("dev_workstate")); + fstate.setDev_id(rs.getInt("dev_id")); + fstate.setDev_version(rs.getString("dev_version")); + fstate.setDev_captest_onlinevol(rs.getFloat("dev_captest_onlinevol")); + fstate.setDev_captest_groupvol(rs.getFloat("dev_captest_groupvol")); + fstate.setDev_captest_curr(rs.getFloat("dev_captest_curr")); + fstate.setDev_captest_cap(rs.getFloat("dev_captest_cap")); + fstate.setDev_captest_timelong(rs.getInt("dev_captest_timelong")); + + fstate.setDev_conresist(rs.getFloat("dev_conresist")); + fstate.setDev_concurr(rs.getFloat("dev_concurr")); + fstate.setDev_condcurr(rs.getFloat("dev_condcurr")); + fstate.setDev_condvoldp(rs.getFloat("dev_condvoldp")); + fstate.setDev_61850alarms(rs.getString("dev_61850alarms")); + fstate.setDev_last_captest_stop_type(rs.getInt("dev_last_captest_stop_type")); + fstate.setDev_temp(rs.getFloat("dev_temp")); + fstate.setStationName(rs.getString("stationName")); + fstate.setStationName1(rs.getString("stationName1")); + fstate.setStationName2(rs.getString("stationName2")); + fstate.setStationName3(rs.getString("stationName3")); + fstate.setStationName5(rs.getString("stationName5")); + fstate.setBattgroupid(rs.getInt("battgroupid")); + fstate.setMonvolstd(rs.getInt("monvolstd")); + list.add(fstate); + } + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return list; + } + }); + return list; + } public static void main(String[] args) { Fbs9100_stateImpl fi=new Fbs9100_stateImpl(); /*List<Fbs9100_state> list=fi.searchAll(); @@ -905,16 +979,19 @@ p.setPageSize(20); p.setPageCurr(1); fs.setPage(p); + BattInf binf=new BattInf(); + binf.setNum(1002); + binf.setMonVolStd(12f); /*List<Fbs9100_state> list=fi.serchByCondition(fs); System.out.println(list.size()); for(Fbs9100_state f:list){ System.out.println(f); }*/ - List<Fbs9100_state> list=fi.serchByCondition_ky(); + /*List<Fbs9100_state> list=fi.serchByCondition_ky(); System.out.println(list.size()); for(Fbs9100_state f:list){ System.out.println(f); - } + }*/ /*BattInf binf=new BattInf(); binf.setBattGroupId(1005069); List list=fi.serchByInfo(binf); @@ -929,6 +1006,11 @@ for(Fbs9100_state f:list){ System.out.println(f); }*/ + List<Fbs9100_state> list=fi.seachDischarge(binf); + System.out.println(list.size()); + for(Fbs9100_state f:list){ + System.out.println(f); + } } } diff --git a/gx_tieta/src/com/fgkj/dto/ram/Fbs9100_state.java b/gx_tieta/src/com/fgkj/dto/ram/Fbs9100_state.java index 0234b7d..6722162 100644 --- a/gx_tieta/src/com/fgkj/dto/ram/Fbs9100_state.java +++ b/gx_tieta/src/com/fgkj/dto/ram/Fbs9100_state.java @@ -41,6 +41,8 @@ private String stationName3; private String stationName5; private String deviceName;//璁惧鍚嶇О + private int monvolstd; + private int battgroupid; private String note; private Page page;//鍒嗛〉 @@ -319,44 +321,43 @@ public void setStationName5(String stationName5) { this.stationName5 = stationName5; } + public int getMonvolstd() { + return monvolstd; + } + public void setMonvolstd(int monvolstd) { + this.monvolstd = monvolstd; + } + public int getBattgroupid() { + return battgroupid; + } + public void setBattgroupid(int battgroupid) { + this.battgroupid = battgroupid; + } @Override public String toString() { - return "Fbs9100_state [num=" + num + ", dev_ip=" + dev_ip - + ", dev_version=" + dev_version + ", dev_id=" + dev_id - + ", op_cmd=" + op_cmd + ", record_datetime=" + record_datetime - + ", dev_datetime=" + dev_datetime + ", dev_testtype=" - + dev_testtype + ", dev_testgroupnum=" + dev_testgroupnum - + ", dev_workstate=" + dev_workstate + ", dev_alarmstate=" - + dev_alarmstate + ", dev_temp=" + dev_temp - + ", dev_res_test_state=" + dev_res_test_state - + ", dev_onlinevollow=" + dev_onlinevollow - + ", dev_eachgroup_battsum=" + dev_eachgroup_battsum - + ", dev_captest_onlinevol=" + dev_captest_onlinevol - + ", dev_captest_groupvol=" + dev_captest_groupvol - + ", dev_captest_curr=" + dev_captest_curr - + ", dev_captest_cap=" + dev_captest_cap - + ", dev_captest_timelong=" + dev_captest_timelong - + ", dev_restest_moncount=" + dev_restest_moncount - + ", dev_restest_monindex=" + dev_restest_monindex - + ", dev_commcount=" + dev_commcount + ", dev_errcommcount=" - + dev_errcommcount + ", dev_rxnullerrcount=" - + dev_rxnullerrcount + ", batt_online_state=" - + batt_online_state + ", online_vols=" + online_vols - + ", group_vols=" + group_vols + ", group_currs=" + group_currs - + ", stationName=" + stationName + ", stationName1=" - + stationName1 + ", stationName2=" + stationName2 - + ", stationName3=" + stationName3 + ", stationName5=" - + stationName5 + ", deviceName=" + deviceName + ", note=" - + note + ", page=" + page + ", dev_conresist=" + dev_conresist - + ", dev_concurr=" + dev_concurr + ", dev_condvoldp=" - + dev_condvoldp + ", dev_condcurr=" + dev_condcurr - + ", dev_61850alarms=" + dev_61850alarms - + ", dev_last_captest_stop_type=" + dev_last_captest_stop_type - + "]"; + return "Fbs9100_state [num=" + num + ", dev_ip=" + dev_ip + ", dev_version=" + dev_version + ", dev_id=" + + dev_id + ", op_cmd=" + op_cmd + ", record_datetime=" + record_datetime + ", dev_datetime=" + + dev_datetime + ", dev_testtype=" + dev_testtype + ", dev_testgroupnum=" + dev_testgroupnum + + ", dev_workstate=" + dev_workstate + ", dev_alarmstate=" + dev_alarmstate + ", dev_temp=" + dev_temp + + ", dev_res_test_state=" + dev_res_test_state + ", dev_onlinevollow=" + dev_onlinevollow + + ", dev_eachgroup_battsum=" + dev_eachgroup_battsum + ", dev_captest_onlinevol=" + + dev_captest_onlinevol + ", dev_captest_groupvol=" + dev_captest_groupvol + ", dev_captest_curr=" + + dev_captest_curr + ", dev_captest_cap=" + dev_captest_cap + ", dev_captest_timelong=" + + dev_captest_timelong + ", dev_restest_moncount=" + dev_restest_moncount + ", dev_restest_monindex=" + + dev_restest_monindex + ", dev_commcount=" + dev_commcount + ", dev_errcommcount=" + dev_errcommcount + + ", dev_rxnullerrcount=" + dev_rxnullerrcount + ", batt_online_state=" + batt_online_state + + ", online_vols=" + online_vols + ", group_vols=" + group_vols + ", group_currs=" + group_currs + + ", stationName=" + stationName + ", stationName1=" + stationName1 + ", stationName2=" + stationName2 + + ", stationName3=" + stationName3 + ", stationName5=" + stationName5 + ", deviceName=" + deviceName + + ", monvolstd=" + monvolstd + ", battgroupid=" + battgroupid + ", note=" + note + ", page=" + page + + ", dev_conresist=" + dev_conresist + ", dev_concurr=" + dev_concurr + ", dev_condvoldp=" + + dev_condvoldp + ", dev_condcurr=" + dev_condcurr + ", dev_61850alarms=" + dev_61850alarms + + ", dev_last_captest_stop_type=" + dev_last_captest_stop_type + "]"; } + } diff --git a/gx_tieta/src/com/fgkj/services/ram/Fbs9100_stateService.java b/gx_tieta/src/com/fgkj/services/ram/Fbs9100_stateService.java index 3cd5fad..1c48cbc 100644 --- a/gx_tieta/src/com/fgkj/services/ram/Fbs9100_stateService.java +++ b/gx_tieta/src/com/fgkj/services/ram/Fbs9100_stateService.java @@ -198,6 +198,18 @@ } return model; } + //鎵归噺璁剧疆鏀剧數鍙傛暟鏃舵煡璇㈠嚭褰撳墠鏀剧數鐨勭數姹犵粍锛�1u/2u鍒嗗紑锛� + public ServiceModel seachDischarge(Object obj){ + List list=((Fbs9100_stateImpl)dao).seachDischarge(obj); + if(list!=null && list.size()>0){ + model.setCode(1); + model.setData(list); + }else{ + model.setCode(0); + model.setMsg("鏌ヨ澶辫触!"); + } + return model; + } public static void main(String[] args) { Fbs9100_stateService fs = new Fbs9100_stateService(); Fbs9100_state f=new Fbs9100_state(); -- Gitblit v1.9.1