81041
2019-12-28 9fc51315211b59cf043ceb169ab84cc315f7ec7d
根据设备id查信息的
3个文件已修改
48 ■■■■■ 已修改文件
Device_Manage/src/com/fgkj/actions/BattInfAction.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Device_Manage/src/com/fgkj/dao/impl/BattInfImpl.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Device_Manage/src/com/fgkj/services/BattInfService.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Device_Manage/src/com/fgkj/actions/BattInfAction.java
@@ -30,6 +30,13 @@
        result=tojson(model);
        return SUCCESS;
    }
    //根据设备id查询机房名称
    public String serchByInfo() {
        BattInf binf=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class);
        ServiceModel model=service.serchByInfo(binf);
        result=tojson(model);
        return SUCCESS;
    }
    public String getResult() {
        return result;
    }
Device_Manage/src/com/fgkj/dao/impl/BattInfImpl.java
@@ -156,8 +156,34 @@
        });
        return list;
    }
    //根据设备id查询机房名称
     public List serchByInfo(Object obj) {
        return null;
         BattInf binf=(BattInf) obj;
         String sql="select distinct db_battinf.tb_battinf.FBSDeviceId,stationName3,stationName "
                + " FROM  db_battinf.tb_battinf "
                + " where FBSDeviceId=? ";
        List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getFBSDeviceId()}, new CallBack() {
            @Override
            public List getResults(ResultSet rs) {
                List list=new ArrayList();
                try {
                    while(rs.next()){
                        BattInf binf=new BattInf();
                        binf.setStationName(rs.getString("stationName"));;
                        binf.setStationName3(rs.getString("stationName3"));
                        binf.setFBSDeviceId(rs.getInt("FBSDeviceId"));
                        list.add(binf);
                    }
                } catch (SQLException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                return list;
            }
        });
        return list;
    }
    public static void main(String[] args) {
        BattInfImpl bimpl=new BattInfImpl();
Device_Manage/src/com/fgkj/services/BattInfService.java
@@ -55,4 +55,17 @@
        }
        return model;
    }
    //根据设备id查询机房名称
    public ServiceModel serchByInfo(Object obj) {
        List list=((BattInfImpl)dao).serchByInfo(obj);
        if(list!=null&&list.size()>0){
            model.setCode(1);
            model.setData(list);
            model.setMsg("查询成功");
        }else{
            model.setCode(0);
            model.setMsg("查询失败");
        }
        return model;
    }
}