From bffb180ee82774f8503567b5a01ce7e9f35ca506 Mon Sep 17 00:00:00 2001
From: hdw <hdw@192.168.7.127>
Date: 星期二, 15 一月 2019 16:33:45 +0800
Subject: [PATCH] 手机端上传图片添加水印
---
gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java | 1604 +++++++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 1,433 insertions(+), 171 deletions(-)
diff --git a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
index c1666c3..ee5eb46 100644
--- a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
+++ b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
@@ -12,11 +12,13 @@
import javax.persistence.Id;
import javax.sql.ConnectionEvent;
+import javax.swing.text.StyledEditorKit.BoldAction;
import sun.security.action.GetBooleanAction;
import com.fgkj.actions.ActionUtil;
import com.fgkj.dao.BaseDAO;
+import com.fgkj.dao.BattinfGroupFactory;
import com.fgkj.dao.CallBack;
import com.fgkj.dao.DAOHelper;
import com.fgkj.dao.FBS9100_ComBase;
@@ -25,12 +27,16 @@
import com.fgkj.db.DBUtil;
import com.fgkj.db.IDatabaseName;
import com.fgkj.dto.BattInf;
+import com.fgkj.dto.BattInf_Rebuild;
import com.fgkj.dto.BattMap_information;
import com.fgkj.dto.Batt_Maint_Dealarm;
import com.fgkj.dto.Batt_maint_inf;
import com.fgkj.dto.Batt_maintenance_inf;
+import com.fgkj.dto.Battinf_ex;
+import com.fgkj.dto.Batttestdata;
import com.fgkj.dto.Batttestdata_inf;
import com.fgkj.dto.Batttestdatastop;
+import com.fgkj.dto.Database_backup;
import com.fgkj.dto.Limit;
import com.fgkj.dto.Page;
import com.fgkj.dto.RoleLimit;
@@ -39,9 +45,10 @@
import com.fgkj.dto.User_log;
import com.fgkj.dto.User_task_batt_template;
import com.fgkj.services.User_logService;
+import com.sun.org.apache.bcel.internal.generic.LSTORE;
public class BattInfImpl implements BaseDAO, CallBack {
- //娣诲姞鏂扮殑鐢垫睜缁�(澶氫釜)
+ //娣诲姞鏂扮殑鐢垫睜缁�(澶氫釜)
public boolean add(Object obj) {
List<BattInf> list=(List<BattInf>) obj;
ArrayList<String> sql_str=new ArrayList();
@@ -49,11 +56,12 @@
//鑾峰彇褰撳墠鏈�澶х殑stationid鍜宐attgroupid
int maxs=42000000;//鏈�澶tationid
int maxb=1000001;//鏈�澶attgroupid
- List maxList=(new BattInfImpl()).searchMaxId();
- if(maxList!=null&&maxList.size()>0){
+ maxs=BattinfGroupFactory.searchStationId();
+ maxb=BattinfGroupFactory.searchMaxBattgroupId();
+ /*if(maxList!=null&&maxList.size()>0){
maxs=(Integer) maxList.get(0)+1;
- maxb=(Integer) maxList.get(1)+1;
- }
+ //maxb=(Integer) maxList.get(1)+1;
+ }*/
if(list!=null && list.size()>0){
for (int i = 0; i < list.size(); i++) {
BattInf binf=list.get(i);
@@ -66,20 +74,30 @@
}
binf.setBattGroupId(maxb);
String sql = "insert into db_battinf.tb_battinf(" +
- "StationId,StationName,StationName1,StationName2,StationName3,StationName4,StationIp,FBSDeviceId,FbsDeviceIp,FbsDeviceIp_YM,FbsDeviceIp_WG,"
+ "StationId,StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationIp,FBSDeviceId,FbsDeviceIp,FbsDeviceIp_YM,FbsDeviceIp_WG,"
+ "FBSDeviceName,GroupIndexInFBSDevice,battgroupId,BattGroupNum,BattGroupName,FloatVolLevel,OfflineVolLevel,BattFloatCurrent" +
- ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,MonVolLowToAvg,BattProducer,BattModel,BattProductDate,BattInUseDate" +
- ") values('"+binf.getStationId()+"','"+binf.getStationName()+"','"+binf.getStationName1()+"','"+binf.getStationName2()+"','"+binf.getStationName3()+"','"+binf.getStationName4()+
+ ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,MonVolLowToAvg,BattProducer,BattModel,BattProductDate,BattInUseDate,Load_curr,install_user,DisCurrMax,station_phone,Station_install" +
+ ") values('"+binf.getStationId()+"','"+binf.getStationName()+"','"+binf.getStationName1()+"','"+binf.getStationName2()+"','"+binf.getStationName3()+"','"+binf.getStationName4()+"','"+binf.getStationName5()+
"','"+binf.getStationIp()+"',"+binf.getFBSDeviceId()+",'"+binf.getFbsDeviceIp()+"','"+binf.getFbsDeviceIp_YM()+"','"+binf.getFbsDeviceIp_WG()+"','"+binf.getFBSDeviceName()+"',"+binf.getGroupIndexInFBSDevice()+
","+binf.getBattGroupId()+","+binf.getBattGroupNum()+",'"+binf.getBattGroupName()+"',"+binf.getFloatVolLevel()+","+binf.getOfflineVolLevel()+","+binf.getBattFloatCurrent()+
","+binf.getMonCount()+","+binf.getMonCapStd()+","+binf.getMonVolStd()+","+binf.getMonResStd()+","+binf.getMonSerStd()+","+binf.getMonVolLowToAvg()+
- ",'"+binf.getBattProducer()+"','"+binf.getBattModel()+"','"+DAOHelper.sdf.format(binf.getBattProductDate())+"','"+DAOHelper.sdf.format(binf.getBattInUseDate())+"')";
-
+ ",'"+binf.getBattProducer()+"','"+binf.getBattModel()+"','"+DAOHelper.sdf.format(binf.getBattProductDate())+"','"+DAOHelper.sdf.format(binf.getBattInUseDate())+"',"+binf.getLoad_curr()+",'"+binf.getInstall_user()+"',"+binf.getDisCurrMax()+",'"+binf.getStation_phone()+"',"+binf.getStation_install()+")";
+ /*String baoji_sql="REPLACE into db_user.tb_user_battgroup_baojigroup_battgroup(baoji_group_id,StationId,BattGroupId) " +
+ " SELECT baoji_group_id,'"+binf.getStationId()+"',"+binf.getBattGroupId()+" from db_user.tb_user_battgroup_baojigroup ";
+ sql_str.add(baoji_sql);*/
if(binf.getStationId().equals(maxs)){
maxs++;
}
maxb++;
sql_str.add(sql);
+
+ String baoji_sql_main="REPLACE into db_user.tb_user_battgroup_baojigroup_battgroup(baoji_group_id,StationId,BattGroupId) values('100011','"+binf.getStationId()+"',"+binf.getBattGroupId()+")";
+ sql_str.add(baoji_sql_main);
+
+ // System.out.println(baoji_sql_main);
+ String baoji_sql="REPLACE into db_user.tb_user_battgroup_baojigroup_battgroup(baoji_group_id,StationId,BattGroupId) " +
+ " SELECT baoji_group_id,'"+binf.getStationId()+"',"+binf.getBattGroupId()+" from db_user.tb_user_battgroup_baojigroup_usr where uid="+((User_inf)ActionUtil.getUser()).getUId();
+ sql_str.add(baoji_sql);
{
String msg="娣诲姞"+binf.getStationName()+"鏈烘埧"+binf.getBattGroupId()+"鐢垫睜缁勭殑淇℃伅";
User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Increase, msg);
@@ -87,7 +105,13 @@
}
}
}
- boolean bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
+ Boolean bl=false;
+ boolean en=BattinfGroupFactory.backup_battinf();
+ if(en){
+ bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
+ }else{
+ return false;
+ }
(new User_logService()).addPro(listU);//灏嗙敤鎴风殑鎿嶄綔璁板綍涓嬫潵
return bl;
@@ -100,22 +124,33 @@
if(list!=null&&list.size()>0){
for (int i = 0; i < list.size(); i++) {
BattInf binf=list.get(i);
- //楠岃瘉鏂版坊鍔犵殑鏈烘埧鏄惁瀛樺湪
+ /*//楠岃瘉鏂版坊鍔犵殑鏈烘埧鏄惁瀛樺湪
List listS=(new BattInfImpl()).judgeBatt(binf);
if(listS!=null&&listS.size()>0){
binf.setStationId((String) listS.get(listS.size()-1));
}else{
//鑾峰彇褰撳墠鏈�澶х殑stationid
- List maxList=(new BattInfImpl()).searchMaxId();
+ int maxs=BattinfGroupFactory.searchStationId();
+ binf.setStationId(String.valueOf(maxs));
if(maxList!=null&&maxList.size()>0){
int maxs=(Integer) maxList.get(0)+1;
binf.setStationId(String.valueOf(maxs));
}
- }
- String sql = "update db_battinf.tb_battinf set StationId='"+binf.getStationId()+"',StationName='"+binf.getStationName()+"',StationName1='"+binf.getStationName1()+"',StationName2='"+binf.getStationName2()+"',StationName3='"+binf.getStationName3()+"',StationName4='"+binf.getStationName4()+"',StationIp='"+binf.getStationIp()+"',FBSDeviceId="+binf.getFBSDeviceId()+",FbsDeviceIp='"+binf.getFbsDeviceIp()+"',"
+ }*/
+ /*String sql = "update db_battinf.tb_battinf set StationId='"+binf.getStationId()+"',StationName='"+binf.getStationName()+"',StationName1='"+binf.getStationName1()+"',StationName2='"+binf.getStationName2()+"',StationName3='"+binf.getStationName3()+"',StationName4='"+binf.getStationName4()+"',StationName5='"+binf.getStationName5()+"',StationIp='"+binf.getStationIp()+"',FBSDeviceId="+binf.getFBSDeviceId()+",FbsDeviceIp='"+binf.getFbsDeviceIp()+"',"
+ "FBSDeviceName='"+binf.getFBSDeviceName()+"',GroupIndexInFBSDevice="+binf.getGroupIndexInFBSDevice()+",BattGroupNum="+binf.getBattGroupNum()+",BattGroupName='"+binf.getBattGroupName()+"',FloatVolLevel="+binf.getFloatVolLevel()+",OfflineVolLevel="+binf.getOfflineVolLevel()+",BattFloatCurrent="+binf.getBattFloatCurrent()+"," +
- "MonCount="+binf.getMonCount()+",MonCapStd="+binf.getMonCapStd()+",monVolStd="+binf.getMonVolStd()+",monResStd="+binf.getMonResStd()+",MonSerStd="+binf.getMonSerStd()+",MonVolLowToAvg="+binf.getMonVolLowToAvg()+",BattProducer='"+binf.getBattProducer()+"',BattModel='"+binf.getBattModel()+"',BattProductDate='"+DAOHelper.sdf.format(binf.getBattProductDate())+"',BattInUseDate='"+DAOHelper.sdf.format(binf.getBattInUseDate())+"' "
- +" where battgroupId="+binf.getBattGroupId();
+ "MonCount="+binf.getMonCount()+",MonCapStd="+binf.getMonCapStd()+",monVolStd="+binf.getMonVolStd()+",monResStd="+binf.getMonResStd()+",MonSerStd="+binf.getMonSerStd()+",MonVolLowToAvg="+binf.getMonVolLowToAvg()+",BattProducer='"+binf.getBattProducer()+"',BattModel='"+binf.getBattModel()+"',BattProductDate='"+DAOHelper.sdf.format(binf.getBattProductDate())+"',BattInUseDate='"+DAOHelper.sdf.format(binf.getBattInUseDate())+"', "
+ +" Load_curr="+binf.getLoad_curr()+",install_user='"+binf.getInstall_user()+"',DisCurrMax="+binf.getDisCurrMax()+",station_phone='"+binf.getStation_phone()+"',Station_install="+binf.getStation_install()+" where battgroupId="+binf.getBattGroupId();*/
+ String sql = "replace into db_battinf.tb_battinf(" +
+ "StationId,StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationIp,FBSDeviceId,FbsDeviceIp,FbsDeviceIp_YM,FbsDeviceIp_WG,"
+ + "FBSDeviceName,GroupIndexInFBSDevice,battgroupId,BattGroupNum,BattGroupName,FloatVolLevel,OfflineVolLevel,BattFloatCurrent" +
+ ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,MonVolLowToAvg,BattProducer,BattModel,BattProductDate,BattInUseDate,Load_curr,install_user,DisCurrMax,station_phone,Station_install" +
+ ") values('"+binf.getStationId()+"','"+binf.getStationName()+"','"+binf.getStationName1()+"','"+binf.getStationName2()+"','"+binf.getStationName3()+"','"+binf.getStationName4()+"','"+binf.getStationName5()+
+ "','"+binf.getStationIp()+"',"+binf.getFBSDeviceId()+",'"+binf.getFbsDeviceIp()+"','"+binf.getFbsDeviceIp_YM()+"','"+binf.getFbsDeviceIp_WG()+"','"+binf.getFBSDeviceName()+"',"+binf.getGroupIndexInFBSDevice()+
+ ","+binf.getBattGroupId()+","+binf.getBattGroupNum()+",'"+binf.getBattGroupName()+"',"+binf.getFloatVolLevel()+","+binf.getOfflineVolLevel()+","+binf.getBattFloatCurrent()+
+ ","+binf.getMonCount()+","+binf.getMonCapStd()+","+binf.getMonVolStd()+","+binf.getMonResStd()+","+binf.getMonSerStd()+","+binf.getMonVolLowToAvg()+
+ ",'"+binf.getBattProducer()+"','"+binf.getBattModel()+"','"+DAOHelper.sdf.format(binf.getBattProductDate())+"','"+DAOHelper.sdf.format(binf.getBattInUseDate())+"',"+binf.getLoad_curr()+",'"+binf.getInstall_user()+"',"+binf.getDisCurrMax()+",'"+binf.getStation_phone()+"',"+binf.getStation_install()+")";
+
sql_str.add(sql);
{
String msg="淇敼"+binf.getStationName()+"鏈烘埧"+binf.getBattGroupId()+"鐢垫睜缁勭殑淇℃伅";
@@ -124,8 +159,15 @@
}
}
}
+
+ Boolean bl=false;
+ boolean en=BattinfGroupFactory.backup_battinf();
+ if(en){
+ bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
+ }else{
+ return false;
+ }
(new User_logService()).addPro(listU);//灏嗙敤鎴风殑鎿嶄綔璁板綍涓嬫潵
- Boolean bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
return bl;
}
//淇敼鐢垫睜淇℃伅閰嶇疆(ip鍦板潃,鎺╃爜鍜岀綉鍏�)
@@ -135,7 +177,13 @@
boolean bl=DAOHelper.executeUpdate(DBUtil.getConn(), sql, null);
return bl;
}
-
+ //璁剧疆鐢垫睜缁勫厖鐢电數娴侀槇鍊�
+ public boolean update_charge(Object obj){
+ BattInf binf=(BattInf) obj;
+ String sql = "update db_battinf.tb_battinf set charge_curr_max=? where BattGroupId=?";
+ boolean bl=DAOHelper.executeUpdate(DBUtil.getConn(), sql, new Object[]{binf.getCharge_curr_max(),binf.getBattGroupId()});
+ return bl;
+ }
//鍒犻櫎鐢垫睜缁�(澶氫釜)
public boolean del(Object obj) {
List<BattInf> list=(List<BattInf>) obj;
@@ -153,25 +201,31 @@
}
}
}
+ Boolean bl=false;
+ boolean en=BattinfGroupFactory.backup_battinf();
+ if(en){
+ bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
+ }else{
+ return false;
+ }
(new User_logService()).addPro(listU);//灏嗙敤鎴风殑鎿嶄綔璁板綍涓嬫潵
- Boolean bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
return bl;
}
- //鏍规嵁缁存姢鍖哄拰鏈烘埧鍚嶇О鏌ヨ鐢垫睜缁勪俊鎭�
+ //鏍规嵁缁存姢鍖哄拰鏈烘埧鍚嶇О鏌ヨ鐢垫睜缁勪俊鎭�(鐢垫睜缁勪俊鎭厤缃�)
public List searchInform(Object obj){
Batt_Maint_Dealarm bmd=(Batt_Maint_Dealarm) obj;
BattInf binf=bmd.getBinf();
Page page=bmd.getPage();
Connection conn= DBUtil.getConn();
String numberSql=" SELECT FOUND_ROWS() number";
- String sql="select SQL_CALC_FOUND_ROWS distinct(StationId),StationName1,StationName2,StationName3,StationName4,StationIp,FBSDeviceId,FbsDeviceIp_YM,FbsDeviceIp_WG,FbsDeviceIp,"
+ String sql="select SQL_CALC_FOUND_ROWS distinct(StationId),StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationIp,FBSDeviceId,FbsDeviceIp_YM,FbsDeviceIp_WG,FbsDeviceIp,"
+ "FBSDeviceName,GroupIndexInFBSDevice,battgroupId,BattGroupNum,BattGroupName,FloatVolLevel,OfflineVolLevel,BattFloatCurrent" +
- ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,MonVolLowToAvg,BattProducer,BattModel,BattProductDate,BattInUseDate " +
+ ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,MonVolLowToAvg,BattProducer,BattModel,BattProductDate,BattInUseDate,Load_curr,install_user,DisCurrMax,station_phone,Station_install " +
" From db_battinf.tb_battinf " +
- " Where StationName like ? and StationName1 like ? and StationName2 like ? " +
+ " Where StationName like ? and StationName1 like ? and StationName2 like ? and StationName5 like ? " +
" order by StationId " +
" limit ?,?";
- List<BattInf> list=DAOHelper.executeQueryLimit(sql,conn, new Object[]{"%"+binf.getStationName()+"%","%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%",(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()},new CallBack() {
+ List<BattInf> list=DAOHelper.executeQueryLimit(sql,conn, new Object[]{"%"+binf.getStationName()+"%","%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName5()+"%",(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()},new CallBack() {
public List getResults(ResultSet rs) {
List list = new ArrayList<BattInf>();
@@ -181,10 +235,12 @@
while (rs.next()) {
BattInf binf = new BattInf();
binf.setStationId(rs.getString("stationId"));
+ binf.setStationName(rs.getString("stationName"));
binf.setStationName1(rs.getString("stationName1"));
binf.setStationName2(rs.getString("stationName2"));
binf.setStationName3(rs.getString("stationName3"));
binf.setStationName4(rs.getString("stationName4"));
+ binf.setStationName5(rs.getString("stationName5"));
binf.setStationIp(rs.getString("stationIp"));
binf.setFBSDeviceId(rs.getInt("fBSDeviceId"));
@@ -209,7 +265,124 @@
binf.setBattModel(rs.getString("battModel"));
binf.setBattProductDate(rs.getDate("battProductDate"));
binf.setBattInUseDate(rs.getDate("battInUseDate"));
+ binf.setLoad_curr(rs.getFloat("load_curr"));
+ binf.setInstall_user(rs.getString("install_user"));
+ binf.setDisCurrMax(rs.getFloat("disCurrMax"));
+ binf.setStation_phone(rs.getString("station_phone"));
+ binf.setStation_install(rs.getInt("station_install"));
+ list.add(binf);
+ }
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ return list;
+ }
+ });
+ //鍘绘帀limit鏉′欢鍚庣殑鎬绘暟
+ int number=LimitNumberFactory.GetLimtitNumber(conn, numberSql);
+ if(list!=null&&list.size()>0){
+ list.get(list.size()-1).setNum(number);
+ }
+ return list;
+ }
+ //鏍规嵁缁存姢鍖哄拰鏈烘埧鍚嶇О鏌ヨ鐢垫睜缁勪俊鎭�(鐢垫睜缁勪俊鎭厤缃�)<-------璺ㄥ煙----------->
+ public List searchInform_ky(){
+ String sql="select distinct(StationId),StationId_ex,StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationIp,FBSDeviceId,FbsDeviceIp_YM,FbsDeviceIp_WG,FbsDeviceIp,"
+ + "FBSDeviceName,GroupIndexInFBSDevice,battgroupId,BattGroupNum,BattGroupName,FloatVolLevel,OfflineVolLevel,BattFloatCurrent" +
+ ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,MonVolLowToAvg,BattProducer,BattModel,BattProductDate,BattInUseDate,battGuarantDayCount,SignalId,CInterFaceId,Load_curr,install_user,DisCurrMax,SignalName,Station_install,station_phone " +
+ " From db_battinf.tb_battinf " +
+ " order by StationId ";
+ List<BattInf> list=DAOHelper.executeQueryLimit(sql,DBUtil.getConn(), null,new CallBack() {
+
+ public List getResults(ResultSet rs) {
+ List list = new ArrayList<BattInf>();
+ int id=0;
+
+ try {
+ while (rs.next()) {
+ BattInf binf = new BattInf();
+ binf.setStationId(rs.getString("stationId"));
+ binf.setStationId_ex(rs.getString("stationId_ex"));
+ binf.setStationName(rs.getString("stationName"));
+ binf.setStationName1(rs.getString("stationName1"));
+ binf.setStationName2(rs.getString("stationName2"));
+ binf.setStationName3(rs.getString("stationName3"));
+ binf.setStationName4(rs.getString("stationName4"));
+ binf.setStationName5(rs.getString("stationName5"));
+ binf.setStationIp(rs.getString("stationIp"));
+ binf.setFBSDeviceId(rs.getInt("fBSDeviceId"));
+
+ binf.setFbsDeviceIp(rs.getString("fbsDeviceIp"));
+
+ binf.setFbsDeviceIp_YM(rs.getString("fbsDeviceIp_YM"));
+
+ binf.setFbsDeviceIp_WG(rs.getString("fbsDeviceIp_WG"));
+
+ binf.setFBSDeviceName(rs.getString("fBSDeviceName"));
+ binf.setGroupIndexInFBSDevice(rs.getInt("groupIndexInFBSDevice"));
+ binf.setBattGroupId(rs.getInt("battGroupId"));
+ binf.setBattGroupNum(rs.getInt("battGroupNum"));
+ binf.setBattGroupName(rs.getString("battGroupName"));
+ binf.setFloatVolLevel(rs.getFloat("floatVolLevel"));
+ binf.setOfflineVolLevel(rs.getFloat("offlineVolLevel"));
+ binf.setBattFloatCurrent(rs.getFloat("battFloatCurrent"));
+ binf.setMonCount(rs.getInt("monCount"));
+ binf.setMonCapStd(rs.getFloat("monCapStd"));
+ binf.setMonVolStd(rs.getFloat("monVolStd"));
+ binf.setMonResStd(rs.getFloat("monResStd"));
+ binf.setMonSerStd(rs.getFloat("monSerStd"));
+ binf.setMonVolLowToAvg(rs.getFloat("monVolLowToAvg"));
+ binf.setBattProducer(rs.getString("battProducer"));
+ binf.setBattModel(rs.getString("battModel"));
+ binf.setBattProductDate(rs.getDate("battProductDate"));
+ binf.setBattInUseDate(rs.getDate("battInUseDate"));
+ binf.setBattGuarantDayCount(rs.getInt("battGuarantDayCount"));
+ binf.setSignalId(rs.getString("signalId"));
+ binf.setCInterFaceId(rs.getInt("cInterFaceId"));
+ binf.setStation_install(rs.getInt("station_install"));
+ binf.setLoad_curr(rs.getFloat("load_curr"));
+ binf.setInstall_user(rs.getString("install_user"));
+ binf.setDisCurrMax(rs.getFloat("disCurrMax"));
+ binf.setStation_phone(rs.getString("station_phone"));
+ list.add(binf);
+
+ }
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ return list;
+ }
+ });
+ return list;
+ }
+ //鏍规嵁缁存姢鍖哄拰鏈烘埧鍚嶇О鏌ヨ鐢垫睜缁勪俊鎭�(鐢垫睜缁勪俊鎭厤缃�)
+ public List searchInform1(Object obj){
+ Batt_Maint_Dealarm bmd=(Batt_Maint_Dealarm) obj;
+ BattInf binf=bmd.getBinf();
+ Page page=bmd.getPage();
+ Connection conn= DBUtil.getConn();
+ String numberSql=" SELECT FOUND_ROWS() number";
+ String sql="select SQL_CALC_FOUND_ROWS distinct(StationId),StationId_ex,StationName1,StationName2,StationName3,StationName5,StationName,FBSDeviceId " +
+ " From db_battinf.tb_battinf " +
+ " limit ?,?";
+ List<BattInf> list=DAOHelper.executeQueryLimit(sql,conn, new Object[]{(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()},new CallBack() {
+
+ public List getResults(ResultSet rs) {
+ List list = new ArrayList<BattInf>();
+ int id=0;
+
+ try {
+ while (rs.next()) {
+ BattInf binf = new BattInf();
+ binf.setStationId(rs.getString("stationId"));
+ binf.setStationName1(rs.getString("stationName1"));
+ binf.setStationName2(rs.getString("stationName2"));
+ binf.setStationName3(rs.getString("stationName3"));
+ binf.setStationName5(rs.getString("stationName5"));
+ binf.setFBSDeviceId(rs.getInt("fBSDeviceId"));
+ binf.setStationName(rs.getString("stationName"));
+ binf.setStationId_ex(rs.getString("stationId_ex"));
list.add(binf);
}
@@ -227,8 +400,8 @@
return list;
}
//娣诲姞鐢垫睜缁勬椂鏌ヨ鍑烘渶澶х殑鏈烘埧id鍜岀數姹犵粍id
- public List searchMaxId(){
- String sql="select max(stationid) as maxs,max(battgroupid) as maxb from db_battinf.tb_battinf limit 1";
+ public int searchMaxId(){
+ String sql="select max(StationId) as id from db_battinf.tb_battinf limit 1";
List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), null, new CallBack() {
public List getResults(ResultSet rs) {
@@ -236,16 +409,70 @@
try {
while(rs.next()){
- int maxs=42000000;
- int maxb=1000001;
- if(rs.getString("maxs") != null){
- maxs=Integer.parseInt(rs.getString("maxs"));
+ int maxs=42010000;
+ //int maxb=1000001;
+ if(rs.getString("id") != null){
+ maxs=Integer.parseInt(rs.getString("id"));
}
- if(rs.getInt("maxb")!=0){
+ /*if(rs.getInt("maxb")!=0){
maxb=rs.getInt("maxb");
- }
+ }*/
list.add(maxs);
- list.add(maxb);
+ //list.add(maxb);
+ }
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return list;
+ }
+ });
+ int stationid=0;
+ if(list!=null&&list.size()>0){
+ stationid=(Integer) list.get(list.size()-1);
+ }
+ return stationid;
+ }
+ //鏌ヨ鍑哄綋鍓嶅瓨鍦ㄥ唴瀛樹腑鏈�澶х殑璁惧鐨刬d(寰堥噸瑕�**********)
+ public int searchMaxdevId_binf(){
+ String sql="select max(FbsDeviceId) as id from db_battinf.tb_battinf limit 1";
+ List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), null, new CallBack() {
+
+ public List getResults(ResultSet rs) {
+ List list=new ArrayList();
+ try {
+ while(rs.next()){
+ int dev_id=0;
+ if(rs.getString("id")!=null){}
+ dev_id=rs.getInt("id");
+ list.add(dev_id);
+ }
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return list;
+ }
+ });
+ int dev_id=0;
+ if(list!=null&&list.size()>0){
+ dev_id=(Integer) list.get(list.size()-1);
+ }
+ return dev_id;
+ }
+ //鍒ゆ柇鏂板鐨勬満鎴挎槸鍚﹀瓨鍦�
+ public List judgeBatt(Object obj){
+ BattInf binf=(BattInf) obj;
+ String sql="select distinct(StationId) "
+ + "from db_battinf.tb_battinf where stationname=? limit 1";
+ List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getStationName()}, new CallBack() {
+
+ public List getResults(ResultSet rs) {
+ List list=new ArrayList();
+ try {
+ while(rs.next()){
+ String stationid=rs.getString("stationid");
+ list.add(stationid);
}
} catch (SQLException e) {
// TODO Auto-generated catch block
@@ -256,8 +483,9 @@
});
return list;
}
- //鍒ゆ柇鏂板鐨勭數姹犵粍鏄惁瀛樺湪
- public List judgeBatt(Object obj){
+
+ //鍒ゆ柇鏂板鐨勬満鎴挎槸鍚﹀瓨鍦�
+ public boolean judgeBattInOrNot(Object obj){
BattInf binf=(BattInf) obj;
String sql="select distinct stationid from db_battinf.tb_battinf where stationname=? limit 1";
List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getStationName()}, new CallBack() {
@@ -276,7 +504,11 @@
return list;
}
});
- return list;
+ if(list!=null&&list.size()>0){
+ return true;
+ }else{
+ return false;
+ }
}
//0.4鏍规嵁鍩庡競鍚嶇О鏌ョ數姹犵粍
public List search(Object obj){
@@ -340,11 +572,11 @@
return list;
}
- //5.3娣诲姞閫夊彇鐢垫睜缁勬垨鑰呮満鎴挎垨鑰呯淮鎶ゅ尯
+ //5.3娣诲姞閫夊彇鐢垫睜缁勬垨鑰呮満鎴挎垨鑰呯淮鎶ゅ尯鎴栬�呭叏鍖哄幙
public List serchBatt(Object obj) {
BattInf binf=(BattInf) obj;
String sql="";
- String baseSql="select distinct(battgroupid),stationid,stationname,stationname1,battgroupname from db_battinf.tb_battinf " +
+ String baseSql="select distinct(battgroupid),stationid,stationname,stationname1,stationname2,stationname5,battgroupname from db_battinf.tb_battinf " +
"where ";
//鐢ㄤ簬缁存姢鍖�
String station1SqlT=" stationname1!=? ";//鍏ㄩ儴
@@ -355,12 +587,20 @@
baseSql+=station1SqlF;
}
//鐢ㄤ簬缁存姢鍖�
- String station2SqlT=" stationname2!=? ";//鍏ㄩ儴
- String station2SqlF=" stationname2=? ";
+ String station2SqlT=" and stationname2!=? ";//鍏ㄩ儴
+ String station2SqlF=" and stationname2=? ";
if(binf.getStationName2().equals("")){
baseSql+=station2SqlT;
}else{
baseSql+=station2SqlF;
+ }
+ //鐢ㄤ簬鍖哄幙
+ String station5SqlT=" and stationname5!=? ";//鍏ㄩ儴
+ String station5SqlF=" and stationname5=? ";
+ if(binf.getStationName5().equals("")){
+ baseSql+=station5SqlT;
+ }else{
+ baseSql+=station5SqlF;
}
//鐢ㄤ簬鏈烘埧绔欑偣
String stationSqlT=" and stationname!=? ";//鍏ㄩ儴
@@ -381,7 +621,7 @@
String endSql=" order by stationid ";
sql=baseSql+endSql;
//System.out.println(sql);
- List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getStationName1(),binf.getStationName2(),binf.getStationName(),binf.getBattGroupId()}, new CallBack() {
+ List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getStationName1(),binf.getStationName2(),binf.getStationName5(),binf.getStationName(),binf.getBattGroupId()}, new CallBack() {
public List getResults(ResultSet rs) {
List list=new ArrayList();
@@ -392,6 +632,8 @@
binf.setStationId(rs.getString("StationId"));
binf.setStationName(rs.getString("stationName"));
binf.setStationName1(rs.getString("stationName1"));
+ binf.setStationName2(rs.getString("stationName2"));
+ binf.setStationName5(rs.getString("stationName5"));
binf.setBattGroupName(rs.getString("battGroupName"));
list.add(binf);
}
@@ -916,7 +1158,7 @@
return list;
}
- //鏌ヨ澶囨�绘暟
+ //鏌ヨ澶囨�绘暟(宸茬粡瀹夎)
/*public int serchByDeviceId(){
String sql=" SELECT COUNT(DISTINCT fbsdeviceid) number FROM db_battinf.tb_battinf limit 1";
List<BattInf> list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{}, new CallBack() {
@@ -946,11 +1188,11 @@
public int serchByDeviceId(Object obj){
User_inf uinf=(User_inf) obj;
String sql=" SELECT COUNT(DISTINCT fbsdeviceid) number FROM db_battinf.tb_battinf " +
- " left outer join db_user.tb_user_battgroup_baojigroup_battgroup on db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId=db_battinf.tb_battinf.BattGroupId " +
- " left outer join db_user.tb_user_battgroup_baojigroup_usr on db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " +
- " left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " +
- " where db_user.tb_user_inf.uid=? " +
- " limit 1";
+ " where StationId in(" +
+ " select distinct db_user.tb_user_battgroup_baojigroup_battgroup.StationId from db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr where db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id=db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id " +
+ " and db_user.tb_user_battgroup_baojigroup_usr.uId=? " +
+ " ) " +
+ " and db_battinf.tb_battinf.station_install=1";
List<BattInf> list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() {
public List getResults(ResultSet rs) {
@@ -974,6 +1216,93 @@
number=list.get(list.size()-1).getNum();
}
return number;
+ }
+ //鏌ュ崟浣撴�绘暟(宸插畨瑁呯殑鍗曚綋)
+ public int serchByInstall_count(Object obj){
+ User_inf uinf=(User_inf) obj;
+ String sql=" SELECT sum(moncount) as nums FROM db_battinf.tb_battinf " +
+ " where StationId in(" +
+ " select distinct db_user.tb_user_battgroup_baojigroup_battgroup.StationId from db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr where db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id=db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id " +
+ " and db_user.tb_user_battgroup_baojigroup_usr.uId=? " +
+ " ) " +
+ " and db_battinf.tb_battinf.station_install=1";
+ //System.out.println(sql);
+ List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() {
+
+ public List getResults(ResultSet rs) {
+ List list=new ArrayList();
+ int nums=0;//鍗曚綋鎬绘暟
+ try {
+ while(rs.next()){
+ nums=rs.getInt("nums");
+ list.add(nums);
+ }
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return list;
+ }
+
+ });
+ int number=0;//瀛樻斁鎬绘暟
+ if(list!=null&&list.size()>0){
+ number=(Integer) list.get(list.size()-1);
+ }
+ return number;
+ }
+ //鏌ヨ璁惧鎬绘暟(鍏ㄩ儴)
+ public List serchByDeviceId_all(Object obj){
+ User_inf uinf=(User_inf) obj;
+ String sql=" SELECT DISTINCT fbsdeviceid,station_install,monvolstd FROM db_battinf.tb_battinf " +
+ " where StationId in(" +
+ " select distinct db_user.tb_user_battgroup_baojigroup_battgroup.StationId from db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr where db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id=db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id " +
+ " and db_user.tb_user_battgroup_baojigroup_usr.uId=? " +
+ " ) ";
+ List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() {
+
+ public List getResults(ResultSet rs) {
+ List list=new ArrayList();
+ int num_2_install=0;//2v宸插畨瑁�
+ int num_2=0;//2v鍏ㄩ儴
+ int num_12_install=0;//12v宸插畨瑁�
+ int num_12=0;//12v鍏ㄩ儴
+ int num_install=0;//宸插畨瑁�
+ int num=0;//鍏ㄩ儴
+ try {
+ while(rs.next()){
+ int insatll=rs.getInt("station_install");
+ float monvolstd=rs.getFloat("monvolstd");
+ if(insatll==1){
+ num_install+=1;
+ if(monvolstd==2.0){
+ num_2_install+=1;
+ }else{
+ num_12_install+=1;
+ }
+ }
+ if(monvolstd==2.0){
+ num_2+=1;
+ }else{
+ num_12+=1;
+ }
+ num+=1;
+ }
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ list.add(num_2_install);
+ list.add(num_2);
+ list.add(num_12_install);
+ list.add(num_12);
+ list.add(num_install);
+ list.add(num);
+ return list;
+ }
+
+ });
+ return list;
}
//-----------鏍规嵁钃勭數姹犵粍鏌ヤ笉閲嶅鐨凪onCount(monNum)锛堝崟浣撶紪鍙凤級
public List serchByMonNum(Object obj){
@@ -1002,7 +1331,7 @@
});
return list;
}
-
+ //瀹炴椂鍘嗗彶鏈哄巻鍗�
public List serchByBattgroupId(Object obj){
BattInf binf=(BattInf)obj;
String sql="select * from db_battinf.tb_battinf where battgroupid=?";
@@ -1010,104 +1339,106 @@
public List getResults(ResultSet rs) { List list = new ArrayList();
try {
- while (rs.next()) { BattInf batt = new BattInf();
-
- batt.setNum(Integer.parseInt(rs.getString("num")));
-
- batt.setStationId((rs.getString("StationId")));
-
- batt.setStationName(rs.getString("StationName"));
-
- batt.setStationName1(rs.getString("StationName1"));
-
- batt.setStationName2(rs.getString("StationName2"));
-
- batt.setStationName3(rs.getString("StationName3"));
-
- batt.setStationName4(rs.getString("StationName4"));
-
- batt.setStationName5(rs.getString("StationName5"));
-
- batt.setStationName6(rs.getString("StationName6"));
-
- batt.setStationName7(rs.getString("StationName7"));
-
- batt.setStationName8(rs.getString("StationName8"));
-
- batt.setStationName9(rs.getString("StationName9"));
-
- batt.setStationIp(rs.getString("StationIp"));
-
- batt.setFBSDeviceId(Integer.parseInt(rs.getString("FBSDeviceId")));
-
- batt.setFbsDeviceIp(rs.getString("FbsDeviceIp"));
-
- batt.setFBSDeviceName(rs.getString("FBSDeviceName"));
-
- batt.setGroupIndexInFBSDevice(Integer.parseInt(rs.getString(
- "GroupIndexInFBSDevice")));
-
- batt.setBattModel(rs.getString("BattModel"));
-
- batt.setBattGroupId(Integer.parseInt(rs.getString("BattGroupId")));
-
- batt.setBattGroupNum(Integer.parseInt(rs.getString("BattGroupNum")));
-
- batt.setBattGroupName(rs.getString("BattGroupName"));
-
- batt.setBattGroupName1(rs.getString("BattGroupName1"));
-
- batt.setBattGroupName2(rs.getString("BattGroupName2"));
-
- batt.setBattGroupName3(rs.getString("BattGroupName3"));
-
- batt.setBattGroupName4(rs.getString("BattGroupName4"));
-
- batt.setBattGroupName5(rs.getString("BattGroupName5"));
-
- batt.setBattGroupName6(rs.getString("BattGroupName6"));
-
- batt.setFloatVolLevel(Float.parseFloat(rs.getString("FloatVolLevel")));
-
- batt.setOfflineVolLevel(Float.parseFloat(rs.getString("OfflineVolLevel"))) ;
-
- batt.setBattFloatCurrent(Float.parseFloat(rs.getString("BattFloatCurrent")));
-
- batt.setDeviceId(rs.getString("DeviceId"));
-
- batt.setDeviceName(rs.getString("DeviceName"));
-
- batt.setMonCount(Integer.parseInt(rs.getString("MonCount")));
-
- batt.setMonCapStd(Float.parseFloat(rs.getString("MonCapStd")));
-
- batt.setMonResStd(Float.parseFloat(rs.getString("MonResStd")));
-
- batt.setMonSerStd(Float.parseFloat(rs.getString("MonSerStd")));
-
- batt.setMonTmpStd(Float.parseFloat(rs.getString("MonTmpStd")));
-
- batt.setMonVolStd(Float.parseFloat(rs.getString("MonVolStd")));
-
- batt.setMonVolLowToAvg(Float.parseFloat(rs.getString("MonVolLowToAvg")));
-
- batt.setMonNum(Integer.parseInt(rs.getString("MonNum")));
-
- batt.setBattProducer(rs.getString("BattProducer"));
-
- batt.setBattProductDate((Date) rs.getObject("BattProductDate"));
-
- batt.setBattInUseDate((Date) rs.getObject("BattInUseDate"));
-
- batt.setSignalId(rs.getString("SignalId"));
-
- batt.setCInterFaceId(Integer.parseInt(rs.getString("CInterFaceId")));
-
- batt.setSignalName(rs.getString("SignalName"));
- int BattGuarantDayCount=rs.getInt("BattGuarantDayCount")-ActionUtil.daysBetween(rs.getDate("BattInUseDate"), new Date());//鍓╀綑淇濅慨澶╂暟
- batt.setBattGuarantDayCount(BattGuarantDayCount);
-
- list.add(batt); } } catch (SQLException e) { e.printStackTrace(); }
+ while (rs.next()) {
+ BattInf batt = new BattInf();
+
+ batt.setNum(Integer.parseInt(rs.getString("num")));
+
+ batt.setStationId((rs.getString("StationId")));
+
+ batt.setStationName(rs.getString("StationName"));
+
+ batt.setStationName1(rs.getString("StationName1"));
+
+ batt.setStationName2(rs.getString("StationName2"));
+
+ batt.setStationName3(rs.getString("StationName3"));
+
+ batt.setStationName4(rs.getString("StationName4"));
+
+ batt.setStationName5(rs.getString("StationName5"));
+
+ batt.setStationName6(rs.getString("StationName6"));
+
+ batt.setStationName7(rs.getString("StationName7"));
+
+ batt.setStationName8(rs.getString("StationName8"));
+
+ batt.setStationName9(rs.getString("StationName9"));
+
+ batt.setStationIp(rs.getString("StationIp"));
+
+ batt.setFBSDeviceId(Integer.parseInt(rs.getString("FBSDeviceId")));
+
+ batt.setFbsDeviceIp(rs.getString("FbsDeviceIp"));
+
+ batt.setFBSDeviceName(rs.getString("FBSDeviceName"));
+
+ batt.setGroupIndexInFBSDevice(Integer.parseInt(rs.getString(
+ "GroupIndexInFBSDevice")));
+
+ batt.setBattModel(rs.getString("BattModel"));
+
+ batt.setBattGroupId(Integer.parseInt(rs.getString("BattGroupId")));
+
+ batt.setBattGroupNum(Integer.parseInt(rs.getString("BattGroupNum")));
+
+ batt.setBattGroupName(rs.getString("BattGroupName"));
+
+ batt.setBattGroupName1(rs.getString("BattGroupName1"));
+
+ batt.setBattGroupName2(rs.getString("BattGroupName2"));
+
+ batt.setBattGroupName3(rs.getString("BattGroupName3"));
+
+ batt.setBattGroupName4(rs.getString("BattGroupName4"));
+
+ batt.setBattGroupName5(rs.getString("BattGroupName5"));
+
+ batt.setBattGroupName6(rs.getString("BattGroupName6"));
+
+ batt.setFloatVolLevel(Float.parseFloat(rs.getString("FloatVolLevel")));
+
+ batt.setOfflineVolLevel(Float.parseFloat(rs.getString("OfflineVolLevel"))) ;
+
+ batt.setBattFloatCurrent(Float.parseFloat(rs.getString("BattFloatCurrent")));
+
+ batt.setDeviceId(rs.getString("DeviceId"));
+
+ batt.setDeviceName(rs.getString("DeviceName"));
+
+ batt.setMonCount(Integer.parseInt(rs.getString("MonCount")));
+
+ batt.setMonCapStd(Float.parseFloat(rs.getString("MonCapStd")));
+
+ batt.setMonResStd(Float.parseFloat(rs.getString("MonResStd")));
+
+ batt.setMonSerStd(Float.parseFloat(rs.getString("MonSerStd")));
+
+ batt.setMonTmpStd(Float.parseFloat(rs.getString("MonTmpStd")));
+
+ batt.setMonVolStd(Float.parseFloat(rs.getString("MonVolStd")));
+
+ batt.setMonVolLowToAvg(Float.parseFloat(rs.getString("MonVolLowToAvg")));
+
+ batt.setMonNum(Integer.parseInt(rs.getString("MonNum")));
+
+ batt.setBattProducer(rs.getString("BattProducer"));
+
+ batt.setBattProductDate((Date) rs.getObject("BattProductDate"));
+
+ batt.setBattInUseDate((Date) rs.getObject("BattInUseDate"));
+
+ batt.setSignalId(rs.getString("SignalId"));
+
+ batt.setCInterFaceId(Integer.parseInt(rs.getString("CInterFaceId")));
+ batt.setInstall_user(rs.getString("install_user"));
+ batt.setSignalName(rs.getString("SignalName"));
+ int BattGuarantDayCount=rs.getInt("BattGuarantDayCount")-ActionUtil.daysBetween(rs.getDate("BattInUseDate"), new Date());//鍓╀綑淇濅慨澶╂暟
+ batt.setBattGuarantDayCount(BattGuarantDayCount);
+
+ list.add(batt);
+ } } catch (SQLException e) { e.printStackTrace(); }
return list; }
});
@@ -1418,7 +1749,7 @@
Connection conn=DBUtil.getConn();
String numberSql=" SELECT FOUND_ROWS() number";
String sql="";
- String baseSql="select SQL_CALC_FOUND_ROWS distinct(db_battinf.tb_battinf.BattgroupId),db_battinf.tb_battinf.stationid,StationName1,StationName,stationip,BattGroupName,BattGroupName1,battgroupnum,moncount,moncapstd,monvolstd,battproducer,battproductdate,battinusedate "
+ String baseSql="select SQL_CALC_FOUND_ROWS distinct(db_battinf.tb_battinf.BattgroupId),db_battinf.tb_battinf.stationid,StationName1,StationName2,StationName5,StationName,stationip,BattGroupName,BattGroupName1,battgroupnum,moncount,moncapstd,monvolstd,battproducer,battproductdate,battinusedate "
+ " from db_battinf.tb_battinf "
+ " where ";
//閫夊彇钃勭數姹犵粍鏉′欢
@@ -1436,14 +1767,14 @@
" 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_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " +
" and db_user.tb_user_inf.uid=? " +
- " and db_battinf.tb_battinf.stationname1 like ? and db_battinf.tb_battinf.stationname like ? and db_battinf.tb_battinf.stationname2 like ? )";
+ " and db_battinf.tb_battinf.stationname1 like ? and db_battinf.tb_battinf.stationname like ? and db_battinf.tb_battinf.stationname2 like ? and db_battinf.tb_battinf.stationname5 like ? )";
baseSql+=userSql;
String endSql=" order by StationName1 asc,db_battinf.tb_battinf.BattgroupId asc ";
sql=baseSql+endSql;
String limitSql=" limit ?,? ";
sql+=limitSql;
//System.out.println(sql);
- List<BattInf> list = DAOHelper.executeQueryLimit(sql,conn,new Object[] {binf.getBattGroupId(),uinf.getUId(),"%"+binf.getStationName1()+"%","%"+binf.getStationName()+"%","%"+binf.getStationName2()+"%",(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()},
+ List<BattInf> list = DAOHelper.executeQueryLimit(sql,conn,new Object[] {binf.getBattGroupId(),uinf.getUId(),"%"+binf.getStationName1()+"%","%"+binf.getStationName()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName5()+"%",(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()},
new CallBack() {
public List getResults(ResultSet rs) {
List list=new ArrayList();
@@ -1454,6 +1785,8 @@
binf.setStationId(rs.getString("stationId"));
binf.setStationName(rs.getString("stationName"));
binf.setStationName1(rs.getString("stationName1"));
+ binf.setStationName2(rs.getString("stationName2"));
+ binf.setStationName5(rs.getString("stationName5"));
binf.setStationIp(rs.getString("stationIp"));
binf.setBattGroupName(rs.getString("battGroupName"));
binf.setBattGroupName1(rs.getString("battGroupName1"));
@@ -1619,7 +1952,7 @@
Connection conn=DBUtil.getConn();
String numberSql=" SELECT FOUND_ROWS() number";
String sql="";
- String baseSql=" select SQL_CALC_FOUND_ROWS distinct(db_battinf.tb_battinf.BattgroupId),db_battinf.tb_battinf.stationid,StationName1,StationName,stationip,BattGroupName,BattGroupName1,moncount,moncapstd,monvolstd,battproducer,battproductdate,battinusedate " +
+ String baseSql=" select SQL_CALC_FOUND_ROWS distinct(db_battinf.tb_battinf.BattgroupId),db_battinf.tb_battinf.stationid,StationName1,StationName2,StationName5,StationName,stationip,BattGroupName,BattGroupName1,moncount,moncapstd,monvolstd,battproducer,battproductdate,battinusedate " +
" from db_battinf.tb_battinf " +
" where ";
//閫夊彇钃勭數姹犵粍鏉′欢
@@ -1637,7 +1970,7 @@
" 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_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " +
" and db_user.tb_user_inf.uid=? " +
- " and db_battinf.tb_battinf.stationname1 like ? and db_battinf.tb_battinf.stationname like ? and db_battinf.tb_battinf.stationname2 like ?)";
+ " and db_battinf.tb_battinf.stationname1 like ? and db_battinf.tb_battinf.stationname like ? and db_battinf.tb_battinf.stationname2 like ? and db_battinf.tb_battinf.stationname5 like ?) ";
baseSql+=userSql;
//鎺掑簭
String endSql=" order by db_battinf.tb_battinf.battgroupid asc ";
@@ -1647,7 +1980,7 @@
sql=baseSql+endSql+limitSql;
//System.out.println(sql);
List<BattInf> list=DAOHelper.executeQueryLimit(sql,conn, new Object[]{
- binf.getBattGroupId(),uinf.getUId(),"%"+binf.getStationName1()+"%","%"+binf.getStationName()+"%","%"+binf.getStationName2()+"%",
+ binf.getBattGroupId(),uinf.getUId(),"%"+binf.getStationName1()+"%","%"+binf.getStationName()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName5()+"%",
(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, new CallBack() {
public List getResults(ResultSet rs) {
@@ -1659,6 +1992,8 @@
binf.setBattGroupId(rs.getInt("battGroupId"));
binf.setStationId(rs.getString("stationId"));
binf.setStationName1(rs.getString("stationName1"));
+ binf.setStationName2(rs.getString("stationName2"));
+ binf.setStationName5(rs.getString("stationName5"));
binf.setStationName(rs.getString("stationName"));
binf.setStationIp(rs.getString("stationIp"));
binf.setBattGroupName(rs.getString("battGroupName"));
@@ -1838,7 +2173,7 @@
Page page =bmd.getPage();
Batttestdata_inf tinf=bmd.getTdata();
String sql="";
- String baseSql=" select distinct(db_battinf.tb_battinf.BattgroupId),StationName1,StationName,stationip,BattGroupName,BattGroupName1,moncount,moncapstd,monvolstd,battproducer,battproductdate,battinusedate " +
+ String baseSql=" select distinct(db_battinf.tb_battinf.BattgroupId),StationName1,StationName2,StationName5,StationName,stationip,BattGroupName,BattGroupName1,moncount,moncapstd,monvolstd,battproducer,battproductdate,battinusedate " +
" ,db_batt_testdata.tb_batttestdata_inf.test_record_count,test_starttime " +
"from db_battinf.tb_battinf,db_batt_testdata.tb_batttestdata_inf " +
" where db_battinf.tb_battinf.battgroupid=db_batt_testdata.tb_batttestdata_inf.battgroupid " +
@@ -1858,7 +2193,7 @@
" 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_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " +
" and db_user.tb_user_inf.uid=? " +
- " and db_battinf.tb_battinf.stationname1 like ? and db_battinf.tb_battinf.stationname like ? and db_battinf.tb_battinf.stationname2 like ?)";
+ " and db_battinf.tb_battinf.stationname1 like ? and db_battinf.tb_battinf.stationname like ? and db_battinf.tb_battinf.stationname2 like ? and db_battinf.tb_battinf.stationname5 like ?)";
baseSql+=userSql;
//鍏呯數鏀剧數閫夋嫨
String test_typeA="";//鍏ㄩ儴
@@ -1894,7 +2229,7 @@
//System.out.println(sql);
List<BattInf> list=DAOHelper.executeQuery(sql,DBUtil.getConn(), new Object[]{
tinf.getRecord_time(),tinf.getRecord_time1()
- ,binf.getBattGroupId(),uinf.getUId(),"%"+binf.getStationName1()+"%","%"+binf.getStationName()+"%","%"+binf.getStationName2()+"%"
+ ,binf.getBattGroupId(),uinf.getUId(),"%"+binf.getStationName1()+"%","%"+binf.getStationName()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName5()+"%"
}, new CallBack() {
public List getResults(ResultSet rs) {
@@ -1905,6 +2240,8 @@
BattInf binf=new BattInf();
binf.setBattGroupId(rs.getInt("battGroupId"));
binf.setStationName1(rs.getString("stationName1"));
+ binf.setStationName2(rs.getString("stationName2"));
+ binf.setStationName2(rs.getString("stationName5"));
binf.setStationName(rs.getString("stationName"));
binf.setStationIp(rs.getString("stationIp"));
binf.setBattGroupName(rs.getString("battGroupName"));
@@ -3179,7 +3516,7 @@
" where 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_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " +
- " and db_user.tb_user_inf.uid=?" +
+ " and db_user.tb_user_inf.uid=? and db_battinf.tb_battinf.Station_install=1 " +
" limit 1";
List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() {
@@ -3279,6 +3616,31 @@
} );
return list;
}
+ //鏌ヨ鎵�鏈夌殑鐪佷唤(宸︿晶瀵艰埅绗竴灞傦紝鏌ユ墍鏈夌殑鐪佷唤)
+ public List serchAllStation_all(Object obj){
+ BattInf binf=(BattInf) obj;;
+ String sql="select DISTINCT StationName1 " +
+ " FROM db_battinf.tb_battinf " +
+ " ORDER BY CONVERT( StationName1 USING gbk ) COLLATE gbk_chinese_ci ASC";
+ List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), null,new CallBack() {
+
+ public List getResults(ResultSet rs) {
+ List list=new ArrayList();
+ try {
+ while(rs.next()){
+ BattInf batt = new BattInf();
+ batt.setStationName1(rs.getString("stationName1"));
+ list.add(batt);
+ }
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return list;
+ }
+ } );
+ return list;
+ }
//鏌ヨ绠$悊鐨勫競(宸︿晶瀵艰埅绗簩灞傦紝鏌ユ墍鏈夌殑甯�,num涓瓨鏀緐id)
public List serchStationName2(Object obj){
@@ -3309,16 +3671,102 @@
} );
return list;
}
- //鏌ヨ绠$悊鐨勬満鎴�(宸︿晶瀵艰埅绗笁灞傦紝鏌ユ墍鏈夌殑鏈烘埧,num涓瓨鏀緐id)
- public List serchStationName3(Object obj){
+ //鏌ヨ绠$悊鐨勫競(宸︿晶瀵艰埅绗簩灞傦紝鏌ユ墍鏈夌殑甯�)
+ public List serchStationName2_all(Object obj){
BattInf binf=(BattInf) obj;
- String sql="select DISTINCT StationName,StationName1,StationName2,StationName3,stationid,fbsdeviceid,FBSDeviceName " +
+ String sql="select DISTINCT StationName1,StationName2 " +
+ " FROM db_battinf.tb_battinf " +
+ " where StationName1 like ? " +
+ " ORDER BY CONVERT( StationName2 USING gbk ) COLLATE gbk_chinese_ci ASC ";
+ List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName1()+"%"},new CallBack() {
+
+ public List getResults(ResultSet rs) {
+ List list=new ArrayList();
+ try {
+ while(rs.next()){
+ BattInf batt = new BattInf();
+ batt.setStationName1(rs.getString("stationName1"));
+ batt.setStationName2(rs.getString("stationName2"));
+ list.add(batt);
+ }
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return list;
+ }
+ } );
+ return list;
+ }
+ //鏌ヨ绠$悊鐨勫幙/鍖�(宸︿晶瀵艰埅绗笁灞傦紝鏌ユ墍鏈夌殑鍘�/鍖�)
+ public List serchStationName5(Object obj){
+ BattInf binf=(BattInf) obj;
+ String sql="select DISTINCT stationName5,StationName1,StationName2 " +
" FROM db_battinf.tb_battinf " +
" where StationId in(" +
" select distinct db_user.tb_user_battgroup_baojigroup_battgroup.StationId from db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr where db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id=db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id and db_user.tb_user_battgroup_baojigroup_usr.uId=?" +
" ) and StationName1 like ? and StationName2 like ? " +
" ORDER BY CONVERT( StationName USING gbk ) COLLATE gbk_chinese_ci ASC ";
+ //System.out.println(sql);
List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getNum(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%"},new CallBack() {
+
+ public List getResults(ResultSet rs) {
+ List list=new ArrayList();
+ try {
+ while(rs.next()){
+ BattInf batt = new BattInf();
+ batt.setStationName1(rs.getString("stationName1"));
+ batt.setStationName2(rs.getString("stationName2"));
+ batt.setStationName5(rs.getString("stationName5"));
+ list.add(batt);
+ }
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return list;
+ }
+ } );
+ return list;
+ }
+ //鏌ヨ绠$悊鐨勫幙/鍖�(宸︿晶瀵艰埅绗笁灞傦紝鏌ユ墍鏈夌殑鍘�/鍖�)
+ public List serchStationName5_all(Object obj){
+ BattInf binf=(BattInf) obj;
+ String sql="select DISTINCT stationName5,StationName1,StationName2 " +
+ " FROM db_battinf.tb_battinf " +
+ " where StationName1 like ? and StationName2 like ? " +
+ " ORDER BY CONVERT( StationName USING gbk ) COLLATE gbk_chinese_ci ASC ";
+ List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%"},new CallBack() {
+
+ public List getResults(ResultSet rs) {
+ List list=new ArrayList();
+ try {
+ while(rs.next()){
+ BattInf batt = new BattInf();
+ batt.setStationName1(rs.getString("stationName1"));
+ batt.setStationName2(rs.getString("stationName2"));
+ batt.setStationName5(rs.getString("stationName5"));
+ list.add(batt);
+ }
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return list;
+ }
+ } );
+ return list;
+ }
+ //鏌ヨ绠$悊鐨勬満鎴�(宸︿晶瀵艰埅绗洓灞傦紝鏌ユ墍鏈夌殑鏈烘埧,num涓瓨鏀緐id)
+ public List serchStationName3(Object obj){
+ BattInf binf=(BattInf) obj;
+ String sql="select DISTINCT StationName,StationName1,StationName2,StationName3,StationName5,stationid,fbsdeviceid,FBSDeviceName,Station_install " +
+ " FROM db_battinf.tb_battinf " +
+ " where StationId in(" +
+ " select distinct db_user.tb_user_battgroup_baojigroup_battgroup.StationId from db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr where db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id=db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id and db_user.tb_user_battgroup_baojigroup_usr.uId=?" +
+ " ) and StationName1 like ? and StationName2 like ? and StationName5 like ? " +
+ " ORDER BY CONVERT( StationName USING gbk ) COLLATE gbk_chinese_ci ASC ";
+ List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getNum(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName5()+"%"},new CallBack() {
public List getResults(ResultSet rs) {
List list=new ArrayList();
@@ -3329,9 +3777,45 @@
batt.setStationName1(rs.getString("stationName1"));
batt.setStationName2(rs.getString("stationName2"));
batt.setStationName3(rs.getString("stationName3"));
+ batt.setStationName5(rs.getString("stationName5"));
batt.setStationId(rs.getString("stationId"));
batt.setFBSDeviceName(rs.getString("fBSDeviceName"));
batt.setFBSDeviceId(rs.getInt("fBSDeviceId"));
+ batt.setStation_install(rs.getInt("station_install"));
+ list.add(batt);
+ }
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return list;
+ }
+ } );
+ return list;
+ }
+ //鏌ヨ绠$悊鐨勬満鎴�(宸︿晶瀵艰埅绗洓灞傦紝鏌ユ墍鏈夌殑鏈烘埧)
+ public List serchStationName3_all(Object obj){
+ BattInf binf=(BattInf) obj;
+ String sql="select DISTINCT StationName,StationName1,StationName2,StationName3,StationName5,stationid,fbsdeviceid,FBSDeviceName,station_install " +
+ " FROM db_battinf.tb_battinf " +
+ " where StationName1 like ? and StationName2 like ? and StationName5 like ? " +
+ " ORDER BY CONVERT( StationName USING gbk ) COLLATE gbk_chinese_ci ASC ";
+ List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName5()+"%"},new CallBack() {
+
+ public List getResults(ResultSet rs) {
+ List list=new ArrayList();
+ try {
+ while(rs.next()){
+ BattInf batt = new BattInf();
+ batt.setStationName(rs.getString("stationName"));
+ batt.setStationName1(rs.getString("stationName1"));
+ batt.setStationName2(rs.getString("stationName2"));
+ batt.setStationName3(rs.getString("stationName3"));
+ batt.setStationName5(rs.getString("stationName5"));
+ batt.setStationId(rs.getString("stationId"));
+ batt.setFBSDeviceName(rs.getString("fBSDeviceName"));
+ batt.setFBSDeviceId(rs.getInt("fBSDeviceId"));
+ batt.setStation_install(rs.getInt("station_install"));
list.add(batt);
}
} catch (SQLException e) {
@@ -3345,11 +3829,11 @@
}
- //鏍规嵁鏈烘埧id鏌ヨ鏈烘埧涓嬬殑鐢垫睜缁勪俊鎭�(宸︿晶瀵艰埅绗洓灞�,鏍规嵁鏈烘埧鏌ヨ涓嬮潰鐨勭數姹犵粍,num涓瓨鏀緐id)
+ //鏍规嵁鏈烘埧id鏌ヨ鏈烘埧涓嬬殑鐢垫睜缁勪俊鎭�(宸︿晶瀵艰埅绗簲灞�,鏍规嵁鏈烘埧鏌ヨ涓嬮潰鐨勭數姹犵粍,num涓瓨鏀緐id)
public List serchBattByStation(Object obj){
BattInf binf=(BattInf) obj;
- String sql="select DISTINCT StationName,StationId,StationIP,FBSDeviceId,BattGroupName,BattGroupName1,BattGroupName2,MonCount,battgroupId,MonCapStd,MonVolStd,MonResStd,MonSerStd,BattProducer,BattInUseDate,GroupIndexInFBSDevice " +
- "from db_battinf.tb_battinf where StationName1 like ? and StationName2 like ? and StationName like ? ";
+ String sql="select DISTINCT StationName,StationName1,StationName2,StationName3,StationName5,StationId,stationid_ex,StationIP,FBSDeviceId,BattGroupName,BattGroupName1,BattGroupName2,MonCount,battgroupId,MonCapStd,MonVolStd,MonResStd,MonSerStd,BattProducer,BattInUseDate,GroupIndexInFBSDevice,Load_curr,DisCurrMax " +
+ "from db_battinf.tb_battinf where StationName1 like ? and StationName2 like ? and StationName like ? and StationName5 like ? ";
//鏈烘埧id
String idSqlT=" and Stationid like ? ";
sql+=idSqlT;
@@ -3360,8 +3844,9 @@
sql+=userSql;
//鎺掑簭
String orderSql=" ORDER BY StationName1,battgroupId ";
+ sql+=orderSql;
//System.out.println(sql);
- List list=DAOHelper.executeQuery(sql, DBUtil.getConn(),new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName()+"%","%"+binf.getStationId()+"%",binf.getNum()},new CallBack() {
+ List list=DAOHelper.executeQuery(sql, DBUtil.getConn(),new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName()+"%","%"+binf.getStationName5()+"%","%"+binf.getStationId()+"%",binf.getNum()},new CallBack() {
public List getResults(ResultSet rs) {
List list = new ArrayList();
@@ -3369,6 +3854,67 @@
while (rs.next()) {
BattInf batt = new BattInf();
batt.setStationName(rs.getString("stationName"));
+ batt.setStationName1(rs.getString("stationName1"));
+ batt.setStationName2(rs.getString("stationName2"));
+ batt.setStationName3(rs.getString("stationName3"));
+ batt.setStationName5(rs.getString("stationName5"));
+ batt.setStationId(rs.getString("StationId"));
+ batt.setStationId_ex(rs.getString("stationId_ex"));
+ batt.setStationIp(rs.getString("StationIP"));
+ batt.setBattGroupName(rs.getString("BattGroupName").trim());
+ batt.setBattGroupName1(rs.getString("BattGroupName1").trim());
+ batt.setBattGroupName2(rs.getString("BattGroupName2").trim());
+ batt.setFBSDeviceId(rs.getInt("fBSDeviceId"));
+ batt.setMonCount(rs.getInt("MonCount"));
+ batt.setBattGroupId(rs.getInt("battgroupId"));
+ batt.setMonCapStd(rs.getFloat("monCapStd"));
+ batt.setMonVolStd(rs.getFloat("monVolStd"));
+ batt.setMonResStd(rs.getFloat("MonResStd"));
+ batt.setMonSerStd(rs.getFloat("MonSerStd"));
+ batt.setBattProducer(rs.getString("BattProducer"));
+ batt.setBattInUseDate(rs.getDate("BattInUseDate"));
+ batt.setGroupIndexInFBSDevice(rs.getInt("groupIndexInFBSDevice"));
+ batt.setLoad_curr(rs.getFloat("load_curr"));
+ batt.setDisCurrMax(rs.getFloat("disCurrMax"));
+ list.add(batt);
+ }
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ return list;
+ }
+ });
+ return list;
+ }
+ //鏍规嵁鏈烘埧id鏌ヨ鏈烘埧涓嬬殑鐢垫睜缁勪俊鎭�(宸︿晶瀵艰埅绗簲灞�,鏍规嵁鏈烘埧鏌ヨ涓嬮潰鐨勭數姹犵粍,num涓瓨鏀緐id)
+ public List serchBattByStation_all(Object obj){
+ BattInf binf=(BattInf) obj;
+ String sql="select DISTINCT StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationId,StationIP,FBSDeviceId,BattGroupName,BattGroupName1,BattGroupName2,MonCount,battgroupId,MonCapStd,MonVolStd,MonResStd,MonSerStd,BattProducer,BattInUseDate,GroupIndexInFBSDevice " +
+ "from db_battinf.tb_battinf where StationName1 like ? and StationName2 like ? and StationName like ? and StationName5 like ? ";
+ //鏈烘埧id
+ String idSqlT=" and Stationid like ? ";
+ sql+=idSqlT;
+ //鐢ㄦ埛绠$悊
+ String userSql=" and StationId in(" +
+ " select distinct db_user.tb_user_battgroup_baojigroup_battgroup.StationId from db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr where db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id=db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id and db_user.tb_user_battgroup_baojigroup_usr.uId=?" +
+ " ) ";
+ //sql+=userSql;
+ //鎺掑簭
+ String orderSql=" ORDER BY StationName1,battgroupId ";
+ sql+=orderSql;
+ //System.out.println(sql);
+ List list=DAOHelper.executeQuery(sql, DBUtil.getConn(),new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName()+"%","%"+binf.getStationName5()+"%","%"+binf.getStationId()+"%"},new CallBack() {
+
+ public List getResults(ResultSet rs) {
+ List list = new ArrayList();
+ try {
+ while (rs.next()) {
+ BattInf batt = new BattInf();
+ batt.setStationName(rs.getString("stationName"));
+ batt.setStationName1(rs.getString("stationName1"));
+ batt.setStationName2(rs.getString("stationName2"));
+ batt.setStationName3(rs.getString("stationName3"));
+ batt.setStationName5(rs.getString("stationName5"));
batt.setStationId(rs.getString("StationId"));
batt.setStationIp(rs.getString("StationIP"));
batt.setBattGroupName(rs.getString("BattGroupName").trim());
@@ -3478,15 +4024,711 @@
return nums;
}
+
+ //鐢垫睜閰嶇粍绠$悊(閲嶈)
+ public List serchMakeGroup(Object obj){
+ BattInf binf=(BattInf) obj;
+ String sql="SELECT distinct BattGroupId,battgroupname,stationid,stationname1,stationname2,stationname5,stationname,stationname3,BattProducer,MonVolStd,MonCapStd,monCount " +
+ " ,battinf_re.old_stationname,old_battgroupname,old_battproducer,old_stationid,old_battgroupid,old_monum,new_stationname,new_battgroupname,new_battproducer,new_stationid,new_battgroupid,new_monum,rebuild_time,rebuild_uid,rebuild_address,rebuild_clear_type " +
+ " from db_battinf.tb_battinf " +
+ " left outer join (select * from db_battinf.tb_battinf_rebuild where tb_battinf_rebuild.rebuild_clear_type=1 ) as battinf_re " +
+ " on BattGroupId=battinf_re.new_battgroupid or BattGroupId=battinf_re.old_battgroupid " +
+ " where stationname2 like ? and stationname5 like ? ";
+ //鐢ㄦ埛绠$悊
+ String userSql=" and StationId in(" +
+ " select distinct db_user.tb_user_battgroup_baojigroup_battgroup.StationId from db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr where db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id=db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id and db_user.tb_user_battgroup_baojigroup_usr.uId=?" +
+ " ) ";
+ sql+=userSql;
+ //閫変腑鍝佺墝涓�鑷�
+ String producerSqlT=" order by BattProducer,MonCapStd,MonVolStd,BattGroupId ";//涓�鑷�
+ String producerSqlF=" order by MonCapStd,MonVolStd,BattGroupId ";//涓嶄竴鑷�
+ if(binf.getBattProducer().equals("1")){
+ sql+=producerSqlT;
+ }else{
+ sql+=producerSqlF;
+ }
+ List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName2()+"%","%"+binf.getStationName5()+"%",binf.getNum()}, new CallBack() {
+
+ public List getResults(ResultSet rs) {
+ List<BattInf> list=new ArrayList();
+ int battgroupid=0;
+ try {
+ while(rs.next()){
+ BattInf binf=new BattInf();
+ binf.setBattGroupId(rs.getInt("battGroupId"));
+ binf.setBattGroupName(rs.getString("battGroupName"));
+ binf.setStationId(rs.getString("stationId"));
+ binf.setStationName(rs.getString("stationName"));
+ binf.setStationName1(rs.getString("stationName1"));
+ binf.setStationName2(rs.getString("stationName2"));
+ binf.setStationName3(rs.getString("stationName3"));
+ binf.setStationName5(rs.getString("stationName5"));
+ binf.setBattProducer(rs.getString("battProducer"));
+ binf.setMonVolStd(rs.getFloat("monVolStd"));
+ binf.setMonCapStd(rs.getFloat("monCapStd"));
+ binf.setMonCount(rs.getInt("monCount"));
+
+ BattInf_Rebuild brinf=new BattInf_Rebuild();
+ brinf.setNew_battgroupid(rs.getInt("new_battgroupid"));
+ brinf.setNew_battgroupname(rs.getString("new_battgroupname"));
+ brinf.setNew_battproducer(rs.getString("new_battproducer"));
+ brinf.setNew_monum(rs.getInt("new_monum"));
+ brinf.setNew_stationid(rs.getString("new_stationid"));
+ brinf.setNew_stationname(rs.getString("new_stationname"));
+ brinf.setOld_battgroupid(rs.getInt("old_battgroupid"));
+ brinf.setOld_battgroupname(rs.getString("old_battgroupname"));
+ brinf.setOld_battproducer(rs.getString("old_battproducer"));
+ brinf.setOld_monum(rs.getInt("old_monum"));
+ brinf.setOld_stationid(rs.getString("old_stationid"));
+ brinf.setOld_stationname(rs.getString("old_stationname"));
+ brinf.setRebuild_address(rs.getString("rebuild_address"));
+ brinf.setRebuild_clear_type(rs.getInt("rebuild_clear_type"));
+ brinf.setRebuild_time(rs.getTimestamp("rebuild_time"));
+ brinf.setRebuild_uid(rs.getInt("rebuild_uid"));
+
+ if(binf.getBattGroupId()==battgroupid){
+ ((ArrayList)list.get(list.size()-1).getObj()).add(brinf);
+ continue;
+ }
+ List listr=new ArrayList();
+ listr.add(brinf);
+ binf.setObj(listr);
+ battgroupid=binf.getBattGroupId();
+
+ list.add(binf);
+ }
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return list;
+ }
+ });
+ return list;
+ }
+ //鐢垫睜閰嶇粍绠$悊(閲嶈)
+ public List serchGroupByInfor(Object obj){
+ BattInf binf=(BattInf) obj;
+ String sql="SELECT distinct BattGroupId,battgroupname,stationid,stationname1,stationname2,stationname,stationname3,stationname5,BattProducer,MonVolStd,MonCapStd,monCount " +
+ " ,battinf_re.old_stationname,old_battgroupname,old_battproducer,old_stationid,old_battgroupid,old_monum,new_stationname,new_battgroupname,new_battproducer,new_stationid,new_battgroupid,new_monum,rebuild_time,rebuild_uid,rebuild_address,rebuild_clear_type " +
+ " from db_battinf.tb_battinf " +
+ " left outer join (select * from db_battinf.tb_battinf_rebuild where tb_battinf_rebuild.rebuild_clear_type=1 ) as battinf_re " +
+ " on BattGroupId=battinf_re.new_battgroupid or BattGroupId=battinf_re.old_battgroupid " +
+ " where stationname1 like ? and stationname2 like ? and stationname3 like ? and stationname5 like ? and battgroupname like ? and battgroupid=? ";
+ //鐢ㄦ埛绠$悊
+ String userSql=" and StationId in(" +
+ " select distinct db_user.tb_user_battgroup_baojigroup_battgroup.StationId from db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr where db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id=db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id and db_user.tb_user_battgroup_baojigroup_usr.uId=?" +
+ " ) ";
+ sql+=userSql;
+ List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationName5()+"%","%"+binf.getBattGroupName()+"%",binf.getBattGroupId(),binf.getNum()}, new CallBack() {
+
+ public List getResults(ResultSet rs) {
+ List<BattInf> list=new ArrayList();
+ int battgroupid=0;
+ try {
+ while(rs.next()){
+ BattInf binf=new BattInf();
+ binf.setBattGroupId(rs.getInt("battGroupId"));
+ binf.setBattGroupName(rs.getString("battGroupName"));
+ binf.setStationId(rs.getString("stationId"));
+ binf.setStationName(rs.getString("stationName"));
+ binf.setStationName1(rs.getString("stationName1"));
+ binf.setStationName2(rs.getString("stationName2"));
+ binf.setStationName3(rs.getString("stationName3"));
+ binf.setStationName5(rs.getString("stationName5"));
+ binf.setBattProducer(rs.getString("battProducer"));
+ binf.setMonVolStd(rs.getFloat("monVolStd"));
+ binf.setMonCapStd(rs.getFloat("monCapStd"));
+ binf.setMonCount(rs.getInt("monCount"));
+
+ BattInf_Rebuild brinf=new BattInf_Rebuild();
+ brinf.setNew_battgroupid(rs.getInt("new_battgroupid"));
+ brinf.setNew_battgroupname(rs.getString("new_battgroupname"));
+ brinf.setNew_battproducer(rs.getString("new_battproducer"));
+ brinf.setNew_monum(rs.getInt("new_monum"));
+ brinf.setNew_stationid(rs.getString("new_stationid"));
+ brinf.setNew_stationname(rs.getString("new_stationname"));
+ brinf.setOld_battgroupid(rs.getInt("old_battgroupid"));
+ brinf.setOld_battgroupname(rs.getString("old_battgroupname"));
+ brinf.setOld_battproducer(rs.getString("old_battproducer"));
+ brinf.setOld_monum(rs.getInt("old_monum"));
+ brinf.setOld_stationid(rs.getString("old_stationid"));
+ brinf.setOld_stationname(rs.getString("old_stationname"));
+ brinf.setRebuild_address(rs.getString("rebuild_address"));
+ brinf.setRebuild_clear_type(rs.getInt("rebuild_clear_type"));
+ brinf.setRebuild_time(rs.getTimestamp("rebuild_time"));
+ brinf.setRebuild_uid(rs.getInt("rebuild_uid"));
+
+ if(binf.getBattGroupId()==battgroupid){
+ ((ArrayList)list.get(list.size()-1).getObj()).add(brinf);
+ continue;
+ }
+ List listr=new ArrayList();
+ listr.add(brinf);
+ binf.setObj(listr);
+ battgroupid=binf.getBattGroupId();
+
+ list.add(binf);
+ }
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return list;
+ }
+ });
+ return list;
+ }
+ //棣栭〉涓婃牴鎹畇tationid鏌ヨ鐢垫睜缁勭殑鏈哄巻鍗�
+ public List serchBattAllInfoByStationId(Object obj){
+ BattInf binf=(BattInf) obj;
+ String sql="select * from db_battinf.tb_battinf " +
+ " left outer join db_battinf.tb_battinf_ex on db_battinf.tb_battinf.stationId=db_battinf.tb_battinf_ex.stationid " +
+ " where db_battinf.tb_battinf.stationId=? " +
+ " order by db_battinf.tb_battinf.battgroupid";
+ List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getStationId()}, new CallBack() {
+
+ public List getResults(ResultSet rs) {
+ List list=new ArrayList();
+ try {
+ while(rs.next()){
+ BattInf batt = new BattInf();
+
+ batt.setStationId((rs.getString("StationId")));
+ batt.setStationId_ex(rs.getString("stationId_ex"));
+
+ batt.setStationName(rs.getString("StationName"));
+
+ batt.setStationName1(rs.getString("StationName1"));
+
+ batt.setStationName2(rs.getString("StationName2"));
+
+ batt.setStationName3(rs.getString("StationName3"));
+
+ batt.setStationName4(rs.getString("StationName4"));
+
+ batt.setStationName5(rs.getString("StationName5"));
+
+ batt.setStationName6(rs.getString("StationName6"));
+
+ batt.setStationName7(rs.getString("StationName7"));
+
+ batt.setStationName8(rs.getString("StationName8"));
+
+ batt.setStationName9(rs.getString("StationName9"));
+
+ batt.setStationIp(rs.getString("StationIp"));
+
+ batt.setFBSDeviceId(Integer.parseInt(rs.getString("FBSDeviceId")));
+
+ batt.setFbsDeviceIp(rs.getString("FbsDeviceIp"));
+
+ batt.setFBSDeviceName(rs.getString("FBSDeviceName"));
+
+ batt.setGroupIndexInFBSDevice(Integer.parseInt(rs.getString(
+ "GroupIndexInFBSDevice")));
+
+ batt.setBattModel(rs.getString("BattModel"));
+
+ batt.setBattGroupId(Integer.parseInt(rs.getString("BattGroupId")));
+
+ batt.setBattGroupNum(Integer.parseInt(rs.getString("BattGroupNum")));
+
+ batt.setBattGroupName(rs.getString("BattGroupName"));
+
+ batt.setBattGroupName1(rs.getString("BattGroupName1"));
+
+ batt.setBattGroupName2(rs.getString("BattGroupName2"));
+
+ batt.setBattGroupName3(rs.getString("BattGroupName3"));
+
+ batt.setBattGroupName4(rs.getString("BattGroupName4"));
+
+ batt.setBattGroupName5(rs.getString("BattGroupName5"));
+
+ batt.setBattGroupName6(rs.getString("BattGroupName6"));
+
+ batt.setFloatVolLevel(Float.parseFloat(rs.getString("FloatVolLevel")));
+
+ batt.setOfflineVolLevel(Float.parseFloat(rs.getString("OfflineVolLevel"))) ;
+
+ batt.setBattFloatCurrent(Float.parseFloat(rs.getString("BattFloatCurrent")));
+
+ batt.setDeviceId(rs.getString("DeviceId"));
+
+ batt.setDeviceName(rs.getString("DeviceName"));
+
+ batt.setMonCount(Integer.parseInt(rs.getString("MonCount")));
+
+ batt.setMonCapStd(Float.parseFloat(rs.getString("MonCapStd")));
+
+ batt.setMonResStd(Float.parseFloat(rs.getString("MonResStd")));
+
+ batt.setMonSerStd(Float.parseFloat(rs.getString("MonSerStd")));
+
+ batt.setMonTmpStd(Float.parseFloat(rs.getString("MonTmpStd")));
+
+ batt.setMonVolStd(Float.parseFloat(rs.getString("MonVolStd")));
+
+ batt.setMonVolLowToAvg(Float.parseFloat(rs.getString("MonVolLowToAvg")));
+
+ batt.setMonNum(Integer.parseInt(rs.getString("MonNum")));
+
+ batt.setBattProducer(rs.getString("BattProducer"));
+
+ batt.setBattProductDate((Date) rs.getObject("BattProductDate"));
+
+ batt.setBattInUseDate((Date) rs.getObject("BattInUseDate"));
+
+ batt.setSignalId(rs.getString("SignalId"));
+
+ batt.setCInterFaceId(Integer.parseInt(rs.getString("CInterFaceId")));
+ batt.setInstall_user(rs.getString("install_user"));
+ batt.setSignalName(rs.getString("SignalName"));
+ int BattGuarantDayCount=rs.getInt("BattGuarantDayCount")-ActionUtil.daysBetween(rs.getDate("BattInUseDate"), new Date());//鍓╀綑淇濅慨澶╂暟
+ batt.setBattGuarantDayCount(BattGuarantDayCount);
+
+ Battinf_ex binf_ex=new Battinf_ex();
+ binf_ex.setStationId(rs.getString("stationId"));
+ binf_ex.setFBSDeviceId(rs.getInt("fBSDeviceId"));
+ binf_ex.setStationName(rs.getString("stationName"));
+ binf_ex.setStationCode(rs.getString("stationCode"));
+ binf_ex.setStationRegion(rs.getString("stationRegion"));
+ binf_ex.setKeyWords(rs.getString("keyWords"));
+ binf_ex.setAffiliation(rs.getString("affiliation"));
+ binf_ex.setDataSources(rs.getString("dataSources"));
+ binf_ex.setStationType(rs.getString("stationType"));
+ binf_ex.setLongitude(rs.getDouble("longitude"));
+ binf_ex.setLatitude(rs.getInt("latitude"));
+ binf_ex.setStationAddr(rs.getString("stationAddr"));
+ binf_ex.setStationLevel(rs.getString("stationLevel"));
+ binf_ex.setMaintenanceState(rs.getString("maintenanceState"));
+ binf_ex.setBlockedState(rs.getString("blockedState"));
+ binf_ex.setMaintenanceCompany(rs.getString("maintenanceCompany"));
+ binf_ex.setBusinessScenario(rs.getString("businessScenario"));
+ binf_ex.setCoverScenario(rs.getString("coverScenario"));
+ binf_ex.setSiteTerrain(rs.getString("siteTerrain"));
+ binf_ex.setPropertyRights(rs.getString("propertyRights"));
+ binf_ex.setPropertyUnit(rs.getString("propertyUnit"));
+ binf_ex.setIsShare(rs.getString("isShare"));
+ binf_ex.setUseUnit(rs.getString("useUnit"));
+ binf_ex.setSiteCode(rs.getString("siteCode"));
+ binf_ex.setHistorySiteCode(rs.getString("historySiteCode"));
+ binf_ex.setSiteInternalNumber(rs.getString("siteInternalNumber"));
+ binf_ex.setSitePinyinReferred(rs.getString("sitePinyinReferred"));
+ binf_ex.setSiteChineseReferred(rs.getString("siteChineseReferred"));
+ binf_ex.setSiteMergeRecord(rs.getString("siteMergeRecord"));
+ binf_ex.setIsOpenBusiness(rs.getString("isOpenBusiness"));
+ binf_ex.setSchoolPersonnel(rs.getString("schoolPersonnel"));
+ binf_ex.setEntryTime(rs.getString("entryTime"));
+ binf_ex.setModifyPeople(rs.getString("modifyPeople"));
+ binf_ex.setModifyTime(rs.getString("modifyTime"));
+ binf_ex.setNote(rs.getString("note"));
+ binf_ex.setSiteReceivesMark(rs.getString("siteReceivesMark"));
+ binf_ex.setSiteValidity(rs.getString("siteValidity"));
+ binf_ex.setSiteNameCMCC(rs.getString("siteNameCMCC"));
+ binf_ex.setSiteNameCUCC(rs.getString("siteNameCUCC"));
+ binf_ex.setSiteNameCTC(rs.getString("siteNameCTC"));
+ binf_ex.setProducer(rs.getString("producer"));
+ binf_ex.setLastTimeLong(rs.getDouble("lastTimeLong"));
+ binf_ex.setLastTimeType(rs.getString("lastTimeType"));
+ binf_ex.setLastTimeDate(rs.getTimestamp("lastTimeDate"));
+ binf_ex.setShareInfo(rs.getString("shareInfo"));
+ binf_ex.setElectPowerCMCC(rs.getInt("electPowerCMCC"));
+ binf_ex.setElectPowerCUCC(rs.getInt("electPowerCUCC"));
+ binf_ex.setElectPowerCTC(rs.getInt("electPowerCTC"));
+ binf_ex.setIsCanElectPower(rs.getInt("isCanElectPower"));
+ binf_ex.setUpperStationRoute(rs.getDouble("upperStationRoute"));
+ binf_ex.setUpperStationDifficult(rs.getString("upperStationDifficult"));
+ binf_ex.setClienteleErrorService(rs.getString("clienteleErrorService"));
+
+ batt.setBinf_ex(binf_ex);
+ list.add(batt);
+ }
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return list;
+ }
+ });
+ return list;
+ }
+ //鏌ヨbattinf涓渶澶х殑battgroupid
+ //鏌ヨ鍑哄綋鍓嶅瓨鍦ㄥ唴瀛樹腑鏈�澶х殑鐢垫睜缁刬d(寰堥噸瑕�**********)
+ public int searchMaxBattgroupId(){
+ String sql=" select max(battgroupId) as id from db_battinf.tb_battinf limit 1";
+ List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), null, new CallBack() {
+
+ public List getResults(ResultSet rs) {
+ List list=new ArrayList();
+ try {
+ while(rs.next()){
+ int battgroupid=1010000;
+ if(rs.getString("id")!=null){
+ battgroupid=rs.getInt("id");
+ }
+ list.add(battgroupid);
+ }
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return list;
+ }
+ });
+ int battgroupid=0;
+ if(list!=null&&list.size()>0){
+ battgroupid=(Integer) list.get(list.size()-1);
+ }
+ return battgroupid;
+ }
+
+ //鎵归噺璁剧疆鏀剧數鍙傛暟鏃讹紝鏍规嵁鐪佸競鍖猴紝鐢垫睜鍗曚綋鍨嬪彿锛堜紡鏁帮級锛岀粍鏁扮瓫閫夊嚭鐢垫睜缁�
+ public List serchByDischarge(Object obj) {
+ BattInf binf=(BattInf) obj;
+ //Page page=binf.getPage();
+ /*Connection conn=DBUtil.getConn();
+ String numberSql=" SELECT FOUND_ROWS() number";SQL_CALC_FOUND_ROWS*/
+ String sql=" select distinct(StationId),StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationIp,FBSDeviceId,"
+ + "FBSDeviceName,GroupIndexInFBSDevice,db_battinf.tb_battinf.battgroupId,battGroupName,battGroupNum" +
+ ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,Load_curr,DisCurrMax"
+ + ",db_ram_db.tb_fbs9100_state.dev_version "
+ + " from db_battinf.tb_battinf,db_ram_db.tb_fbs9100_state "
+ + " where db_battinf.tb_battinf.FBSDeviceId=db_ram_db.tb_fbs9100_state.dev_id "
+ + " and GroupIndexInFBSDevice=? and MonVolStd=? and Station_install=1 ";
+ //+ " limit ?,? ";StationName1 like ? and StationName2 like ? and StationName3 like ? and StationName5 like ? "
+ //,(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%",
+ //鏉′欢
+ String sql0=" and stationid=? "; //鍏蜂綋鏈烘埧
+ String sql1=" and stationname1=? ";//鐪�
+ String sql2=" and stationname2=? ";//甯�
+ String sql5=" and stationname5=? ";//鍖哄幙
+ switch (binf.getNum()) {
+ case 0:
+ sql+=sql0;
+ break;
+ case 1:
+ sql+=sql1;
+ break;
+ case 2:
+ sql+=sql2;
+ break;
+ case 5:
+ sql+=sql5;
+ break;
+ default:
+ return null;
+ }
+
+ //鎺掑簭
+ String orderSql=" order by StationId asc,GroupIndexInFBSDevice asc ";
+ sql+=orderSql;
+ List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[] {binf.getGroupIndexInFBSDevice(),binf.getMonVolStd(),binf.getStationName()}, new CallBack() {
+
+ @Override
+ public List getResults(ResultSet rs) {
+ List list=new ArrayList();
+ try {
+ while(rs.next()) {
+ BattInf binf = new BattInf();
+ binf.setNum(0);
+ binf.setStationId(rs.getString("stationId"));
+ binf.setStationName(rs.getString("stationName"));
+ binf.setStationName1(rs.getString("stationName1"));
+ binf.setStationName2(rs.getString("stationName2"));
+ binf.setStationName3(rs.getString("stationName3"));
+ binf.setStationName4(rs.getString("stationName4"));
+ binf.setStationName5(rs.getString("stationName5"));
+ binf.setStationIp(rs.getString("stationIp"));
+ binf.setFBSDeviceId(rs.getInt("fBSDeviceId"));
+
+ /*binf.setFbsDeviceIp(rs.getString("fbsDeviceIp"));
+ binf.setFbsDeviceIp_YM(rs.getString("fbsDeviceIp_YM"));
+ binf.setFbsDeviceIp_WG(rs.getString("fbsDeviceIp_WG"));*/
+ binf.setFBSDeviceName(rs.getString("fBSDeviceName"));
+ binf.setGroupIndexInFBSDevice(rs.getInt("groupIndexInFBSDevice"));
+ binf.setBattGroupId(rs.getInt("battGroupId"));
+ binf.setBattGroupNum(rs.getInt("battGroupNum"));
+ binf.setBattGroupName(rs.getString("battGroupName"));
+ /*binf.setBattGroupNum(rs.getInt("battGroupNum"));
+ binf.setFloatVolLevel(rs.getFloat("floatVolLevel"));
+ binf.setOfflineVolLevel(rs.getFloat("offlineVolLevel"));
+ binf.setBattFloatCurrent(rs.getFloat("battFloatCurrent"));*/
+ binf.setMonCount(rs.getInt("monCount"));
+ binf.setMonCapStd(rs.getFloat("monCapStd"));
+ binf.setMonVolStd(rs.getFloat("monVolStd"));
+ binf.setMonResStd(rs.getFloat("monResStd"));
+ binf.setMonSerStd(rs.getFloat("monSerStd"));
+ /*binf.setMonVolLowToAvg(rs.getFloat("monVolLowToAvg"));
+ binf.setBattProducer(rs.getString("battProducer"));
+ binf.setBattModel(rs.getString("battModel"));
+ binf.setBattProductDate(rs.getDate("battProductDate"));
+ binf.setBattInUseDate(rs.getDate("battInUseDate"));
+ binf.setInstall_user(rs.getString("install_user"));*/
+ binf.setLoad_curr(rs.getFloat("load_curr"));
+
+ binf.setDisCurrMax(rs.getFloat("disCurrMax"));
+ /*binf.setStation_phone(rs.getString("station_phone"));
+ binf.setStation_install(rs.getInt("station_install"));*/
+
+
+ binf.setStationName9(rs.getString("dev_version"));
+ list.add(binf);
+ }
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return list;
+ }
+ });
+ /*//鍘绘帀limit鏉′欢鍚庣殑鎬绘暟
+ int number=LimitNumberFactory.GetLimtitNumber(conn, numberSql);
+ //System.out.println("number: "+number);
+ if(list!=null&&list.size()>0){
+ list.get(list.size()-1).setNum(number);
+ }*/
+ return list;
+ }
+ //鎵归噺璁剧疆鏀剧數鍙傛暟鏃讹紝鏍规嵁鐪佸競鍖猴紝鐢垫睜鍗曚綋鍨嬪彿锛堜紡鏁帮級锛岀粍鏁扮瓫閫夊嚭鐢垫睜缁�
+ public List serchByBatt_param(Object obj) {
+ BattInf binf=(BattInf) obj;
+ //Page page=binf.getPage();
+ /*Connection conn=DBUtil.getConn();
+ String numberSql=" SELECT FOUND_ROWS() number";SQL_CALC_FOUND_ROWS*/
+ String sql=" select distinct(db_battinf.tb_battinf.StationId),StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationIp,FBSDeviceId,"
+ + "FBSDeviceName,battGroupNum" +
+ ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,Load_curr,DisCurrMax,montmpstd,floatVolLevel,offlineVolLevel,battFloatCurrent"
+ + ",db_ram_db.tb_fbs9100_state.dev_version "
+ + " from db_battinf.tb_battinf,db_ram_db.tb_fbs9100_state "
+ + " where db_battinf.tb_battinf.FBSDeviceId=db_ram_db.tb_fbs9100_state.dev_id "
+ + " and MonVolStd=? and Station_install=1 ";
+ //+ " limit ?,? ";StationName1 like ? and StationName2 like ? and StationName3 like ? and StationName5 like ? "
+ //,(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%",
+ //鏉′欢
+ String sql0=" and db_battinf.tb_battinf.stationid=? "; //鍏蜂綋鏈烘埧
+ String sql1=" and stationname1=? ";//鐪�
+ String sql2=" and stationname2=? ";//甯�
+ String sql5=" and stationname5=? ";//鍖哄幙
+ switch (binf.getNum()) {
+ case 0:
+ sql+=sql0;
+ break;
+ case 1:
+ sql+=sql1;
+ break;
+ case 2:
+ sql+=sql2;
+ break;
+ case 5:
+ sql+=sql5;
+ break;
+ default:
+ return null;
+ }
+
+ //鎺掑簭
+ String orderSql=" order by StationId asc,GroupIndexInFBSDevice asc ";
+ sql+=orderSql;
+ List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[] {binf.getMonVolStd(),binf.getStationName()}, new CallBack() {
+
+ @Override
+ public List getResults(ResultSet rs) {
+ List list=new ArrayList();
+ try {
+ while(rs.next()) {
+ BattInf binf = new BattInf();
+ binf.setNum(0);
+ binf.setStationId(rs.getString("stationId"));
+ binf.setStationName(rs.getString("stationName"));
+ binf.setStationName1(rs.getString("stationName1"));
+ binf.setStationName2(rs.getString("stationName2"));
+ binf.setStationName3(rs.getString("stationName3"));
+ binf.setStationName4(rs.getString("stationName4"));
+ binf.setStationName5(rs.getString("stationName5"));
+ binf.setStationIp(rs.getString("stationIp"));
+ binf.setFBSDeviceId(rs.getInt("fBSDeviceId"));
+
+ /*binf.setFbsDeviceIp(rs.getString("fbsDeviceIp"));
+ binf.setFbsDeviceIp_YM(rs.getString("fbsDeviceIp_YM"));
+ binf.setFbsDeviceIp_WG(rs.getString("fbsDeviceIp_WG"));*/
+ binf.setFBSDeviceName(rs.getString("fBSDeviceName"));
+ binf.setBattGroupNum(rs.getInt("battGroupNum"));
+
+ binf.setFloatVolLevel(rs.getFloat("floatVolLevel"));
+ binf.setOfflineVolLevel(rs.getFloat("offlineVolLevel"));
+ binf.setBattFloatCurrent(rs.getFloat("battFloatCurrent"));
+ binf.setMonCount(rs.getInt("monCount"));
+ binf.setMonCapStd(rs.getFloat("monCapStd"));
+ binf.setMonVolStd(rs.getFloat("monVolStd"));
+ binf.setMonResStd(rs.getFloat("monResStd"));
+ binf.setMonSerStd(rs.getFloat("monSerStd"));
+ binf.setMonTmpStd(rs.getFloat("monTmpStd"));
+ /*binf.setMonVolLowToAvg(rs.getFloat("monVolLowToAvg"));
+ binf.setBattProducer(rs.getString("battProducer"));
+ binf.setBattModel(rs.getString("battModel"));
+ binf.setBattProductDate(rs.getDate("battProductDate"));
+ binf.setBattInUseDate(rs.getDate("battInUseDate"));
+ binf.setInstall_user(rs.getString("install_user"));*/
+ binf.setLoad_curr(rs.getFloat("load_curr"));
+
+ binf.setDisCurrMax(rs.getFloat("disCurrMax"));
+ /*binf.setStation_phone(rs.getString("station_phone"));
+ binf.setStation_install(rs.getInt("station_install"));*/
+
+
+ binf.setStationName9(rs.getString("dev_version"));
+ list.add(binf);
+ }
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return list;
+ }
+ });
+ /*//鍘绘帀limit鏉′欢鍚庣殑鎬绘暟
+ int number=LimitNumberFactory.GetLimtitNumber(conn, numberSql);
+ //System.out.println("number: "+number);
+ if(list!=null&&list.size()>0){
+ list.get(list.size()-1).setNum(number);
+ }*/
+ return list;
+ }
+ //鎵归噺璁剧疆绯荤粺鍙傛暟鏃讹紝鏍规嵁鐪佸競鍖猴紝鐢垫睜鍗曚綋鍨嬪彿锛堜紡鏁帮級锛岀粍鏁扮瓫閫夊嚭鐢垫睜缁�<杩橀渶瑕佽幏鍙栧疄闄呭閲�>
+ public List serchBySys_param(Object obj) {
+ BattInf binf=(BattInf) obj;
+ //Page page=binf.getPage();
+ /*Connection conn=DBUtil.getConn();
+ String numberSql=" SELECT FOUND_ROWS() number";SQL_CALC_FOUND_ROWS*/
+ String sql=" select distinct(tb_battinf.StationId),StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationIp,FBSDeviceId,"
+ + "FBSDeviceName,count(FBSDeviceId) as batt_num" +
+ ",MonCount,monVolStd,monResStd,MonSerStd,Load_curr,DisCurrMax,montmpstd,floatVolLevel,offlineVolLevel,battFloatCurrent"
+ + ",GROUP_CONCAT(tb_battinf.MonCapStd order by groupIndexInFBSDevice separator '/' ) as moncapstds "
+ + ",db_ram_db.tb_fbs9100_state.dev_version"
+ + ",web_site.tb_batt_endurance.real_cap_group1 ,web_site.tb_batt_endurance.real_cap_group2,web_site.tb_batt_endurance.real_cap_group3,web_site.tb_batt_endurance.real_cap_group4 "
+ + " from db_battinf.tb_battinf,db_ram_db.tb_fbs9100_state,web_site.tb_batt_endurance "
+ + " where db_battinf.tb_battinf.FBSDeviceId=db_ram_db.tb_fbs9100_state.dev_id "
+ + " and db_battinf.tb_battinf.FBSDeviceId=web_site.tb_batt_endurance.deviceid "
+ + " and MonVolStd=? and Station_install=1 ";
+ //+ " limit ?,? ";StationName1 like ? and StationName2 like ? and StationName3 like ? and StationName5 like ? "
+ //,(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%",
+ //鏉′欢
+ String sql0=" and db_battinf.tb_battinf.stationid=? "; //鍏蜂綋鏈烘埧
+ String sql1=" and stationname1=? ";//鐪�
+ String sql2=" and stationname2=? ";//甯�
+ String sql5=" and stationname5=? ";//鍖哄幙
+ switch (binf.getNum()) {
+ case 0:
+ sql+=sql0;
+ break;
+ case 1:
+ sql+=sql1;
+ break;
+ case 2:
+ sql+=sql2;
+ break;
+ case 5:
+ sql+=sql5;
+ break;
+ default:
+ return null;
+ }
+
+ //鎺掑簭
+ String orderSql=" GROUP BY FBSDeviceId order by StationId asc,GroupIndexInFBSDevice asc ";
+ sql+=orderSql;
+ //System.out.println(sql);
+ List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[] {binf.getMonVolStd(),binf.getStationName()}, new CallBack() {
+
+ @Override
+ public List getResults(ResultSet rs) {
+ List list=new ArrayList();
+ try {
+ while(rs.next()) {
+ BattInf binf = new BattInf();
+ binf.setNum(0);
+ binf.setStationId(rs.getString("stationId"));
+ binf.setStationName(rs.getString("stationName"));
+ binf.setStationName1(rs.getString("stationName1"));
+ binf.setStationName2(rs.getString("stationName2"));
+ binf.setStationName3(rs.getString("stationName3"));
+ binf.setStationName4(rs.getString("stationName4"));
+ binf.setStationName5(rs.getString("stationName5"));
+ binf.setStationIp(rs.getString("stationIp"));
+ binf.setFBSDeviceId(rs.getInt("fBSDeviceId"));
+
+ /*binf.setFbsDeviceIp(rs.getString("fbsDeviceIp"));
+ binf.setFbsDeviceIp_YM(rs.getString("fbsDeviceIp_YM"));
+ binf.setFbsDeviceIp_WG(rs.getString("fbsDeviceIp_WG"));*/
+ binf.setFBSDeviceName(rs.getString("fBSDeviceName"));
+ binf.setBattGroupNum(rs.getInt("batt_num"));
+
+ binf.setFloatVolLevel(rs.getFloat("floatVolLevel"));
+ binf.setOfflineVolLevel(rs.getFloat("offlineVolLevel"));
+ binf.setBattFloatCurrent(rs.getFloat("battFloatCurrent"));
+ binf.setMonCount(rs.getInt("monCount"));
+ //binf.setMonCapStd(rs.getFloat("monCapStd"));
+
+ binf.setMoncapstds(rs.getString("moncapstds"));
+ binf.setReal_cap_group1(rs.getFloat("real_cap_group1"));
+ binf.setReal_cap_group2(rs.getFloat("real_cap_group2"));
+ binf.setReal_cap_group3(rs.getFloat("real_cap_group3"));
+ binf.setReal_cap_group4(rs.getFloat("real_cap_group4"));
+
+ binf.setMonVolStd(rs.getFloat("monVolStd"));
+ binf.setMonResStd(rs.getFloat("monResStd"));
+ binf.setMonSerStd(rs.getFloat("monSerStd"));
+ binf.setMonTmpStd(rs.getFloat("monTmpStd"));
+ /*binf.setMonVolLowToAvg(rs.getFloat("monVolLowToAvg"));
+ binf.setBattProducer(rs.getString("battProducer"));
+ binf.setBattModel(rs.getString("battModel"));
+ binf.setBattProductDate(rs.getDate("battProductDate"));
+ binf.setBattInUseDate(rs.getDate("battInUseDate"));
+ binf.setInstall_user(rs.getString("install_user"));*/
+ binf.setLoad_curr(rs.getFloat("load_curr"));
+
+ binf.setDisCurrMax(rs.getFloat("disCurrMax"));
+ /*binf.setStation_phone(rs.getString("station_phone"));
+ binf.setStation_install(rs.getInt("station_install"));*/
+
+
+ binf.setStationName9(rs.getString("dev_version"));
+ list.add(binf);
+ }
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return list;
+ }
+ });
+ /*//鍘绘帀limit鏉′欢鍚庣殑鎬绘暟
+ int number=LimitNumberFactory.GetLimtitNumber(conn, numberSql);
+ //System.out.println("number: "+number);
+ if(list!=null&&list.size()>0){
+ list.get(list.size()-1).setNum(number);
+ }*/
+ return list;
+ }
public static void main(String[] args) throws ParseException {
//new BattInfImpl().searchAll();
BattInfImpl biml = new BattInfImpl();
BattInf binf = new BattInf();
- binf.setBattGroupId(1000967);
- binf.setStationName("鍐呰挋鍙�");
- binf.setStationName1("鍐呰挋鍙�");
-
+ binf.setNum(0);
+ binf.setBattGroupId(1000001);
+ binf.setStationName("42000611");
+ binf.setStationName1("");
+ binf.setStationName2("");
+ binf.setStationName3("");
+ binf.setStationName5("");
+ binf.setBattGroupName("");
+ binf.setBattProducer("1");
+ binf.setStationId("42000575");
+ binf.setGroupIndexInFBSDevice(0);
+ binf.setMonVolStd(12f);
User_inf uinf=new User_inf();
uinf.setUId(1002);
@@ -3511,11 +4753,31 @@
//List<BattInf> list = biml.serchByConditionNew(bmd);
//List<BattInf> list=biml.serchByTestType(bmd);
//List<BattInf> list=biml.serchGroupAssess(bmd);
- List<BattInf> list=biml.serchByMonNum(binf);
+ //List<BattInf> list=biml.serchMakeGroup(binf);
+ //List<BattInf> list=biml.serchGroupByInfor(binf);
+ //List<BattInf> list=biml.searchInform1(bmd);
+ //<BattInf> list=biml.serchStationName5(binf);
+ /*List<BattInf> list=biml.serchBattAllInfoByStationId(binf);
+ //List<BattInf> list=biml.searchInform_ky();
for (BattInf b : list) {
System.out.println(b);
}
- System.out.println(list.size());
+ System.out.println(list.size());*/
+ /*int nums=biml.serchByInstall_count(uinf);
+ System.out.println(nums);*/
+ /*boolean bl=biml.judgeBattInOrNot(binf);
+ System.out.println(bl);*/
+ List<BattInf> list=biml.serchBySys_param(binf);
+ for (BattInf b : list) {
+ System.out.println(b);
+ }
+ /*List<BattInf> list=biml.serchByDischarge(binf);
+ for (BattInf b : list) {
+ System.out.println(b);
+ }*/
+ /*List list=biml.judgeBatt(binf);
+ System.out.println(list);*/
+ //System.out.println(list.size());
}
public List getResults(ResultSet rs) {
@@ -3549,7 +4811,7 @@
binf.setBattProducer(rs.getString("battProducer"));
binf.setBattProductDate(rs.getDate("battProductDate"));
binf.setBattInUseDate(rs.getDate("battInUseDate"));
-
+
//minf.setFault_type(rs.getString("fault_type"));
if (rs.getString("maint_done_time") != null)
mainf.setMaint_done_time(DAOHelper.sdf.parse(rs
--
Gitblit v1.9.1