From 897f3d3e41e0918c8f7f31a06d272417500ab24a Mon Sep 17 00:00:00 2001
From: 81041 <81041@192.168.10.23>
Date: 星期四, 01 十一月 2018 09:25:27 +0800
Subject: [PATCH] 机房状态统计查询

---
 gx_tieta/src/com/fgkj/dao/impl/Bts_station_eventImpl.java |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/gx_tieta/src/com/fgkj/dao/impl/Bts_station_eventImpl.java b/gx_tieta/src/com/fgkj/dao/impl/Bts_station_eventImpl.java
index 288bc51..58f2c78 100644
--- a/gx_tieta/src/com/fgkj/dao/impl/Bts_station_eventImpl.java
+++ b/gx_tieta/src/com/fgkj/dao/impl/Bts_station_eventImpl.java
@@ -54,18 +54,14 @@
     //鏈烘埧浜嬩欢缁熻
 	public List serchByCondition(Object obj) {
 		final BattInf binf=(BattInf) obj;
-		String sql="select station_id,dev_id,station_event_type,record_datetime,station_event_trig ,tb_battinf.StationName,tb_battinf.StationName1,tb_battinf.StationName2,tb_battinf.StationName3 " +
+		String sql="select station_id,dev_id,station_event_type,record_datetime,station_event_trig ,tb_battinf.StationName,tb_battinf.StationName1,tb_battinf.StationName2,tb_battinf.StationName3,tb_battinf.StationName5 " +
 				" from db_alarm.tb_bts_station_event,db_battinf.tb_battinf " +
 				" where  tb_bts_station_event.dev_id=tb_battinf.FBSDeviceId " +
-				"  and tb_bts_station_event.station_id in (" +
-			   "  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 tb_bts_station_event.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=?" +
+				" ) " +
 				" and  record_datetime>=?  and  record_datetime<=?  " +
-				" and stationname1 like ? and stationname2 like  ? and stationname3 like ? and stationid like ? " ;
+				" and stationname1 like ? and stationname2 like  ? and stationname3 like ? and stationname5 like ?  and stationid like ? " ;
 		/*//浜嬩欢绛涢��
 		String eventSqlT=" and station_event_type!=? ";
 		String eventSqlF=" and station_event_type=? ";
@@ -81,7 +77,7 @@
 		String orderSql="  order by station_id,record_datetime,station_event_type asc  ";
 		sql+=orderSql;
 		//System.err.println(sql);
-		List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getNum(),binf.getBattInUseDate(),binf.getBattInUseDate1(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationId()+"%"}, new CallBack() {
+		List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getNum(),binf.getBattInUseDate(),binf.getBattInUseDate1(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationName5()+"%","%"+binf.getStationId()+"%"}, new CallBack() {
 			
 			public List getResults(ResultSet rs) {
 				List list=new ArrayList();

--
Gitblit v1.9.1