| | |
| | | + "FBSDeviceName,GroupIndexInFBSDevice,battgroupId,BattGroupNum,BattGroupName,FloatVolLevel,OfflineVolLevel,BattFloatCurrent" +
|
| | | ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,MonVolLowToAvg,BattProducer,BattModel,BattProductDate,BattInUseDate " +
|
| | | " From db_battinf.tb_battinf " +
|
| | | " Where StationName like ? and StationName1 like ? " +
|
| | | " Where StationName like ? and StationName1 like ? and StationName2 like ? " +
|
| | | " order by StationId " +
|
| | | " limit ?,?";
|
| | | List<BattInf> list=DAOHelper.executeQueryLimit(sql,conn, new Object[]{"%"+binf.getStationName()+"%","%"+binf.getStationName1()+"%",(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()},new CallBack() {
|
| | | List<BattInf> list=DAOHelper.executeQueryLimit(sql,conn, new Object[]{"%"+binf.getStationName()+"%","%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%",(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()},new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List list = new ArrayList<BattInf>();
|
| | |
| | | " and db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " +
|
| | | " and db_user.tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " +
|
| | | " and db_user.tb_user_inf.uid=? " +
|
| | | " and db_battinf.tb_battinf.stationname1 like ? and db_battinf.tb_battinf.stationname like ?)";
|
| | | " and db_battinf.tb_battinf.stationname1 like ? and db_battinf.tb_battinf.stationname like ? and db_battinf.tb_battinf.stationname2 like ? )";
|
| | | baseSql+=userSql;
|
| | | String endSql=" order by StationName1 asc,db_battinf.tb_battinf.BattgroupId asc ";
|
| | | sql=baseSql+endSql;
|
| | | String limitSql=" limit ?,? ";
|
| | | sql+=limitSql;
|
| | | //System.out.println(sql);
|
| | | List<BattInf> list = DAOHelper.executeQueryLimit(sql,conn,new Object[] {binf.getBattGroupId(),uinf.getUId(),"%"+binf.getStationName1()+"%","%"+binf.getStationName()+"%",(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()},
|
| | | List<BattInf> list = DAOHelper.executeQueryLimit(sql,conn,new Object[] {binf.getBattGroupId(),uinf.getUId(),"%"+binf.getStationName1()+"%","%"+binf.getStationName()+"%","%"+binf.getStationName2()+"%",(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()},
|
| | | new CallBack() {
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | |
| | | " and db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " +
|
| | | " and db_user.tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " +
|
| | | " and db_user.tb_user_inf.uid=? " +
|
| | | " and db_battinf.tb_battinf.stationname1 like ? and db_battinf.tb_battinf.stationname like ?)";
|
| | | " and db_battinf.tb_battinf.stationname1 like ? and db_battinf.tb_battinf.stationname like ? and db_battinf.tb_battinf.stationname2 like ?)";
|
| | | baseSql+=userSql;
|
| | | //排序
|
| | | String endSql=" order by db_battinf.tb_battinf.battgroupid asc ";
|
| | |
| | | sql=baseSql+endSql+limitSql;
|
| | | //System.out.println(sql);
|
| | | List<BattInf> list=DAOHelper.executeQueryLimit(sql,conn, new Object[]{
|
| | | binf.getBattGroupId(),uinf.getUId(),"%"+binf.getStationName1()+"%","%"+binf.getStationName()+"%",
|
| | | binf.getBattGroupId(),uinf.getUId(),"%"+binf.getStationName1()+"%","%"+binf.getStationName()+"%","%"+binf.getStationName2()+"%",
|
| | | (page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | |
| | | " and db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " +
|
| | | " and db_user.tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " +
|
| | | " and db_user.tb_user_inf.uid=? " +
|
| | | " and db_battinf.tb_battinf.stationname1 like ? and db_battinf.tb_battinf.stationname like ?)";
|
| | | " and db_battinf.tb_battinf.stationname1 like ? and db_battinf.tb_battinf.stationname like ? and db_battinf.tb_battinf.stationname2 like ?)";
|
| | | baseSql+=userSql;
|
| | | //充电放电选择
|
| | | String test_typeA="";//全部
|
| | |
| | | //System.out.println(sql);
|
| | | List<BattInf> list=DAOHelper.executeQuery(sql,DBUtil.getConn(), new Object[]{
|
| | | tinf.getRecord_time(),tinf.getRecord_time1()
|
| | | ,binf.getBattGroupId(),uinf.getUId(),"%"+binf.getStationName1()+"%","%"+binf.getStationName()+"%"
|
| | | ,binf.getBattGroupId(),uinf.getUId(),"%"+binf.getStationName1()+"%","%"+binf.getStationName()+"%","%"+binf.getStationName2()+"%"
|
| | | }, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | |
| | |
|
| | | }
|
| | |
|
| | | //查询所有的机房
|
| | | //查询所有的省份(左侧导航第一层,查所有的省份,num中存放uid)
|
| | | public List serchAllStation(Object obj){
|
| | | User_inf uinf=(User_inf) obj;
|
| | | String sql="select DISTINCT stationid,StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationName6,StationName7,StationName8,StationName9,fBSDeviceId " +
|
| | | BattInf binf=(BattInf) obj;;
|
| | | String sql="select DISTINCT StationName1 " +
|
| | | " FROM db_battinf.tb_battinf " +
|
| | | " where 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=?" +
|
| | | " )";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()},new CallBack() {
|
| | | " ) ORDER BY CONVERT( StationName1 USING gbk ) COLLATE gbk_chinese_ci ASC";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getNum()},new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | | String conStr="-";//连接机房名称的符号
|
| | | try {
|
| | | while(rs.next()){
|
| | | BattInf batt = new BattInf();
|
| | | String stationName="";
|
| | | if(!rs.getString("StationName1").trim().equals("")){
|
| | | stationName+=rs.getString("StationName1");
|
| | | try {
|
| | | while(rs.next()){
|
| | | BattInf batt = new BattInf();
|
| | | batt.setStationName1(rs.getString("stationName1"));
|
| | | list.add(batt);
|
| | | }
|
| | | if(!rs.getString("StationName2").trim().equals("")){
|
| | | stationName+=conStr;
|
| | | stationName+=rs.getString("StationName2");
|
| | | }
|
| | | if(!rs.getString("StationName3").trim().equals("")){
|
| | | stationName+=conStr;
|
| | | stationName+=rs.getString("StationName3");
|
| | | }
|
| | | if(!rs.getString("StationName4").trim().equals("")){
|
| | | stationName+=conStr;
|
| | | stationName+=rs.getString("StationName4");
|
| | | }
|
| | | if(!rs.getString("StationName5").trim().equals("")){
|
| | | stationName+=conStr;
|
| | | stationName+=rs.getString("StationName5");
|
| | | }
|
| | | if(!rs.getString("StationName6").trim().equals("")){
|
| | | stationName+=conStr;
|
| | | stationName+=rs.getString("StationName6");
|
| | | }
|
| | | if(!rs.getString("StationName7").trim().equals("")){
|
| | | stationName+=conStr;
|
| | | stationName+=rs.getString("StationName7");
|
| | | }
|
| | | if(!rs.getString("StationName8").trim().equals("")){
|
| | | stationName+=conStr;
|
| | | stationName+=rs.getString("StationName8");
|
| | | }
|
| | | if(!rs.getString("StationName9").trim().equals("")){
|
| | | stationName+=conStr;
|
| | | stationName+=rs.getString("StationName9");
|
| | | }
|
| | | batt.setStationName(stationName);
|
| | | batt.setStationId(rs.getString("StationId"));
|
| | | batt.setFBSDeviceId(rs.getInt("fBSDeviceId"));
|
| | | list.add(batt);
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | return list;
|
| | | }
|
| | | } );
|
| | | return list;
|
| | | }
|
| | | //根据机房id查询机房下的电池组信息
|
| | | |
| | | //查询管理的市(左侧导航第二层,查所有的市,num中存放uid)
|
| | | public List serchStationName2(Object obj){
|
| | | BattInf binf=(BattInf) obj;
|
| | | String sql="select DISTINCT StationName1,StationName2 " +
|
| | | " FROM db_battinf.tb_battinf " +
|
| | | " where 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=?" +
|
| | | " ) 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;
|
| | | }
|
| | | //查询管理的机房(左侧导航第三层,查所有的机房,num中存放uid)
|
| | | public List serchStationName3(Object obj){
|
| | | BattInf binf=(BattInf) obj;
|
| | | String sql="select DISTINCT StationName1,StationName2,StationName3,stationid,fbsdeviceid " +
|
| | | " FROM db_battinf.tb_battinf " +
|
| | | " where 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=?" +
|
| | | " ) and StationName1 like ? and StationName2 like ? " +
|
| | | " ORDER BY CONVERT( StationName3 USING gbk ) COLLATE gbk_chinese_ci ASC ";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getNum(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%"},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"));
|
| | | batt.setStationName3(rs.getString("stationName3"));
|
| | | batt.setStationId(rs.getString("stationId"));
|
| | | 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)
|
| | | public List serchBattByStation(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 stationid=? " +
|
| | | "ORDER BY StationName1,battgroupId ";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(),new Object[]{binf.getStationId()},new CallBack() {
|
| | | "from db_battinf.tb_battinf where StationName1 like ? and StationName2 like ? and StationName3 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 ";
|
| | | //System.out.println(sql);
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(),new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationId()+"%",binf.getNum()},new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List list = new ArrayList();
|
| | | String conStr="-";//连接机房名称的符号
|
| | | try {
|
| | | while (rs.next()) {
|
| | | BattInf batt = new BattInf();
|
| | |
| | |
|
| | | BattInfImpl biml = new BattInfImpl();
|
| | | BattInf binf = new BattInf();
|
| | | binf.setBattGroupId(0);
|
| | | binf.setBattGroupId(1000967);
|
| | | binf.setStationName("内蒙古");
|
| | | binf.setStationName1("内蒙古");
|
| | |
|
| | |
| | | bmd.setUinf(uinf);
|
| | | //List<BattInf> list = biml.serchByConditionNew(bmd);
|
| | | //List<BattInf> list=biml.serchByTestType(bmd);
|
| | | List<BattInf> list=biml.serchGroupAssess(bmd);
|
| | | //List<BattInf> list=biml.serchGroupAssess(bmd);
|
| | | List<BattInf> list=biml.serchByMonNum(binf);
|
| | | for (BattInf b : list) {
|
| | | System.out.println(b);
|
| | | }
|