星伟
2018-10-09 b0433dbdf74457deed81b44767513baa55d4ae73
包机组中4层筛选
3个文件已修改
222 ■■■■■ 已修改文件
gx_tieta/src/com/fgkj/actions/BattInfAction.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java 135 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/src/com/fgkj/services/BattInfServices.java 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gx_tieta/src/com/fgkj/actions/BattInfAction.java
@@ -258,12 +258,28 @@
        result = ActionUtil.tojson(model);
        return SUCCESS;
    }
    //查询所有的省份(左侧导航第一层,查所有的省份)
    public String serchAllStation_all(){
        User_inf u = (User_inf)getUser();
        BattInf binf=new BattInf();
        binf.setNum(u.getUId());
        ServiceModel model = service.serchAllStation_all(binf);
        result = ActionUtil.tojson(model);
        return SUCCESS;
    }
    //查询管理的市(左侧导航第二层,查所有的市,num中存放uid)
    public String serchStationName2(){
        User_inf u = (User_inf)getUser();
        BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
        binf.setNum(u.getUId());
        ServiceModel model = service.serchStationName2(binf);
        result = ActionUtil.tojson(model);
        return SUCCESS;
    }
    //查询管理的市(左侧导航第二层,查所有的市)
    public String serchStationName2_all(){
        BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
        ServiceModel model = service.serchStationName2_all(binf);
        result = ActionUtil.tojson(model);
        return SUCCESS;
    }
@@ -276,6 +292,13 @@
        result = ActionUtil.tojson(model);
        return SUCCESS;
    }
    //查询管理的机房(左侧导航第三层,查所有的机房)
    public String serchStationName3_all(){
        BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
        ServiceModel model = service.serchStationName3_all(binf);
        result = ActionUtil.tojson(model);
        return SUCCESS;
    }
    //根据机房id查询机房下的电池组信息(左侧导航第四层,根据机房查询下面的电池组,num中存放uid)
    public String serchBattByStation(){
        BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
@@ -286,6 +309,14 @@
        result = ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").toJson(model);
        return SUCCESS;
    }
    //根据机房id查询机房下的电池组信息(左侧导航第四层,根据机房查询下面的电池组)
    public String serchBattByStation_all(){
        BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
        //System.out.println(binf);
        ServiceModel model = service.serchBattByStation_all(binf);
        result = ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").toJson(model);
        return SUCCESS;
    }
    
    //查询所有的电池组数
    public String serchAllBatt(){
gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
@@ -3280,6 +3280,31 @@
        } );
        return list;
    }
    //查询所有的省份(左侧导航第一层,查所有的省份)
    public List serchAllStation_all(Object obj){
        BattInf binf=(BattInf) obj;;
        String sql="select DISTINCT StationName1 " +
                " FROM db_battinf.tb_battinf " +
                " ORDER BY CONVERT( StationName1 USING gbk ) COLLATE gbk_chinese_ci ASC";
        List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), null,new CallBack() {
            public List getResults(ResultSet rs) {
                List list=new ArrayList();
                    try {
                        while(rs.next()){
                            BattInf batt = new BattInf();
                            batt.setStationName1(rs.getString("stationName1"));
                            list.add(batt);
                        }
                    } catch (SQLException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                return list;
            }
        } );
        return list;
    }
    
    //查询管理的市(左侧导航第二层,查所有的市,num中存放uid)
    public List serchStationName2(Object obj){
@@ -3291,6 +3316,33 @@
                " ) and StationName1 like ? " +
                " ORDER BY CONVERT( StationName2 USING gbk ) COLLATE gbk_chinese_ci ASC ";
        List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getNum(),"%"+binf.getStationName1()+"%"},new CallBack() {
            public List getResults(ResultSet rs) {
                List list=new ArrayList();
                    try {
                        while(rs.next()){
                            BattInf batt = new BattInf();
                            batt.setStationName1(rs.getString("stationName1"));
                            batt.setStationName2(rs.getString("stationName2"));
                            list.add(batt);
                        }
                    } catch (SQLException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                return list;
            }
        } );
        return list;
    }
    //查询管理的市(左侧导航第二层,查所有的市)
    public List serchStationName2_all(Object obj){
        BattInf binf=(BattInf) obj;
        String sql="select DISTINCT StationName1,StationName2  " +
                " FROM db_battinf.tb_battinf " +
                " where StationName1 like ? " +
                " ORDER BY CONVERT( StationName2 USING gbk ) COLLATE gbk_chinese_ci ASC ";
        List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName1()+"%"},new CallBack() {
            
            public List getResults(ResultSet rs) {
                List list=new ArrayList();
@@ -3344,6 +3396,38 @@
        } );
        return list;
    }
    //查询管理的机房(左侧导航第三层,查所有的机房)
    public List serchStationName3_all(Object obj){
        BattInf binf=(BattInf) obj;
        String sql="select DISTINCT StationName,StationName1,StationName2,StationName3,stationid,fbsdeviceid,FBSDeviceName  " +
                " FROM db_battinf.tb_battinf " +
                " where StationName1 like ? and StationName2 like ?  " +
                " ORDER BY CONVERT( StationName USING gbk ) COLLATE gbk_chinese_ci ASC ";
        List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%"},new CallBack() {
            public List getResults(ResultSet rs) {
                List list=new ArrayList();
                    try {
                        while(rs.next()){
                            BattInf batt = new BattInf();
                            batt.setStationName(rs.getString("stationName"));
                            batt.setStationName1(rs.getString("stationName1"));
                            batt.setStationName2(rs.getString("stationName2"));
                            batt.setStationName3(rs.getString("stationName3"));
                            batt.setStationId(rs.getString("stationId"));
                            batt.setFBSDeviceName(rs.getString("fBSDeviceName"));
                            batt.setFBSDeviceId(rs.getInt("fBSDeviceId"));
                            list.add(batt);
                        }
                    } catch (SQLException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                return list;
            }
        } );
        return list;
    }
   
    
    //根据机房id查询机房下的电池组信息(左侧导航第四层,根据机房查询下面的电池组,num中存放uid)
