whyclj
2020-07-22 a5729100cb1eaa3584b3a194e46e1b8b52b3ed1a
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
120
121
122
123
124
125
126
127
128
package com.fgkj.dao.impl;
 
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.db.DBUtil;
import com.fgkj.dto.BattInf;
import com.fgkj.dto.Battinf_ex;
 
public class Battinf_exImpl 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;
    }
    //根据电池组的信息stationid查询
    public List serchByCondition(Object obj) {
        BattInf binf=(BattInf) obj;
        String sql=" select * from db_battinf.tb_battinf_ex where stationId=? ";
        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_ex binf_ex=new Battinf_ex();
                        binf_ex.setNum(rs.getInt("num"));
                        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"));
                        list.add(binf_ex);
                    }
                } catch (SQLException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                return list;
            }
        });
        return list;
    }
 
    public List serchByInfo(Object obj) {
        // TODO Auto-generated method stub
        return null;
    }
    public static void main(String[] args) {
        Battinf_exImpl bimpl=new Battinf_exImpl();
        BattInf binf=new BattInf();
        binf.setStationId("42000001");
        List list=bimpl.serchByCondition(binf);
        System.out.println(list.size());
    }
}