whyclj
2019-10-29 1c0469e45346d464e0c5672ee68f9ecd4fb6be7c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
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;
            }
        });
    }
 
}