@@ -3361,6 +3445,7 @@
        sql+=userSql;
        //排序
        String orderSql=" ORDER BY StationName1,battgroupId ";
        sql+=orderSql;
        //System.out.println(sql);
        List list=DAOHelper.executeQuery(sql, DBUtil.getConn(),new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName()+"%","%"+binf.getStationId()+"%",binf.getNum()},new CallBack() {
            
@@ -3395,6 +3480,56 @@
        });
        return list;
        }
    //根据机房id查询机房下的电池组信息(左侧导航第四层,根据机房查询下面的电池组,num中存放uid)
    public List serchBattByStation_all(Object obj){
        BattInf binf=(BattInf) obj;
        String sql="select DISTINCT StationName,StationId,StationIP,FBSDeviceId,BattGroupName,BattGroupName1,BattGroupName2,MonCount,battgroupId,MonCapStd,MonVolStd,MonResStd,MonSerStd,BattProducer,BattInUseDate,GroupIndexInFBSDevice " +
                "from db_battinf.tb_battinf  where StationName1 like ? and StationName2 like ?  and  StationName like ?  ";
        //机房id
        String idSqlT=" and  Stationid like ? ";
        sql+=idSqlT;
        //用户管理
        String userSql=" and StationId in(" +
                " select distinct db_user.tb_user_battgroup_baojigroup_battgroup.StationId from db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr where db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id=db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id  and db_user.tb_user_battgroup_baojigroup_usr.uId=?" +
                " ) ";
        //sql+=userSql;
        //排序
        String orderSql=" ORDER BY StationName1,battgroupId ";
        sql+=orderSql;
        //System.out.println(sql);
        List list=DAOHelper.executeQuery(sql, DBUtil.getConn(),new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName()+"%","%"+binf.getStationId()+"%"},new CallBack() {
            public List getResults(ResultSet rs) {
                List list = new ArrayList();
                try {
                    while (rs.next()) {
                        BattInf batt = new BattInf();
                        batt.setStationName(rs.getString("stationName"));
                        batt.setStationId(rs.getString("StationId"));
                        batt.setStationIp(rs.getString("StationIP"));
                        batt.setBattGroupName(rs.getString("BattGroupName").trim());
                        batt.setBattGroupName1(rs.getString("BattGroupName1").trim());
                        batt.setBattGroupName2(rs.getString("BattGroupName2").trim());
                        batt.setFBSDeviceId(rs.getInt("fBSDeviceId"));
                        batt.setMonCount(rs.getInt("MonCount"));
                        batt.setBattGroupId(rs.getInt("battgroupId"));
                        batt.setMonCapStd(rs.getFloat("monCapStd"));
                        batt.setMonVolStd(rs.getFloat("monVolStd"));
                        batt.setMonResStd(rs.getFloat("MonResStd"));
                        batt.setMonSerStd(rs.getFloat("MonSerStd"));
                        batt.setBattProducer(rs.getString("BattProducer"));
                        batt.setBattInUseDate(rs.getDate("BattInUseDate"));
                        batt.setGroupIndexInFBSDevice(rs.getInt("groupIndexInFBSDevice"));
                        list.add(batt);
                    }
                } catch (SQLException e) {
                    e.printStackTrace();
                }
                return list;
            }
        });
        return list;
        }
    //搜索机房或电池组
    public List serchStationOrBattgroup(Object obj){
        final BattInf binf=(BattInf) obj;
gx_tieta/src/com/fgkj/services/BattInfServices.java
@@ -694,9 +694,37 @@
        }
        return model;
    }
    //查询所有的省份(左侧导航第一层,查所有的省份)
    public ServiceModel serchAllStation_all(Object obj){
        List list=((BattInfImpl)dao).serchAllStation_all(obj);
        if (list != null && list.size() > 0) {
            model.setCode(1);
            model.setData(list);
            model.setMsg("查询成功!");
        }else{
            model.setCode(0);
            model.setData(list);
            model.setMsg("查询失败!");
        }
        return model;
    }
    //查询管理的市(左侧导航第二层,查所有的市,num中存放uid)
    public ServiceModel serchStationName2(Object obj){
        List list=((BattInfImpl)dao).serchStationName2(obj);
        if (list != null && list.size() > 0) {
            model.setCode(1);
            model.setData(list);
            model.setMsg("查询成功!");
        }else{
            model.setCode(0);
            model.setData(list);
            model.setMsg("查询失败!");
        }
        return model;
    }
    //查询管理的市(左侧导航第二层,查所有的市)
    public ServiceModel serchStationName2_all(Object obj){
        List list=((BattInfImpl)dao).serchStationName2_all(obj);
        if (list != null && list.size() > 0) {
            model.setCode(1);
            model.setData(list);
@@ -722,6 +750,20 @@
        }
        return model;
    }
    //查询管理的机房(左侧导航第三层,查所有的机房)
    public ServiceModel serchStationName3_all(Object obj){
        List list=((BattInfImpl)dao).serchStationName3_all(obj);
        if (list != null && list.size() > 0) {
            model.setCode(1);
            model.setData(list);
            model.setMsg("查询成功!");
        }else{
            model.setCode(0);
            model.setData(list);
            model.setMsg("查询失败!");
        }
        return model;
    }
    //根据机房id查询机房下的电池组信息(左侧导航第四层,根据机房查询下面的电池组,num中存放uid)
    public ServiceModel serchBattByStation(Object obj){
        List list=((BattInfImpl)dao).serchBattByStation(obj);
@@ -736,6 +778,20 @@
        }
        return model;
    }
    //根据机房id查询机房下的电池组信息(左侧导航第四层,根据机房查询下面的电池组)
    public ServiceModel serchBattByStation_all(Object obj){
        List list=((BattInfImpl)dao).serchBattByStation_all(obj);
        if (list != null && list.size() > 0) {
            model.setCode(1);
            model.setData(list);
            model.setMsg("查询成功!");
        }else{
            model.setCode(0);
            model.setData(list);
            model.setMsg("查询失败!");
        }
        return model;
    }
    //查询所有的电池组数
    public ServiceModel serchAllBatt(Object obj){
        int nums=((BattInfImpl)dao).serchAllBatt(obj);