From 1feaa0cef7764a19c84c33b3c951f41089843f74 Mon Sep 17 00:00:00 2001
From: 81041 <81041@192.168.10.23>
Date: 星期四, 01 十一月 2018 15:19:46 +0800
Subject: [PATCH] 落后单体查询测试

---
 gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java |   28 ++++++++++++++++++----------
 1 files changed, 18 insertions(+), 10 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 0c3c591..11ae092 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
@@ -51,17 +51,24 @@
 		String numberSql="SELECT FOUND_ROWS() number";//瀛樻斁鎬绘暟
 		String sql="select SQL_CALC_FOUND_ROWS distinct station_id,dev_id,record_datetime,station_stat,station_poff_start_time,station_fadian_start_time" +
 				   " ,station_diaozhan_start_time,station_temp,station_damp,station_dooropen_start_time,station_xuhang_start_time" +
-				   " ,tb_battinf.stationname,tb_battinf.stationname1,tb_battinf.stationname2,tb_battinf.stationname3 " +
+				   " ,tb_battinf.stationname,tb_battinf.stationname1,tb_battinf.stationname2,tb_battinf.stationname3,tb_battinf.stationname5 " +
 				   " 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_bts_station_state.station_id in (" +
+				   " and tb_battinf.stationname1 like ? and tb_battinf.stationname2 like ? and tb_battinf.stationname3 like ?  and tb_battinf.stationname5 like ?   " +
+				   " and stationid like ? " ;
+				   /*"  and tb_bts_station_state.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_battinf.stationname1 like ? and tb_battinf.stationname2 like ? and tb_battinf.stationname3 like ? ) " +
-				   " and stationid like ?  " ;
+				   " and stationid like ?  " ;*/
+		//鐢ㄦ埛绠$悊
+		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;
 		if(binf.getBattGroupNum()>1){
 			sql+=" and ( ";
 		}  
@@ -70,7 +77,7 @@
 		if((binf.getBattGroupNum()&32)>1){
 			sql+=diaozhanSql;
 		}
-		if(binf.getBattGroupNum()>32){
+		if((binf.getBattGroupNum()&16)>1&&(binf.getBattGroupNum()>32)){
 			sql+=" or ";
 		}
 		//寮�闂�
@@ -78,7 +85,7 @@
 		if((binf.getBattGroupNum()&16)>1){
 			sql+=dooropenSql;
 		}
-		if(binf.getBattGroupNum()>48){
+		if((binf.getBattGroupNum()&8)>1&&(binf.getBattGroupNum()>16)){
 			sql+=" or ";
 		}
 		//鍙戠數
@@ -86,7 +93,7 @@
 		if((binf.getBattGroupNum()&8)>1){
 			sql+=fadianSql;
 		}
-		if(binf.getBattGroupNum()>56){
+		if((binf.getBattGroupNum()&4)>1&&(binf.getBattGroupNum()>8)){
 			sql+=" or ";
 		}
 		//缁埅
@@ -94,7 +101,7 @@
 		if((binf.getBattGroupNum()&4)>1){
 			sql+=xuhangSql;
 		}
-		if(binf.getBattGroupNum()>60){
+		if((binf.getBattGroupNum()&2)>1&&(binf.getBattGroupNum()>4)){
 			sql+=" or ";
 		}
 		//鍋滅數
@@ -107,13 +114,13 @@
 			sql+=" ) ";
 		}
 		if(binf.getBattGroupNum()==0){
-			sql+=" and station_stat=0 ";
+			sql+=" and station_stat<0 ";			//褰撴病鏈夐�夋嫨鎯宠鏌ョ湅鐨勬満鎴垮紓甯哥姸鎬佹槸绛涢��
 		}
 		//鍒嗛〉
 		String orderSql=" limit ? ,? ";
 		sql+=orderSql;
 		//System.out.println(sql);
-		List<Bts_station_state> list=DAOHelper.executeQueryLimit(sql, conn, new Object[]{binf.getNum(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationId()+"%",(p.getPageCurr()-1)*p.getPageSize(),p.getPageSize()},new CallBack() {
+		List<Bts_station_state> list=DAOHelper.executeQueryLimit(sql, conn, new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationName5()+"%","%"+binf.getStationId()+"%",binf.getNum(),(p.getPageCurr()-1)*p.getPageSize(),p.getPageSize()},new CallBack() {
 			
 			public List getResults(ResultSet rs) {
 				List list=new ArrayList();
@@ -150,6 +157,7 @@
 						b.setStationName1(rs.getString("stationName1"));
 						b.setStationName2(rs.getString("stationName2"));
 						b.setStationName3(rs.getString("stationName3"));
+						b.setStationName5(rs.getString("stationName5"));
 						Page page=new Page();
 						b.setPage(page);
 						list.add(b);
@@ -213,7 +221,7 @@
 		binf.setStationName2("");
 		binf.setStationName3("");
 		binf.setStationId("");
-		binf.setBattGroupNum(0);
+		binf.setBattGroupNum(36);
 		User_inf uinf=new User_inf();
 		uinf.setUId(1002);
 		Page p=new Page();

--
Gitblit v1.9.1