package com.fgkj.dao.impl.Ld9;
|
|
import java.sql.ResultSet;
|
import java.sql.SQLException;
|
import java.util.ArrayList;
|
import java.util.List;
|
|
import com.fgkj.dao.BaseDAO;
|
import com.fgkj.dao.CallBack;
|
import com.fgkj.dao.DAOHelper;
|
import com.fgkj.dao.impl.BatttestdatastopDAOImpl;
|
import com.fgkj.db.DBUtil;
|
import com.fgkj.dto.Batttestdatastop;
|
import com.fgkj.dto.Ld9testdatastop;
|
|
public class Ld9testdatastopImpl implements BaseDAO,CallBack{
|
|
public List getResults(ResultSet rs) {
|
// TODO Auto-generated method stub
|
return null;
|
}
|
|
public boolean add(Object obj) {
|
// TODO Auto-generated method stub
|
return false;
|
}
|
|
public boolean update(Object obj) {
|
// TODO Auto-generated method stub
|
return false;
|
}
|
|
public boolean del(Object obj) {
|
// TODO Auto-generated method stub
|
return false;
|
}
|
|
public List searchAll() {
|
// TODO Auto-generated method stub
|
return null;
|
}
|
|
//历史监测容量的柱状图
|
public List serchByCondition(Object obj) {
|
Ld9testdatastop ld9=(Ld9testdatastop)obj;
|
String sql="select num,BattGroupId,test_record_count,test_type,test_starttime,record_time,test_timelong,group_vol,test_curr,test_cap,mon_num,mon_vol,test_monnum,max_monvol,min_monvol,test_stopreason from db_ld9_testdata.tb_ld9testdatastop_"+ld9.getBattGroupId()+"" +
|
" where test_record_count=?";
|
return DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{ld9.getTest_record_count()}, new CallBack() {
|
public List getResults(ResultSet rs) {
|
List list=new ArrayList();
|
try {
|
while(rs.next()){
|
Ld9testdatastop ld9=new Ld9testdatastop();
|
ld9.setNum(rs.getInt("num"));
|
ld9.setBattGroupId(rs.getInt("BattGroupId"));
|
ld9.setTest_record_count(rs.getInt("test_record_count"));
|
ld9.setTest_type(rs.getInt("test_type"));
|
ld9.setTest_starttime(rs.getTimestamp("test_starttime"));
|
ld9.setRecord_time(rs.getTimestamp("record_time"));
|
ld9.setTest_timelong(rs.getInt("test_timelong"));
|
ld9.setGroup_vol(rs.getFloat("group_vol"));
|
ld9.setTest_curr(rs.getFloat("test_curr"));
|
ld9.setTest_cap(rs.getFloat("test_cap"));
|
ld9.setMon_num(rs.getInt("mon_num"));
|
ld9.setMon_vol(rs.getFloat("mon_vol"));
|
ld9.setTest_monnum(rs.getInt("test_monnum"));
|
ld9.setMax_monvol(rs.getFloat("max_monvol"));
|
ld9.setMin_monvol(rs.getFloat("min_monvol"));
|
ld9.setTest_stopreason(rs.getInt("test_stopreason"));
|
list.add(ld9);
|
//System.out.println(b);
|
}
|
} catch (SQLException e) {
|
e.printStackTrace();
|
}
|
return list;
|
}
|
});
|
}
|
|
//根据电池组id;单体编号,test_record_count查询测试结束的信息
|
public List serchByInfo(Object obj) {
|
Ld9testdatastop ld9=(Ld9testdatastop)obj;
|
String sql="select num,BattGroupId,test_record_count,test_type,test_starttime,record_time,test_timelong,group_vol,test_curr,test_cap,mon_num,mon_vol,test_monnum,max_monvol,min_monvol,test_stopreason from db_ld9_testdata.tb_ld9testdatastop_"+ld9.getBattGroupId()+"" +
|
" where test_record_count=? and test_monnum=?";
|
return DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{ld9.getTest_record_count(),ld9.getTest_monnum()}, new CallBack() {
|
public List getResults(ResultSet rs) {
|
List list=new ArrayList();
|
try {
|
while(rs.next()){
|
Ld9testdatastop ld9=new Ld9testdatastop();
|
ld9.setNum(rs.getInt("num"));
|
ld9.setBattGroupId(rs.getInt("BattGroupId"));
|
ld9.setTest_record_count(rs.getInt("test_record_count"));
|
ld9.setTest_type(rs.getInt("test_type"));
|
ld9.setTest_starttime(rs.getTimestamp("test_starttime"));
|
ld9.setRecord_time(rs.getTimestamp("record_time"));
|
ld9.setTest_timelong(rs.getInt("test_timelong"));
|
ld9.setGroup_vol(rs.getFloat("group_vol"));
|
ld9.setTest_curr(rs.getFloat("test_curr"));
|
ld9.setTest_cap(rs.getFloat("test_cap"));
|
ld9.setMon_num(rs.getInt("mon_num"));
|
ld9.setMon_vol(rs.getFloat("mon_vol"));
|
ld9.setTest_monnum(rs.getInt("test_monnum"));
|
ld9.setMax_monvol(rs.getFloat("max_monvol"));
|
ld9.setMin_monvol(rs.getFloat("min_monvol"));
|
ld9.setTest_stopreason(rs.getInt("test_stopreason"));
|
list.add(ld9);
|
//System.out.println(b);
|
}
|
} catch (SQLException e) {
|
e.printStackTrace();
|
}
|
return list;
|
}
|
});
|
}
|
|
}
|