DyEnvir_system/.settings/org.eclipse.core.resources.prefs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DyEnvir_system/src/com/fgkj/actions/CsvFileDownloadAction.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DyEnvir_system/src/com/fgkj/actions/partinsystem/DcDistributionAction.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DyEnvir_system/src/com/fgkj/dao/BaseDAO.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DyEnvir_system/src/com/fgkj/dao/BaseDAOFactory.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DyEnvir_system/src/com/fgkj/partinsystem/dto/DcDistribution.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DyEnvir_system/src/com/fgkj/partinsystem/impl/DcDistributionImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DyEnvir_system/src/com/fgkj/partinsystem/service/DcDistributionService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
DyEnvir_system/.settings/org.eclipse.core.resources.prefs
@@ -2,6 +2,7 @@ encoding//src/com/fgkj/Filters/CrossDomainLimitFilter.java=UTF-8 encoding//src/com/fgkj/Filters/Encroding.java=UTF-8 encoding//src/com/fgkj/actions/ActionUtil.java=UTF-8 encoding//src/com/fgkj/partinsystem/dto/DcDistribution.java=GBK encoding//src/com/modbus/data=ISO-8859-1 encoding//src/com/modbus/data/BaseData.java=UTF-8 encoding/<project>=UTF-8 DyEnvir_system/src/com/fgkj/actions/CsvFileDownloadAction.java
@@ -28,6 +28,7 @@ import com.fgkj.partinsystem.dto.Cabin_board; import com.fgkj.partinsystem.dto.Dc230v_batt; import com.fgkj.partinsystem.dto.Dc25v_batt; import com.fgkj.partinsystem.dto.DcDistribution; import com.fgkj.partinsystem.dto.Electrical_monitor_station; import com.fgkj.partinsystem.dto.Inverter_ele; import com.fgkj.partinsystem.dto.Propulsion_motor; @@ -38,6 +39,7 @@ import com.fgkj.partinsystem.impl.Cabin_boardImpl; import com.fgkj.partinsystem.impl.Dc230v_battImpl; import com.fgkj.partinsystem.impl.Dc25v_battImpl; import com.fgkj.partinsystem.impl.DcDistributionImpl; import com.fgkj.partinsystem.impl.Electrical_monitor_stationImpl; import com.fgkj.partinsystem.impl.Inverter_eleImpl; import com.fgkj.partinsystem.impl.Propulsion_motorImpl; @@ -325,8 +327,13 @@ dc.setRecord_time1(cs.getRecord_time1()); dc.setNote(cs.getTablists()); exportData=(new Dc25v_battImpl()).serchCSV(dc); }else if(cs.getExport_num()==11){ }else if(cs.getExport_num()==11){ //直流主配电板 DcDistribution dd=new DcDistribution(); dd.setDev_id(cs.getDev_id()); dd.setRecord_time(cs.getRecord_time()); dd.setRecord_time1(cs.getRecord_time1()); dd.setNote(cs.getTablists()); exportData=(new DcDistributionImpl()).serchCSV(dd); }else if(cs.getExport_num()==12){ }else if(cs.getExport_num()==13){ //推进电机 DyEnvir_system/src/com/fgkj/actions/partinsystem/DcDistributionAction.java
New file @@ -0,0 +1,46 @@ package com.fgkj.actions.partinsystem; import com.fgkj.actions.ActionUtil; import com.fgkj.partinsystem.dto.DcDistribution; import com.fgkj.partinsystem.service.DcDistributionService; import com.fgkj.services.ServiceModel; public class DcDistributionAction extends ActionUtil{ private DcDistributionService service=new DcDistributionService(); private String json; private String result; //根据参试设备id查询设备的实时数据 public String serchByCondition() { DcDistribution ac=ActionUtil.getGson(ActionUtil.time_yyyyMMddHHmmss).fromJson(json, DcDistribution.class); ServiceModel model=service.serchByCondition(ac); result=tojson(model); return SUCCESS; } //设备实时数据显示(前100笔数据服务器的时间) public String serchByInfo() { DcDistribution ac=ActionUtil.getGson(ActionUtil.time_yyyyMMddHHmmss).fromJson(json, DcDistribution.class); ServiceModel model=service.serchByInfo(ac); result=tojson(model); return SUCCESS; } //设备历史数据查询 public String serchHistory() { DcDistribution ac=ActionUtil.getGson(ActionUtil.time_yyyyMMddHHmmss).fromJson(json, DcDistribution.class); ServiceModel model=service.serchHistory(ac); result=tojson(model); return SUCCESS; } public String getResult() { return result; } public void setJson(String json) { this.json = json; } } DyEnvir_system/src/com/fgkj/dao/BaseDAO.java
@@ -122,6 +122,7 @@ public static final int BATTERY_MONITOR=65; public static final int SWITCH_BOARD=66; public static final int PROPULSION_MOTOR=67; public static final int DCDISTRIBUTION=68; public boolean add(Object obj); // 添加 DyEnvir_system/src/com/fgkj/dao/BaseDAOFactory.java
@@ -57,6 +57,7 @@ import com.fgkj.partinsystem.impl.Centra_frequencyImpl; import com.fgkj.partinsystem.impl.Dc230v_battImpl; import com.fgkj.partinsystem.impl.Dc25v_battImpl; import com.fgkj.partinsystem.impl.DcDistributionImpl; import com.fgkj.partinsystem.impl.Electrical_monitor_stationImpl; import com.fgkj.partinsystem.impl.Inverter_eleImpl; import com.fgkj.partinsystem.impl.Medvoldc_converterImpl; @@ -152,6 +153,7 @@ case 65:return new Battery_monitorImpl(); case 66:return new Switch_boardImpl(); case 67:return new Propulsion_motorImpl(); case 68:return new DcDistributionImpl(); default :return null; } } DyEnvir_system/src/com/fgkj/partinsystem/dto/DcDistribution.java
New file @@ -0,0 +1,889 @@ package com.fgkj.partinsystem.dto; import java.io.Serializable; import java.util.Date; /** * 直流控制子站信息 * @author Lxw * */ public class DcDistribution implements Serializable{ private int num; private int dev_id; private Date record_time; private Date record_time1; private int state1; private int state2; private int state3; private int state4; private int state5; private int state6; private int state7; private int state8; private int state9; private int state10; private int state11; private int state12; private int dc_state; //子站主机状态 private float state1_curr; //电流 private int state1_sw_state; //开关状态 private int state1_fu_state; //熔断器状态 private int state1_ele_state; //电量附件状态 private float state1_vol; //电压 private float state2_curr; //电流 private int state2_sw_state; //开关状态 private int state2_fu_state; //熔断器状态 private int state2_ele_state; //电量附件状态 private float state2_vol; //电压 private float state3_curr; //电流 private int state3_sw_state; //开关状态 private int state3_fu_state; //熔断器状态 private int state3_ele_state; //电量附件状态 private float state3_vol; //电压 private float state4_curr; //电流 private int state4_sw_state; //开关状态 private int state4_fu_state; //熔断器状态 private int state4_ele_state; //电量附件状态 private float state4_vol; //电压 private float state5_curr; //电流 private int state5_sw_state; //开关状态 private int state5_fu_state; //熔断器状态 private int state5_ele_state; //电量附件状态 private float state5_vol; //电压 private float state6_curr; //电流 private int state6_sw_state; //开关状态 private int state6_fu_state; //熔断器状态 private int state6_ele_state; //电量附件状态 private float state6_vol; //电压 private float state7_curr; //电流 private int state7_sw_state; //开关状态 private int state7_fu_state; //熔断器状态 private int state7_ele_state; //电量附件状态 private float state7_vol; //电压 private float state8_curr; //电流 private int state8_sw_state; //开关状态 private int state8_fu_state; //熔断器状态 private int state8_ele_state; //电量附件状态 private float state8_vol; //电压 private float state9_curr; //电流 private int state9_sw_state; //开关状态 private int state9_fu_state; //熔断器状态 private int state9_ele_state; //电量附件状态 private float state9_vol; //电压 private float state10_curr; //电流 private int state10_sw_state; //开关状态 private int state10_fu_state; //熔断器状态 private int state10_ele_state; //电量附件状态 private float state10_vol; //电压 private float state11_curr; //电流 private int state11_sw_state; //开关状态 private int state11_fu_state; //熔断器状态 private int state11_ele_state; //电量附件状态 private float state11_vol; //电压 private float state12_curr; //电流 private int state12_sw_state; //开关状态 private int state12_fu_state; //熔断器状态 private int state12_ele_state; //电量附件状态 private float state12_vol; //电压 //子站数据 private float dc_vol; //直流电压 private float dc_curr; //直流电流 private float dc_power; //功率 private float bus_vol; //母线电压 private float branch1_curr; //后舱母连电流 private float bus_curr; //后舱母联电流 private float inver1_branch_curr;//1号逆变电源支路电流 private float inver2_branch_curr;//2号逆变电源支路电流 private float backup1; private float backup2; private float pum_branch1_curr; //给水泵支路1电流 private float pum_branch2_curr; //给水泵支路2电流 private float backup3; private float jump_curr_right; //右舷跨接电流 private float shore_dc_vol; //直流岸电装置电压 private float shore_dc_curr; //直流岸电电流 private int q100; //q100״̬ private int q101; //q101״̬ private int q102; //q102״̬ private int q103; //q103״̬ private int q105; //q105״̬ private int q106; //q106״̬ private int q108; //q108״̬ private int q109; //q109״̬ private int q112; //q112״̬ private int q113; //q113״̬ private int q120; //q120״̬ private int q122; //q122״̬ private int dc1_power_state; //1号直流主配电板控制电源状态 private int vol_diff_more_q100; //压差过大;q100合闸抑制 private int q100_switch; //q100合闸状态 private int vol_diff_more_q102; //压差过大;q102合闸抑制 private int q102_switch; //q102合闸状态 private int vol_diff_more_q120; //压差过大;q120合闸抑制 private int q120_switch; //q120合闸状态 private int dc_conn_state; //连接状态[0:正常;1:无法连接;2:故障1;3:故障2;4:故障3] private String note; public int getNum() { return num; } public void setNum(int num) { this.num = num; } public int getDev_id() { return dev_id; } public void setDev_id(int dev_id) { this.dev_id = dev_id; } public Date getRecord_time() { return record_time; } public void setRecord_time(Date record_time) { this.record_time = record_time; } public int getState1() { return state1; } public void setState1(int state1) { this.state1 = state1; } public int getState2() { return state2; } public void setState2(int state2) { this.state2 = state2; } public int getState3() { return state3; } public void setState3(int state3) { this.state3 = state3; } public int getState4() { return state4; } public void setState4(int state4) { this.state4 = state4; } public int getState5() { return state5; } public void setState5(int state5) { this.state5 = state5; } public int getState6() { return state6; } public void setState6(int state6) { this.state6 = state6; } public int getState7() { return state7; } public void setState7(int state7) { this.state7 = state7; } public int getState8() { return state8; } public void setState8(int state8) { this.state8 = state8; } public int getState9() { return state9; } public void setState9(int state9) { this.state9 = state9; } public int getState10() { return state10; } public void setState10(int state10) { this.state10 = state10; } public int getState11() { return state11; } public void setState11(int state11) { this.state11 = state11; } public int getState12() { return state12; } public void setState12(int state12) { this.state12 = state12; } public int getDc_state() { return dc_state; } public void setDc_state(int dc_state) { this.dc_state = dc_state; } public float getState1_curr() { return state1_curr; } public void setState1_curr(float state1_curr) { this.state1_curr = state1_curr; } public int getState1_sw_state() { return state1_sw_state; } public void setState1_sw_state(int state1_sw_state) { this.state1_sw_state = state1_sw_state; } public int getState1_fu_state() { return state1_fu_state; } public void setState1_fu_state(int state1_fu_state) { this.state1_fu_state = state1_fu_state; } public int getState1_ele_state() { return state1_ele_state; } public void setState1_ele_state(int state1_ele_state) { this.state1_ele_state = state1_ele_state; } public float getState1_vol() { return state1_vol; } public void setState1_vol(float state1_vol) { this.state1_vol = state1_vol; } public float getState2_curr() { return state2_curr; } public void setState2_curr(float state2_curr) { this.state2_curr = state2_curr; } public int getState2_sw_state() { return state2_sw_state; } public void setState2_sw_state(int state2_sw_state) { this.state2_sw_state = state2_sw_state; } public int getState2_fu_state() { return state2_fu_state; } public void setState2_fu_state(int state2_fu_state) { this.state2_fu_state = state2_fu_state; } public int getState2_ele_state() { return state2_ele_state; } public void setState2_ele_state(int state2_ele_state) { this.state2_ele_state = state2_ele_state; } public float getState2_vol() { return state2_vol; } public void setState2_vol(float state2_vol) { this.state2_vol = state2_vol; } public float getState3_curr() { return state3_curr; } public void setState3_curr(float state3_curr) { this.state3_curr = state3_curr; } public int getState3_sw_state() { return state3_sw_state; } public void setState3_sw_state(int state3_sw_state) { this.state3_sw_state = state3_sw_state; } public int getState3_fu_state() { return state3_fu_state; } public void setState3_fu_state(int state3_fu_state) { this.state3_fu_state = state3_fu_state; } public int getState3_ele_state() { return state3_ele_state; } public void setState3_ele_state(int state3_ele_state) { this.state3_ele_state = state3_ele_state; } public float getState3_vol() { return state3_vol; } public void setState3_vol(float state3_vol) { this.state3_vol = state3_vol; } public float getState4_curr() { return state4_curr; } public void setState4_curr(float state4_curr) { this.state4_curr = state4_curr; } public int getState4_sw_state() { return state4_sw_state; } public void setState4_sw_state(int state4_sw_state) { this.state4_sw_state = state4_sw_state; } public int getState4_fu_state() { return state4_fu_state; } public void setState4_fu_state(int state4_fu_state) { this.state4_fu_state = state4_fu_state; } public int getState4_ele_state() { return state4_ele_state; } public void setState4_ele_state(int state4_ele_state) { this.state4_ele_state = state4_ele_state; } public float getState4_vol() { return state4_vol; } public void setState4_vol(float state4_vol) { this.state4_vol = state4_vol; } public float getState5_curr() { return state5_curr; } public void setState5_curr(float state5_curr) { this.state5_curr = state5_curr; } public int getState5_sw_state() { return state5_sw_state; } public void setState5_sw_state(int state5_sw_state) { this.state5_sw_state = state5_sw_state; } public int getState5_fu_state() { return state5_fu_state; } public void setState5_fu_state(int state5_fu_state) { this.state5_fu_state = state5_fu_state; } public int getState5_ele_state() { return state5_ele_state; } public void setState5_ele_state(int state5_ele_state) { this.state5_ele_state = state5_ele_state; } public float getState5_vol() { return state5_vol; } public void setState5_vol(float state5_vol) { this.state5_vol = state5_vol; } public float getState6_curr() { return state6_curr; } public void setState6_curr(float state6_curr) { this.state6_curr = state6_curr; } public int getState6_sw_state() { return state6_sw_state; } public void setState6_sw_state(int state6_sw_state) { this.state6_sw_state = state6_sw_state; } public int getState6_fu_state() { return state6_fu_state; } public void setState6_fu_state(int state6_fu_state) { this.state6_fu_state = state6_fu_state; } public int getState6_ele_state() { return state6_ele_state; } public void setState6_ele_state(int state6_ele_state) { this.state6_ele_state = state6_ele_state; } public float getState6_vol() { return state6_vol; } public void setState6_vol(float state6_vol) { this.state6_vol = state6_vol; } public float getState7_curr() { return state7_curr; } public void setState7_curr(float state7_curr) { this.state7_curr = state7_curr; } public int getState7_sw_state() { return state7_sw_state; } public void setState7_sw_state(int state7_sw_state) { this.state7_sw_state = state7_sw_state; } public int getState7_fu_state() { return state7_fu_state; } public void setState7_fu_state(int state7_fu_state) { this.state7_fu_state = state7_fu_state; } public int getState7_ele_state() { return state7_ele_state; } public void setState7_ele_state(int state7_ele_state) { this.state7_ele_state = state7_ele_state; } public float getState7_vol() { return state7_vol; } public void setState7_vol(float state7_vol) { this.state7_vol = state7_vol; } public float getState8_curr() { return state8_curr; } public void setState8_curr(float state8_curr) { this.state8_curr = state8_curr; } public int getState8_sw_state() { return state8_sw_state; } public void setState8_sw_state(int state8_sw_state) { this.state8_sw_state = state8_sw_state; } public int getState8_fu_state() { return state8_fu_state; } public void setState8_fu_state(int state8_fu_state) { this.state8_fu_state = state8_fu_state; } public int getState8_ele_state() { return state8_ele_state; } public void setState8_ele_state(int state8_ele_state) { this.state8_ele_state = state8_ele_state; } public float getState8_vol() { return state8_vol; } public void setState8_vol(float state8_vol) { this.state8_vol = state8_vol; } public float getState9_curr() { return state9_curr; } public void setState9_curr(float state9_curr) { this.state9_curr = state9_curr; } public int getState9_sw_state() { return state9_sw_state; } public void setState9_sw_state(int state9_sw_state) { this.state9_sw_state = state9_sw_state; } public int getState9_fu_state() { return state9_fu_state; } public void setState9_fu_state(int state9_fu_state) { this.state9_fu_state = state9_fu_state; } public int getState9_ele_state() { return state9_ele_state; } public void setState9_ele_state(int state9_ele_state) { this.state9_ele_state = state9_ele_state; } public float getState9_vol() { return state9_vol; } public void setState9_vol(float state9_vol) { this.state9_vol = state9_vol; } public float getState10_curr() { return state10_curr; } public void setState10_curr(float state10_curr) { this.state10_curr = state10_curr; } public int getState10_sw_state() { return state10_sw_state; } public void setState10_sw_state(int state10_sw_state) { this.state10_sw_state = state10_sw_state; } public int getState10_fu_state() { return state10_fu_state; } public void setState10_fu_state(int state10_fu_state) { this.state10_fu_state = state10_fu_state; } public int getState10_ele_state() { return state10_ele_state; } public void setState10_ele_state(int state10_ele_state) { this.state10_ele_state = state10_ele_state; } public float getState10_vol() { return state10_vol; } public void setState10_vol(float state10_vol) { this.state10_vol = state10_vol; } public float getState11_curr() { return state11_curr; } public void setState11_curr(float state11_curr) { this.state11_curr = state11_curr; } public int getState11_sw_state() { return state11_sw_state; } public void setState11_sw_state(int state11_sw_state) { this.state11_sw_state = state11_sw_state; } public int getState11_fu_state() { return state11_fu_state; } public void setState11_fu_state(int state11_fu_state) { this.state11_fu_state = state11_fu_state; } public int getState11_ele_state() { return state11_ele_state; } public void setState11_ele_state(int state11_ele_state) { this.state11_ele_state = state11_ele_state; } public float getState11_vol() { return state11_vol; } public void setState11_vol(float state11_vol) { this.state11_vol = state11_vol; } public float getState12_curr() { return state12_curr; } public void setState12_curr(float state12_curr) { this.state12_curr = state12_curr; } public int getState12_sw_state() { return state12_sw_state; } public void setState12_sw_state(int state12_sw_state) { this.state12_sw_state = state12_sw_state; } public int getState12_fu_state() { return state12_fu_state; } public void setState12_fu_state(int state12_fu_state) { this.state12_fu_state = state12_fu_state; } public int getState12_ele_state() { return state12_ele_state; } public void setState12_ele_state(int state12_ele_state) { this.state12_ele_state = state12_ele_state; } public float getState12_vol() { return state12_vol; } public void setState12_vol(float state12_vol) { this.state12_vol = state12_vol; } public float getDc_vol() { return dc_vol; } public void setDc_vol(float dc_vol) { this.dc_vol = dc_vol; } public float getDc_curr() { return dc_curr; } public void setDc_curr(float dc_curr) { this.dc_curr = dc_curr; } public float getDc_power() { return dc_power; } public void setDc_power(float dc_power) { this.dc_power = dc_power; } public float getBus_vol() { return bus_vol; } public void setBus_vol(float bus_vol) { this.bus_vol = bus_vol; } public float getBranch1_curr() { return branch1_curr; } public void setBranch1_curr(float branch1_curr) { this.branch1_curr = branch1_curr; } public float getBus_curr() { return bus_curr; } public void setBus_curr(float bus_curr) { this.bus_curr = bus_curr; } public float getInver1_branch_curr() { return inver1_branch_curr; } public void setInver1_branch_curr(float inver1_branch_curr) { this.inver1_branch_curr = inver1_branch_curr; } public float getInver2_branch_curr() { return inver2_branch_curr; } public void setInver2_branch_curr(float inver2_branch_curr) { this.inver2_branch_curr = inver2_branch_curr; } public float getBackup1() { return backup1; } public void setBackup1(float backup1) { this.backup1 = backup1; } public float getBackup2() { return backup2; } public void setBackup2(float backup2) { this.backup2 = backup2; } public float getPum_branch1_curr() { return pum_branch1_curr; } public void setPum_branch1_curr(float pum_branch1_curr) { this.pum_branch1_curr = pum_branch1_curr; } public float getPum_branch2_curr() { return pum_branch2_curr; } public void setPum_branch2_curr(float pum_branch2_curr) { this.pum_branch2_curr = pum_branch2_curr; } public float getBackup3() { return backup3; } public void setBackup3(float backup3) { this.backup3 = backup3; } public float getJump_curr_right() { return jump_curr_right; } public void setJump_curr_right(float jump_curr_right) { this.jump_curr_right = jump_curr_right; } public float getShore_dc_vol() { return shore_dc_vol; } public void setShore_dc_vol(float shore_dc_vol) { this.shore_dc_vol = shore_dc_vol; } public float getShore_dc_curr() { return shore_dc_curr; } public void setShore_dc_curr(float shore_dc_curr) { this.shore_dc_curr = shore_dc_curr; } public int getQ100() { return q100; } public void setQ100(int q100) { this.q100 = q100; } public int getQ101() { return q101; } public void setQ101(int q101) { this.q101 = q101; } public int getQ102() { return q102; } public void setQ102(int q102) { this.q102 = q102; } public int getQ103() { return q103; } public void setQ103(int q103) { this.q103 = q103; } public int getQ105() { return q105; } public void setQ105(int q105) { this.q105 = q105; } public int getQ106() { return q106; } public void setQ106(int q106) { this.q106 = q106; } public int getQ108() { return q108; } public void setQ108(int q108) { this.q108 = q108; } public int getQ109() { return q109; } public void setQ109(int q109) { this.q109 = q109; } public int getQ112() { return q112; } public void setQ112(int q112) { this.q112 = q112; } public int getQ113() { return q113; } public void setQ113(int q113) { this.q113 = q113; } public int getQ120() { return q120; } public void setQ120(int q120) { this.q120 = q120; } public int getQ122() { return q122; } public void setQ122(int q122) { this.q122 = q122; } public int getDc1_power_state() { return dc1_power_state; } public void setDc1_power_state(int dc1_power_state) { this.dc1_power_state = dc1_power_state; } public int getVol_diff_more_q100() { return vol_diff_more_q100; } public void setVol_diff_more_q100(int vol_diff_more_q100) { this.vol_diff_more_q100 = vol_diff_more_q100; } public int getQ100_switch() { return q100_switch; } public void setQ100_switch(int q100_switch) { this.q100_switch = q100_switch; } public int getVol_diff_more_q102() { return vol_diff_more_q102; } public void setVol_diff_more_q102(int vol_diff_more_q102) { this.vol_diff_more_q102 = vol_diff_more_q102; } public int getQ102_switch() { return q102_switch; } public void setQ102_switch(int q102_switch) { this.q102_switch = q102_switch; } public int getVol_diff_more_q120() { return vol_diff_more_q120; } public void setVol_diff_more_q120(int vol_diff_more_q120) { this.vol_diff_more_q120 = vol_diff_more_q120; } public int getQ120_switch() { return q120_switch; } public void setQ120_switch(int q120_switch) { this.q120_switch = q120_switch; } public int getDc_conn_state() { return dc_conn_state; } public void setDc_conn_state(int dc_conn_state) { this.dc_conn_state = dc_conn_state; } public String getNote() { return note; } public void setNote(String note) { this.note = note; } public Date getRecord_time1() { return record_time1; } public void setRecord_time1(Date record_time1) { this.record_time1 = record_time1; } @Override public String toString() { return "DcDistribution [num=" + num + ", dev_id=" + dev_id + ", record_time=" + record_time + ", record_time1=" + record_time1 + ", state1=" + state1 + ", state2=" + state2 + ", state3=" + state3 + ", state4=" + state4 + ", state5=" + state5 + ", state6=" + state6 + ", state7=" + state7 + ", state8=" + state8 + ", state9=" + state9 + ", state10=" + state10 + ", state11=" + state11 + ", state12=" + state12 + ", dc_state=" + dc_state + ", state1_curr=" + state1_curr + ", state1_sw_state=" + state1_sw_state + ", state1_fu_state=" + state1_fu_state + ", state1_ele_state=" + state1_ele_state + ", state1_vol=" + state1_vol + ", state2_curr=" + state2_curr + ", state2_sw_state=" + state2_sw_state + ", state2_fu_state=" + state2_fu_state + ", state2_ele_state=" + state2_ele_state + ", state2_vol=" + state2_vol + ", state3_curr=" + state3_curr + ", state3_sw_state=" + state3_sw_state + ", state3_fu_state=" + state3_fu_state + ", state3_ele_state=" + state3_ele_state + ", state3_vol=" + state3_vol + ", state4_curr=" + state4_curr + ", state4_sw_state=" + state4_sw_state + ", state4_fu_state=" + state4_fu_state + ", state4_ele_state=" + state4_ele_state + ", state4_vol=" + state4_vol + ", state5_curr=" + state5_curr + ", state5_sw_state=" + state5_sw_state + ", state5_fu_state=" + state5_fu_state + ", state5_ele_state=" + state5_ele_state + ", state5_vol=" + state5_vol + ", state6_curr=" + state6_curr + ", state6_sw_state=" + state6_sw_state + ", state6_fu_state=" + state6_fu_state + ", state6_ele_state=" + state6_ele_state + ", state6_vol=" + state6_vol + ", state7_curr=" + state7_curr + ", state7_sw_state=" + state7_sw_state + ", state7_fu_state=" + state7_fu_state + ", state7_ele_state=" + state7_ele_state + ", state7_vol=" + state7_vol + ", state8_curr=" + state8_curr + ", state8_sw_state=" + state8_sw_state + ", state8_fu_state=" + state8_fu_state + ", state8_ele_state=" + state8_ele_state + ", state8_vol=" + state8_vol + ", state9_curr=" + state9_curr + ", state9_sw_state=" + state9_sw_state + ", state9_fu_state=" + state9_fu_state + ", state9_ele_state=" + state9_ele_state + ", state9_vol=" + state9_vol + ", state10_curr=" + state10_curr + ", state10_sw_state=" + state10_sw_state + ", state10_fu_state=" + state10_fu_state + ", state10_ele_state=" + state10_ele_state + ", state10_vol=" + state10_vol + ", state11_curr=" + state11_curr + ", state11_sw_state=" + state11_sw_state + ", state11_fu_state=" + state11_fu_state + ", state11_ele_state=" + state11_ele_state + ", state11_vol=" + state11_vol + ", state12_curr=" + state12_curr + ", state12_sw_state=" + state12_sw_state + ", state12_fu_state=" + state12_fu_state + ", state12_ele_state=" + state12_ele_state + ", state12_vol=" + state12_vol + ", dc_vol=" + dc_vol + ", dc_curr=" + dc_curr + ", dc_power=" + dc_power + ", bus_vol=" + bus_vol + ", branch1_curr=" + branch1_curr + ", bus_curr=" + bus_curr + ", inver1_branch_curr=" + inver1_branch_curr + ", inver2_branch_curr=" + inver2_branch_curr + ", backup1=" + backup1 + ", backup2=" + backup2 + ", pum_branch1_curr=" + pum_branch1_curr + ", pum_branch2_curr=" + pum_branch2_curr + ", backup3=" + backup3 + ", jump_curr_right=" + jump_curr_right + ", shore_dc_vol=" + shore_dc_vol + ", shore_dc_curr=" + shore_dc_curr + ", q100=" + q100 + ", q101=" + q101 + ", q102=" + q102 + ", q103=" + q103 + ", q105=" + q105 + ", q106=" + q106 + ", q108=" + q108 + ", q109=" + q109 + ", q112=" + q112 + ", q113=" + q113 + ", q120=" + q120 + ", q122=" + q122 + ", dc1_power_state=" + dc1_power_state + ", vol_diff_more_q100=" + vol_diff_more_q100 + ", q100_switch=" + q100_switch + ", vol_diff_more_q102=" + vol_diff_more_q102 + ", q102_switch=" + q102_switch + ", vol_diff_more_q120=" + vol_diff_more_q120 + ", q120_switch=" + q120_switch + ", dc_conn_state=" + dc_conn_state + ", note=" + note + "]"; } } DyEnvir_system/src/com/fgkj/partinsystem/impl/DcDistributionImpl.java
New file @@ -0,0 +1,575 @@ package com.fgkj.partinsystem.impl; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.Date; import java.util.List; import com.fgkj.actions.ActionUtil; import com.fgkj.dao.BaseDAO; import com.fgkj.dao.CallBack; import com.fgkj.dao.DAOHelper; import com.fgkj.db.DBUtil; import com.fgkj.partinsystem.dto.Ac230v_ups; import com.fgkj.partinsystem.dto.DcDistribution; public class DcDistributionImpl implements BaseDAO,CallBack{ @Override public List getResults(ResultSet rs) { // TODO Auto-generated method stub return null; } @Override public boolean add(Object obj) { // TODO Auto-generated method stub return false; } @Override public boolean update(Object obj) { // TODO Auto-generated method stub return false; } @Override public boolean del(Object obj) { // TODO Auto-generated method stub return false; } @Override public List searchAll() { // TODO Auto-generated method stub return null; } //根据参试设备id查询设备的实时数据 @Override public List serchByCondition(Object obj) { DcDistribution dd=(DcDistribution) obj; String sql=" select * from db_partinsystem.dcdistribution where dev_id=? "; List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{dd.getDev_id()}, new CallBack() { @Override public List getResults(ResultSet rs) { List list=new ArrayList(); try { while(rs.next()){ DcDistribution d=new DcDistribution(); d.setDev_id(rs.getInt("dev_id")); d.setRecord_time(rs.getTimestamp("record_time")); d.setState1(rs.getInt("state1")); d.setState2(rs.getInt("state2")); d.setState3(rs.getInt("state3")); d.setState4(rs.getInt("state4")); d.setState5(rs.getInt("state5")); d.setState6(rs.getInt("state6")); d.setState7(rs.getInt("state7")); d.setState8(rs.getInt("state8")); d.setState9(rs.getInt("state9")); d.setState10(rs.getInt("state10")); d.setState11(rs.getInt("state11")); d.setState12(rs.getInt("state12")); d.setDc_state(rs.getInt("dc_state")); d.setState1_curr(rs.getFloat("state1_curr")); d.setState1_sw_state(rs.getInt("state1_sw_state")); d.setState1_fu_state(rs.getInt("state1_fu_state")); d.setState1_ele_state(rs.getInt("state1_ele_state")); d.setState1_vol(rs.getFloat("state1_vol")); d.setState2_curr(rs.getFloat("state2_curr")); d.setState2_sw_state(rs.getInt("state2_sw_state")); d.setState2_fu_state(rs.getInt("state2_fu_state")); d.setState2_ele_state(rs.getInt("state2_ele_state")); d.setState2_vol(rs.getFloat("state2_vol")); d.setState3_curr(rs.getFloat("state3_curr")); d.setState3_sw_state(rs.getInt("state3_sw_state")); d.setState3_fu_state(rs.getInt("state3_fu_state")); d.setState3_ele_state(rs.getInt("state3_ele_state")); d.setState3_vol(rs.getFloat("state3_vol")); d.setState4_curr(rs.getFloat("state4_curr")); d.setState4_sw_state(rs.getInt("state4_sw_state")); d.setState4_fu_state(rs.getInt("state4_fu_state")); d.setState4_ele_state(rs.getInt("state4_ele_state")); d.setState4_vol(rs.getFloat("state4_vol")); d.setState5_curr(rs.getFloat("state5_curr")); d.setState5_sw_state(rs.getInt("state5_sw_state")); d.setState5_fu_state(rs.getInt("state5_fu_state")); d.setState5_ele_state(rs.getInt("state5_ele_state")); d.setState5_vol(rs.getFloat("state5_vol")); d.setState6_curr(rs.getFloat("state6_curr")); d.setState6_sw_state(rs.getInt("state6_sw_state")); d.setState6_fu_state(rs.getInt("state6_fu_state")); d.setState6_ele_state(rs.getInt("state6_ele_state")); d.setState6_vol(rs.getFloat("state6_vol")); d.setState7_curr(rs.getFloat("state7_curr")); d.setState7_sw_state(rs.getInt("state7_sw_state")); d.setState7_fu_state(rs.getInt("state7_fu_state")); d.setState7_ele_state(rs.getInt("state7_ele_state")); d.setState7_vol(rs.getFloat("state7_vol")); d.setState8_curr(rs.getFloat("state8_curr")); d.setState8_sw_state(rs.getInt("state8_sw_state")); d.setState8_fu_state(rs.getInt("state8_fu_state")); d.setState8_ele_state(rs.getInt("state8_ele_state")); d.setState8_vol(rs.getFloat("state8_vol")); d.setState9_curr(rs.getFloat("state9_curr")); d.setState9_sw_state(rs.getInt("state9_sw_state")); d.setState9_fu_state(rs.getInt("state9_fu_state")); d.setState9_ele_state(rs.getInt("state9_ele_state")); d.setState9_vol(rs.getFloat("state9_vol")); d.setState10_curr(rs.getFloat("state10_curr")); d.setState10_sw_state(rs.getInt("state10_sw_state")); d.setState10_fu_state(rs.getInt("state10_fu_state")); d.setState10_ele_state(rs.getInt("state10_ele_state")); d.setState10_vol(rs.getFloat("state10_vol")); d.setState11_curr(rs.getFloat("state11_curr")); d.setState11_sw_state(rs.getInt("state11_sw_state")); d.setState11_fu_state(rs.getInt("state11_fu_state")); d.setState11_ele_state(rs.getInt("state11_ele_state")); d.setState11_vol(rs.getFloat("state11_vol")); d.setState12_curr(rs.getFloat("state12_curr")); d.setState12_sw_state(rs.getInt("state12_sw_state")); d.setState12_fu_state(rs.getInt("state12_fu_state")); d.setState12_ele_state(rs.getInt("state12_ele_state")); d.setState12_vol(rs.getFloat("state12_vol")); d.setDc_vol(rs.getFloat("dc_vol")); d.setDc_curr(rs.getFloat("dc_curr")); d.setDc_power(rs.getFloat("dc_power")); d.setBus_vol(rs.getFloat("bus_vol")); d.setBranch1_curr(rs.getFloat("branch1_curr")); d.setBus_curr(rs.getFloat("bus_curr")); d.setInver1_branch_curr(rs.getFloat("inver1_branch_curr")); d.setInver2_branch_curr(rs.getFloat("inver2_branch_curr")); d.setBackup1(rs.getFloat("backup1")); d.setBackup2(rs.getFloat("backup2")); d.setPum_branch1_curr(rs.getFloat("pum_branch1_curr")); d.setPum_branch2_curr(rs.getFloat("pum_branch2_curr")); d.setBackup3(rs.getFloat("backup3")); d.setJump_curr_right(rs.getFloat("jump_curr_right")); d.setShore_dc_vol(rs.getFloat("shore_dc_vol")); d.setShore_dc_curr(rs.getFloat("shore_dc_curr")); d.setQ100(rs.getInt("q100")); d.setQ101(rs.getInt("q101")); d.setQ102(rs.getInt("q102")); d.setQ103(rs.getInt("q103")); d.setQ105(rs.getInt("q105")); d.setQ106(rs.getInt("q106")); d.setQ108(rs.getInt("q108")); d.setQ109(rs.getInt("q109")); d.setQ112(rs.getInt("q112")); d.setQ113(rs.getInt("q113")); d.setQ120(rs.getInt("q120")); d.setQ122(rs.getInt("q122")); d.setDc1_power_state(rs.getInt("dc1_power_state")); d.setVol_diff_more_q100(rs.getInt("vol_diff_more_q100")); d.setQ100_switch(rs.getInt("q100_switch")); d.setVol_diff_more_q102(rs.getInt("vol_diff_more_q102")); d.setQ102_switch(rs.getInt("q102_switch")); d.setVol_diff_more_q120(rs.getInt("vol_diff_more_q120")); d.setQ120_switch(rs.getInt("q120_switch")); d.setDc_conn_state(rs.getInt("dc_conn_state")); list.add(d); } } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } return list; } }); return list; } //设备实时数据显示(前100笔数据服务器的时间) @Override public List serchByInfo(Object obj) { DcDistribution dd=(DcDistribution) obj; Date date=new Date(); String table=DAOHelper.sdf_withOut.format(date); String sql=" select * from db_partinsystem_history.dcdistribution_"+dd.getDev_id()+"_"+table+" where dev_id=? limit 0,100 "; List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{dd.getDev_id()}, new CallBack() { @Override public List getResults(ResultSet rs) { List list=new ArrayList(); try { while(rs.next()){ DcDistribution d=new DcDistribution(); d.setDev_id(rs.getInt("dev_id")); d.setRecord_time(rs.getTimestamp("record_time")); d.setState1(rs.getInt("state1")); d.setState2(rs.getInt("state2")); d.setState3(rs.getInt("state3")); d.setState4(rs.getInt("state4")); d.setState5(rs.getInt("state5")); d.setState6(rs.getInt("state6")); d.setState7(rs.getInt("state7")); d.setState8(rs.getInt("state8")); d.setState9(rs.getInt("state9")); d.setState10(rs.getInt("state10")); d.setState11(rs.getInt("state11")); d.setState12(rs.getInt("state12")); d.setDc_state(rs.getInt("dc_state")); d.setState1_curr(rs.getFloat("state1_curr")); d.setState1_sw_state(rs.getInt("state1_sw_state")); d.setState1_fu_state(rs.getInt("state1_fu_state")); d.setState1_ele_state(rs.getInt("state1_ele_state")); d.setState1_vol(rs.getFloat("state1_vol")); d.setState2_curr(rs.getFloat("state2_curr")); d.setState2_sw_state(rs.getInt("state2_sw_state")); d.setState2_fu_state(rs.getInt("state2_fu_state")); d.setState2_ele_state(rs.getInt("state2_ele_state")); d.setState2_vol(rs.getFloat("state2_vol")); d.setState3_curr(rs.getFloat("state3_curr")); d.setState3_sw_state(rs.getInt("state3_sw_state")); d.setState3_fu_state(rs.getInt("state3_fu_state")); d.setState3_ele_state(rs.getInt("state3_ele_state")); d.setState3_vol(rs.getFloat("state3_vol")); d.setState4_curr(rs.getFloat("state4_curr")); d.setState4_sw_state(rs.getInt("state4_sw_state")); d.setState4_fu_state(rs.getInt("state4_fu_state")); d.setState4_ele_state(rs.getInt("state4_ele_state")); d.setState4_vol(rs.getFloat("state4_vol")); d.setState5_curr(rs.getFloat("state5_curr")); d.setState5_sw_state(rs.getInt("state5_sw_state")); d.setState5_fu_state(rs.getInt("state5_fu_state")); d.setState5_ele_state(rs.getInt("state5_ele_state")); d.setState5_vol(rs.getFloat("state5_vol")); d.setState6_curr(rs.getFloat("state6_curr")); d.setState6_sw_state(rs.getInt("state6_sw_state")); d.setState6_fu_state(rs.getInt("state6_fu_state")); d.setState6_ele_state(rs.getInt("state6_ele_state")); d.setState6_vol(rs.getFloat("state6_vol")); d.setState7_curr(rs.getFloat("state7_curr")); d.setState7_sw_state(rs.getInt("state7_sw_state")); d.setState7_fu_state(rs.getInt("state7_fu_state")); d.setState7_ele_state(rs.getInt("state7_ele_state")); d.setState7_vol(rs.getFloat("state7_vol")); d.setState8_curr(rs.getFloat("state8_curr")); d.setState8_sw_state(rs.getInt("state8_sw_state")); d.setState8_fu_state(rs.getInt("state8_fu_state")); d.setState8_ele_state(rs.getInt("state8_ele_state")); d.setState8_vol(rs.getFloat("state8_vol")); d.setState9_curr(rs.getFloat("state9_curr")); d.setState9_sw_state(rs.getInt("state9_sw_state")); d.setState9_fu_state(rs.getInt("state9_fu_state")); d.setState9_ele_state(rs.getInt("state9_ele_state")); d.setState9_vol(rs.getFloat("state9_vol")); d.setState10_curr(rs.getFloat("state10_curr")); d.setState10_sw_state(rs.getInt("state10_sw_state")); d.setState10_fu_state(rs.getInt("state10_fu_state")); d.setState10_ele_state(rs.getInt("state10_ele_state")); d.setState10_vol(rs.getFloat("state10_vol")); d.setState11_curr(rs.getFloat("state11_curr")); d.setState11_sw_state(rs.getInt("state11_sw_state")); d.setState11_fu_state(rs.getInt("state11_fu_state")); d.setState11_ele_state(rs.getInt("state11_ele_state")); d.setState11_vol(rs.getFloat("state11_vol")); d.setState12_curr(rs.getFloat("state12_curr")); d.setState12_sw_state(rs.getInt("state12_sw_state")); d.setState12_fu_state(rs.getInt("state12_fu_state")); d.setState12_ele_state(rs.getInt("state12_ele_state")); d.setState12_vol(rs.getFloat("state12_vol")); d.setDc_vol(rs.getFloat("dc_vol")); d.setDc_curr(rs.getFloat("dc_curr")); d.setDc_power(rs.getFloat("dc_power")); d.setBus_vol(rs.getFloat("bus_vol")); d.setBranch1_curr(rs.getFloat("branch1_curr")); d.setBus_curr(rs.getFloat("bus_curr")); d.setInver1_branch_curr(rs.getFloat("inver1_branch_curr")); d.setInver2_branch_curr(rs.getFloat("inver2_branch_curr")); d.setBackup1(rs.getFloat("backup1")); d.setBackup2(rs.getFloat("backup2")); d.setPum_branch1_curr(rs.getFloat("pum_branch1_curr")); d.setPum_branch2_curr(rs.getFloat("pum_branch2_curr")); d.setBackup3(rs.getFloat("backup3")); d.setJump_curr_right(rs.getFloat("jump_curr_right")); d.setShore_dc_vol(rs.getFloat("shore_dc_vol")); d.setShore_dc_curr(rs.getFloat("shore_dc_curr")); d.setQ100(rs.getInt("q100")); d.setQ101(rs.getInt("q101")); d.setQ102(rs.getInt("q102")); d.setQ103(rs.getInt("q103")); d.setQ105(rs.getInt("q105")); d.setQ106(rs.getInt("q106")); d.setQ108(rs.getInt("q108")); d.setQ109(rs.getInt("q109")); d.setQ112(rs.getInt("q112")); d.setQ113(rs.getInt("q113")); d.setQ120(rs.getInt("q120")); d.setQ122(rs.getInt("q122")); d.setDc1_power_state(rs.getInt("dc1_power_state")); d.setVol_diff_more_q100(rs.getInt("vol_diff_more_q100")); d.setQ100_switch(rs.getInt("q100_switch")); d.setVol_diff_more_q102(rs.getInt("vol_diff_more_q102")); d.setQ102_switch(rs.getInt("q102_switch")); d.setVol_diff_more_q120(rs.getInt("vol_diff_more_q120")); d.setQ120_switch(rs.getInt("q120_switch")); d.setDc_conn_state(rs.getInt("dc_conn_state")); list.add(d); } } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } return list; } }); return list; } //设备历史数据查询 public List serchHistory(Object obj) { DcDistribution dd=(DcDistribution) obj; String table=DAOHelper.sdf_withOut.format(dd.getRecord_time()); String sql=" select * from db_partinsystem_history.dcdistribution_"+dd.getDev_id()+"_"+table+" where dev_id=? " + " and record_time >= ? and record_time <= ? order by record_time asc "; List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{dd.getDev_id(),dd.getRecord_time(),dd.getRecord_time1()}, new CallBack() { @Override public List getResults(ResultSet rs) { List list=new ArrayList(); try { while(rs.next()){ DcDistribution d=new DcDistribution(); d.setDev_id(rs.getInt("dev_id")); d.setRecord_time(rs.getTimestamp("record_time")); d.setState1(rs.getInt("state1")); d.setState2(rs.getInt("state2")); d.setState3(rs.getInt("state3")); d.setState4(rs.getInt("state4")); d.setState5(rs.getInt("state5")); d.setState6(rs.getInt("state6")); d.setState7(rs.getInt("state7")); d.setState8(rs.getInt("state8")); d.setState9(rs.getInt("state9")); d.setState10(rs.getInt("state10")); d.setState11(rs.getInt("state11")); d.setState12(rs.getInt("state12")); d.setDc_state(rs.getInt("dc_state")); d.setState1_curr(rs.getFloat("state1_curr")); d.setState1_sw_state(rs.getInt("state1_sw_state")); d.setState1_fu_state(rs.getInt("state1_fu_state")); d.setState1_ele_state(rs.getInt("state1_ele_state")); d.setState1_vol(rs.getFloat("state1_vol")); d.setState2_curr(rs.getFloat("state2_curr")); d.setState2_sw_state(rs.getInt("state2_sw_state")); d.setState2_fu_state(rs.getInt("state2_fu_state")); d.setState2_ele_state(rs.getInt("state2_ele_state")); d.setState2_vol(rs.getFloat("state2_vol")); d.setState3_curr(rs.getFloat("state3_curr")); d.setState3_sw_state(rs.getInt("state3_sw_state")); d.setState3_fu_state(rs.getInt("state3_fu_state")); d.setState3_ele_state(rs.getInt("state3_ele_state")); d.setState3_vol(rs.getFloat("state3_vol")); d.setState4_curr(rs.getFloat("state4_curr")); d.setState4_sw_state(rs.getInt("state4_sw_state")); d.setState4_fu_state(rs.getInt("state4_fu_state")); d.setState4_ele_state(rs.getInt("state4_ele_state")); d.setState4_vol(rs.getFloat("state4_vol")); d.setState5_curr(rs.getFloat("state5_curr")); d.setState5_sw_state(rs.getInt("state5_sw_state")); d.setState5_fu_state(rs.getInt("state5_fu_state")); d.setState5_ele_state(rs.getInt("state5_ele_state")); d.setState5_vol(rs.getFloat("state5_vol")); d.setState6_curr(rs.getFloat("state6_curr")); d.setState6_sw_state(rs.getInt("state6_sw_state")); d.setState6_fu_state(rs.getInt("state6_fu_state")); d.setState6_ele_state(rs.getInt("state6_ele_state")); d.setState6_vol(rs.getFloat("state6_vol")); d.setState7_curr(rs.getFloat("state7_curr")); d.setState7_sw_state(rs.getInt("state7_sw_state")); d.setState7_fu_state(rs.getInt("state7_fu_state")); d.setState7_ele_state(rs.getInt("state7_ele_state")); d.setState7_vol(rs.getFloat("state7_vol")); d.setState8_curr(rs.getFloat("state8_curr")); d.setState8_sw_state(rs.getInt("state8_sw_state")); d.setState8_fu_state(rs.getInt("state8_fu_state")); d.setState8_ele_state(rs.getInt("state8_ele_state")); d.setState8_vol(rs.getFloat("state8_vol")); d.setState9_curr(rs.getFloat("state9_curr")); d.setState9_sw_state(rs.getInt("state9_sw_state")); d.setState9_fu_state(rs.getInt("state9_fu_state")); d.setState9_ele_state(rs.getInt("state9_ele_state")); d.setState9_vol(rs.getFloat("state9_vol")); d.setState10_curr(rs.getFloat("state10_curr")); d.setState10_sw_state(rs.getInt("state10_sw_state")); d.setState10_fu_state(rs.getInt("state10_fu_state")); d.setState10_ele_state(rs.getInt("state10_ele_state")); d.setState10_vol(rs.getFloat("state10_vol")); d.setState11_curr(rs.getFloat("state11_curr")); d.setState11_sw_state(rs.getInt("state11_sw_state")); d.setState11_fu_state(rs.getInt("state11_fu_state")); d.setState11_ele_state(rs.getInt("state11_ele_state")); d.setState11_vol(rs.getFloat("state11_vol")); d.setState12_curr(rs.getFloat("state12_curr")); d.setState12_sw_state(rs.getInt("state12_sw_state")); d.setState12_fu_state(rs.getInt("state12_fu_state")); d.setState12_ele_state(rs.getInt("state12_ele_state")); d.setState12_vol(rs.getFloat("state12_vol")); d.setDc_vol(rs.getFloat("dc_vol")); d.setDc_curr(rs.getFloat("dc_curr")); d.setDc_power(rs.getFloat("dc_power")); d.setBus_vol(rs.getFloat("bus_vol")); d.setBranch1_curr(rs.getFloat("branch1_curr")); d.setBus_curr(rs.getFloat("bus_curr")); d.setInver1_branch_curr(rs.getFloat("inver1_branch_curr")); d.setInver2_branch_curr(rs.getFloat("inver2_branch_curr")); d.setBackup1(rs.getFloat("backup1")); d.setBackup2(rs.getFloat("backup2")); d.setPum_branch1_curr(rs.getFloat("pum_branch1_curr")); d.setPum_branch2_curr(rs.getFloat("pum_branch2_curr")); d.setBackup3(rs.getFloat("backup3")); d.setJump_curr_right(rs.getFloat("jump_curr_right")); d.setShore_dc_vol(rs.getFloat("shore_dc_vol")); d.setShore_dc_curr(rs.getFloat("shore_dc_curr")); d.setQ100(rs.getInt("q100")); d.setQ101(rs.getInt("q101")); d.setQ102(rs.getInt("q102")); d.setQ103(rs.getInt("q103")); d.setQ105(rs.getInt("q105")); d.setQ106(rs.getInt("q106")); d.setQ108(rs.getInt("q108")); d.setQ109(rs.getInt("q109")); d.setQ112(rs.getInt("q112")); d.setQ113(rs.getInt("q113")); d.setQ120(rs.getInt("q120")); d.setQ122(rs.getInt("q122")); d.setDc1_power_state(rs.getInt("dc1_power_state")); d.setVol_diff_more_q100(rs.getInt("vol_diff_more_q100")); d.setQ100_switch(rs.getInt("q100_switch")); d.setVol_diff_more_q102(rs.getInt("vol_diff_more_q102")); d.setQ102_switch(rs.getInt("q102_switch")); d.setVol_diff_more_q120(rs.getInt("vol_diff_more_q120")); d.setQ120_switch(rs.getInt("q120_switch")); d.setDc_conn_state(rs.getInt("dc_conn_state")); list.add(d); } } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } return list; } }); return list; } //文件导出时的历史查询 public List serchCSV(Object obj) { final DcDistribution dd=(DcDistribution) obj; String tablists=dd.getNote()+",record_time"; String table=DAOHelper.sdf_withOut.format(dd.getRecord_time()); String table1=DAOHelper.sdf_withOut.format(dd.getRecord_time1()); String SqlAll=""; String sql=" (select "+tablists+" from db_partinsystem_history.dcdistribution_"+dd.getDev_id()+"_"+table+" " + " where record_time >= ? and record_time <= ? order by record_time asc )"; String sql_union=" union all "; String sql1= " (select "+tablists+" from db_partinsystem_history.dcdistribution_"+dd.getDev_id()+"_"+table1+" " + " where record_time >= ? and record_time <= ? order by record_time asc )"; Object[] strarr=null; List list=new ArrayList(); String st=dd.getDev_id()+"_"+table; String st1=dd.getDev_id()+"_"+table1; int size=DAOHelper.serchTable(st); int size1=DAOHelper.serchTable(st1); //表都存在 if(size>0&&size1>0){ if(table.equals(table1)){ SqlAll=sql; strarr=new Object[]{DAOHelper.sdf.format(dd.getRecord_time()),DAOHelper.sdf.format(dd.getRecord_time1())}; }else{ SqlAll=sql+sql_union+sql1; strarr=new Object[]{DAOHelper.sdf.format(dd.getRecord_time()),DAOHelper.sdfwithOut.format(dd.getRecord_time())+" 23:59:59",DAOHelper.sdfwithOut.format(dd.getRecord_time())+" 00:00:00",DAOHelper.sdf.format(dd.getRecord_time1())}; } } //存在一个表 if(size>0&&size1<=0){ SqlAll=sql; strarr=new Object[]{DAOHelper.sdf.format(dd.getRecord_time()),DAOHelper.sdfwithOut.format(dd.getRecord_time())+" 23:59:59"}; } if(size<=0&&size1>0){ SqlAll=sql1; strarr=new Object[]{DAOHelper.sdfwithOut.format(dd.getRecord_time1())+" 00:00:00",DAOHelper.sdf.format(dd.getRecord_time1())}; } //表都不存在 if(size<=0&&size1<=0){ return list; } list=DAOHelper.executeQuery(SqlAll, DBUtil.getConn(), strarr, new CallBack() { @Override public List getResults(ResultSet rs) { List list=new ArrayList(); String[] state=dd.getNote().split(","); try { while(rs.next()){ List row=new ArrayList(); row.add(ActionUtil.chageDateToString(rs.getTimestamp("record_time"), ActionUtil.time_yyyyMMddHHmmss).trim()); for (int i = 0; i < state.length; i++) { row.add(rs.getFloat(state[i])); } list.add(row); } } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } return list; } }); return list; } } DyEnvir_system/src/com/fgkj/partinsystem/service/DcDistributionService.java
New file @@ -0,0 +1,59 @@ package com.fgkj.partinsystem.service; import java.util.List; import com.fgkj.dao.BaseDAO; import com.fgkj.dao.BaseDAOFactory; import com.fgkj.partinsystem.impl.DcDistributionImpl; import com.fgkj.services.ServiceModel; public class DcDistributionService { private BaseDAO dao; private ServiceModel model; public DcDistributionService() { super(); this.dao=BaseDAOFactory.getBaseDAO(BaseDAO.DCDISTRIBUTION); this.model=new ServiceModel(); } //根据参试设备id查询设备的实时数据 public ServiceModel serchByCondition(Object obj) { List list=dao.serchByCondition(obj); if(list!=null&&list.size()>0){ model.setCode(1); model.setData(list); model.setMsg("查询成功!"); }else{ model.setCode(0); model.setMsg("查询失败!"); } return model; } //设备实时数据显示(前100笔数据服务器的时间) public ServiceModel serchByInfo(Object obj) { List list=dao.serchByInfo(obj); if(list!=null&&list.size()>0){ model.setCode(1); model.setData(list); model.setMsg("查询成功!"); }else{ model.setCode(0); model.setMsg("查询失败!"); } return model; } //设备历史数据查询 public ServiceModel serchHistory(Object obj) { List list=((DcDistributionImpl)dao).serchHistory(obj); if(list!=null&&list.size()>0){ model.setCode(1); model.setData(list); model.setMsg("查询成功!"); }else{ model.setCode(0); model.setMsg("查询失败!"); } return model; } }