From 4e306fce80d8063681e0bec04210ca82eccf322e Mon Sep 17 00:00:00 2001
From: 81041 <81041@192.168.10.23>
Date: 星期二, 27 十一月 2018 15:39:11 +0800
Subject: [PATCH] 加2v12v

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

diff --git a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
index b5ff2d0..0586a20 100644
--- a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
+++ b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
@@ -1083,11 +1083,11 @@
 	public int serchByDeviceId(Object obj){
 		User_inf uinf=(User_inf) obj;
 		String sql=" SELECT COUNT(DISTINCT fbsdeviceid) number FROM db_battinf.tb_battinf  " +
-				    " left outer join db_user.tb_user_battgroup_baojigroup_battgroup on db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId=db_battinf.tb_battinf.BattGroupId " +
-					" 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 db_battinf.tb_battinf.Station_install=1 " +
-				    " limit 1";
+				   " 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 db_battinf.tb_battinf.station_install=1";
 		List<BattInf> list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() {
 			
 			public List getResults(ResultSet rs) {
@@ -1120,7 +1120,7 @@
 					" 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=?  " +
-				    " limit 1";
+				    " limit 1 ";
 		List<BattInf> list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() {
 			
 			public List getResults(ResultSet rs) {

--
Gitblit v1.9.1