| | |
| | | });
|
| | | return list;
|
| | | }
|
| | | |
| | | //查询battinf中最大的battgroupid
|
| | | //查询出当前存在内存中最大的电池组id(很重要**********)
|
| | | 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 static void main(String[] args) throws ParseException {
|
| | | //new BattInfImpl().searchAll();
|
| | |
|