From 35fefed0792c40cb99b8d15fa5811bbb5992bff9 Mon Sep 17 00:00:00 2001
From: D:/workspace/chenjingjing/git/gx_tieta/gx_tieta/.gitignore <chenjingjing@LAPTOP-E51P2139>
Date: 星期一, 21 一月 2019 10:42:24 +0800
Subject: [PATCH] 修改

---
 gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java |   64 ++++++++++++++++++++++++++-----
 1 files changed, 53 insertions(+), 11 deletions(-)

diff --git a/gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java b/gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java
index dff7238..0df18be 100644
--- a/gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java
+++ b/gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java
@@ -56,7 +56,7 @@
 				   " from db_ram_db.tb_bts_station_state,db_battinf.tb_battinf  " +
 				   " where  tb_bts_station_state.dev_id=db_battinf.tb_battinf.FBSDeviceId  " +
 				   " and tb_battinf.stationname1 like ? and tb_battinf.stationname2 like ? and tb_battinf.stationname3 like ?  and tb_battinf.stationname5 like ?   " +
-				   " and stationid like ? " ;
+				   " and stationid like ? and Station_install=1 " ;
 				   /*"  and tb_bts_station_state.station_id in (" +
 				   "  select distinct db_battinf.tb_battinf.stationid  " +
 				   "  from db_battinf.tb_battinf " +
@@ -184,8 +184,12 @@
 		User_inf uinf=(User_inf) obj;
 		String sql=" select count(*) as nums from db_ram_db.tb_bts_station_state where station_stat&2>1  " +
 				   "  and tb_bts_station_state.station_id  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=?" +
-				" ) ";
+				   "  select distinct db_battinf.tb_battinf.stationid  " +
+				   "  from db_battinf.tb_battinf " +
+				   "  left outer join db_user.tb_user_battgroup_baojigroup_battgroup on db_user.tb_user_battgroup_baojigroup_battgroup.stationid=db_battinf.tb_battinf.stationid " +
+				   "  left outer join db_user.tb_user_battgroup_baojigroup_usr on db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " +
+				   "  left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " +
+				   "  where db_user.tb_user_inf.uid=? and  Station_install=1 ) ";
 		List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() {
 			
 			public List getResults(ResultSet rs) {
@@ -212,8 +216,12 @@
 		User_inf uinf=(User_inf) obj;
 		String sql=" select count(*) as nums from db_ram_db.tb_bts_station_state where station_stat&32>1  " +
 				   "  and tb_bts_station_state.station_id 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=?" +
-				" ) ";
+				   "  select distinct db_battinf.tb_battinf.stationid  " +
+				   "  from db_battinf.tb_battinf " +
+				   "  left outer join db_user.tb_user_battgroup_baojigroup_battgroup on db_user.tb_user_battgroup_baojigroup_battgroup.stationid=db_battinf.tb_battinf.stationid " +
+				   "  left outer join db_user.tb_user_battgroup_baojigroup_usr on db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " +
+				   "  left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " +
+				   "  where db_user.tb_user_inf.uid=? and  Station_install=1 ) ";
 		List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() {
 			
 			public List getResults(ResultSet rs) {
@@ -293,6 +301,40 @@
 		}
 		return nums;
 	}
+	 
+	//鏌ヨ璁惧SD鍗$殑瀹炴椂鐘舵��
+	public int serchSDCard(Object obj) {
+		BattInf binf=(BattInf) obj;
+		String sql=" select distinct station_stat from  db_ram_db.tb_bts_station_state where station_id=? ";
+		List list=DAOHelper.executeQuery(sql, DBUtil.getConn(),new Object[] {binf.getStationId()} , new CallBack() {
+			
+			@Override
+			public List getResults(ResultSet rs) {
+				List list=new ArrayList();
+				try {
+					while(rs.next()) {
+						int station_stat=rs.getInt("station_stat");
+						if((station_stat&2048)>1) {
+							list.add(1);
+						}else {
+							list.add(0);
+						}
+					}
+				} catch (SQLException e) {
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
+				return list;
+			}
+		});
+		int station_stat=1;
+		if(list!=null&&list.size()>0) {
+			station_stat=(int) list.get(list.size()-1);
+		}
+		return station_stat;
+	}
+	
+
 	public List serchByInfo(Object obj) {
 		// TODO Auto-generated method stub
 		return null;
@@ -305,7 +347,7 @@
 		binf.setStationName2("");
 		binf.setStationName3("");
 		binf.setStationName5("");
-		binf.setStationId("");
+		binf.setStationId("42000408");
 		binf.setBattGroupNum(62);
 		User_inf uinf=new User_inf();
 		uinf.setUId(1002);
@@ -313,11 +355,11 @@
 		p.setPageCurr(1);
 		p.setPageSize(10);
 		binf.setPage(p);
-		List<Bts_station_state> list=bimpl.serchByCondition(binf);
+		/*List<Bts_station_state> list=bimpl.serchByCondition(binf);
 		for (Bts_station_state bs : list) {
 			//System.out.println(bs.getStation_stat_diaozhan()+"  "+bs.getStation_stat_dooropen()+"  "+bs.getStation_stat_fadian()+"   "+bs.getStation_stat_xuhang()+"  "+bs.getStation_stat_poff());
 		    System.out.println(bs);
-		}
+		}*/
 		//System.out.println(list.size());
 		//int nums=bimpl.serchByState(uinf);
 		/*BattMap_information bm=new BattMap_information();
@@ -326,9 +368,9 @@
 		//int nums=bimpl.serchByState_diaozhan(uinf);
 		/*BattMap_information bm=new BattMap_information();
 		bm.setStationId("42000366");
-		int nums=bimpl.serchByStationId_diaozhan(bm);
-		
-		System.out.println(nums);*/
+		int nums=bimpl.serchByStationId_diaozhan(bm);*/
+		int station_state=bimpl.serchSDCard(binf);
+		System.out.println(station_state);
 	}
 
 	

--
Gitblit v1.9.1