From 6f15ff9f459ac08777fbc01995238e3ac4a700b0 Mon Sep 17 00:00:00 2001
From: hdw <496960745@qq.com>
Date: 星期一, 22 十月 2018 10:23:06 +0800
Subject: [PATCH] Merge branch 'dev_lxw' of https://whychdw@gitlab.com/whyclxw1/gx_tieta.git into dev_lxw

---
 gx_tieta/src/com/fgkj/dao/impl/Bts_station_eventImpl.java        |   29 +++++++--
 gx_tieta/src/com/fgkj/actions/Bts_station_eventAction.java       |    5 +
 gx_tieta/src/com/fgkj/services/ram/Bts_station_stateService.java |    7 ++
 gx_tieta/src/com/fgkj/actions/BattInfAction.java                 |    4 +
 gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java                  |   23 +++++--
 gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java    |   37 +++++++++---
 gx_tieta/src/com/fgkj/dao/impl/Batt_enduranceImpl.java           |   12 +++
 gx_tieta/src/com/fgkj/actions/Batt_enduranceAction.java          |    3 +
 gx_tieta/src/com/fgkj/actions/ram/Bts_station_stateAction.java   |   10 +++
 gx_tieta/src/com/fgkj/servlets/ExportTableServlet.java           |   22 +++++--
 10 files changed, 122 insertions(+), 30 deletions(-)

diff --git a/gx_tieta/src/com/fgkj/actions/BattInfAction.java b/gx_tieta/src/com/fgkj/actions/BattInfAction.java
index af20d32..512861a 100644
--- a/gx_tieta/src/com/fgkj/actions/BattInfAction.java
+++ b/gx_tieta/src/com/fgkj/actions/BattInfAction.java
@@ -329,6 +329,8 @@
 	//鐢垫睜閰嶇粍绠$悊(閲嶈)
 	public String serchMakeGroup(){
 		BattInf binf=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class);
+		User_inf uinf=(User_inf) getUser();
+		binf.setNum(uinf.getUId());
 		ServiceModel model = service.serchMakeGroup(binf);
 		result = ActionUtil.tojson(model);
 		return SUCCESS;
@@ -336,6 +338,8 @@
 	//鐢垫睜閰嶇粍绠$悊(閲嶈)
 	public String serchGroupByInfor(){
 		BattInf binf=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class);
+		User_inf uinf=(User_inf) getUser();
+		binf.setNum(uinf.getUId());
 		ServiceModel model = service.serchGroupByInfor(binf);
 		result = ActionUtil.tojson(model);
 		return SUCCESS;
diff --git a/gx_tieta/src/com/fgkj/actions/Batt_enduranceAction.java b/gx_tieta/src/com/fgkj/actions/Batt_enduranceAction.java
index 2ac9952..32b90d3 100644
--- a/gx_tieta/src/com/fgkj/actions/Batt_enduranceAction.java
+++ b/gx_tieta/src/com/fgkj/actions/Batt_enduranceAction.java
@@ -2,6 +2,7 @@
 
 import com.fgkj.dto.Batt_endurance;
 import com.fgkj.dto.ServiceModel;
+import com.fgkj.dto.User_inf;
 import com.fgkj.services.Batt_enduranceService;
 
 public class Batt_enduranceAction extends ActionUtil{
@@ -12,6 +13,8 @@
 	//缁埅鏃堕棿鐨勬煡璇�
 	public String serchByCondition() {
 		Batt_endurance bendurance=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Batt_endurance.class);
+		User_inf uinf=(User_inf) getUser();
+		bendurance.setNum(uinf.getUId());
 		ServiceModel model=service.serchByCondition(bendurance);
 		result=tojson(model);
 		return SUCCESS;
diff --git a/gx_tieta/src/com/fgkj/actions/Bts_station_eventAction.java b/gx_tieta/src/com/fgkj/actions/Bts_station_eventAction.java
index b65ea75..cc71771 100644
--- a/gx_tieta/src/com/fgkj/actions/Bts_station_eventAction.java
+++ b/gx_tieta/src/com/fgkj/actions/Bts_station_eventAction.java
@@ -5,6 +5,7 @@
 import com.fgkj.dto.BattInf;
 import com.fgkj.dto.Bts_station_event;
 import com.fgkj.dto.ServiceModel;
+import com.fgkj.dto.User_inf;
 import com.fgkj.services.Batt_devalarm_data_historyService;
 import com.fgkj.services.Bts_station_eventService;
 
@@ -17,6 +18,8 @@
 	//鏈烘埧浜嬩欢缁熻
 	public String serchByCondition(){
 		BattInf binf=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class);
+		User_inf uinf=(User_inf) getUser();
+		binf.setNum(uinf.getUId());
 		ServiceModel model=service.serchByCondition(binf);
 		result=tojson(model);
 		return SUCCESS;
@@ -24,6 +27,8 @@
 	//鏈烘埧浜嬩欢缁熻
 	public String serchByInfo(){
 		Bts_station_event bevent=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Bts_station_event.class);
+		User_inf uinf=(User_inf) getUser();
+		bevent.setNum(uinf.getUId());
 		ServiceModel model=service.serchByInfo(bevent);
 		result=tojson(model);
 		return SUCCESS;
diff --git a/gx_tieta/src/com/fgkj/actions/ram/Bts_station_stateAction.java b/gx_tieta/src/com/fgkj/actions/ram/Bts_station_stateAction.java
index d9b5ec5..a3acfa2 100644
--- a/gx_tieta/src/com/fgkj/actions/ram/Bts_station_stateAction.java
+++ b/gx_tieta/src/com/fgkj/actions/ram/Bts_station_stateAction.java
@@ -3,6 +3,7 @@
 import com.fgkj.actions.ActionUtil;
 import com.fgkj.dto.BattInf;
 import com.fgkj.dto.ServiceModel;
+import com.fgkj.dto.User_inf;
 import com.fgkj.services.ram.Bts_station_stateService;
 
 public class Bts_station_stateAction extends ActionUtil{
@@ -12,10 +13,19 @@
     //鏌ヨ鏈烘埧瀹炴椂鐘舵��
     public String serchByCondition(){
     	BattInf binf=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class);
+    	User_inf uinf=(User_inf) getUser();
+    	binf.setNum(uinf.getUId());
     	ServiceModel model=service.serchByCondition(binf);
     	result=tojson(model);
     	return SUCCESS;
     }
+  //鏌ヨ褰撳墠鏈烘埧鍋滅數鏁�
+    public String serchByState(){
+    	User_inf uinf=(User_inf) getUser();
+    	ServiceModel model=service.serchByState(uinf);
+    	result=tojson(model);
+    	return SUCCESS;
+    }
     
     
     
diff --git a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
index 3767a63..b8f8349 100644
--- a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
+++ b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
@@ -3628,7 +3628,12 @@
 				" from db_battinf.tb_battinf " +
 				" left outer join (select * from db_battinf.tb_battinf_rebuild where tb_battinf_rebuild.rebuild_clear_type=1 ) as battinf_re " +
 				" on BattGroupId=battinf_re.new_battgroupid or BattGroupId=battinf_re.old_battgroupid " +
-				" where stationname2 like ? ";
+				" where stationname2 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;
 		//閫変腑鍝佺墝涓�鑷�
 		String producerSqlT=" order by BattProducer,MonCapStd,MonVolStd,BattGroupId ";//涓�鑷�
 		String producerSqlF=" order by MonCapStd,MonVolStd,BattGroupId ";//涓嶄竴鑷�
@@ -3637,7 +3642,7 @@
 		}else{
 			sql+=producerSqlF;
 		}
-		List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName2()+"%"}, new CallBack() {
+		List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName2()+"%",binf.getNum()}, new CallBack() {
 			
 			public List getResults(ResultSet rs) {
 				List<BattInf> list=new ArrayList();
@@ -3704,7 +3709,12 @@
 				" left outer join (select * from db_battinf.tb_battinf_rebuild where tb_battinf_rebuild.rebuild_clear_type=1 ) as battinf_re " +
 				" on BattGroupId=battinf_re.new_battgroupid or BattGroupId=battinf_re.old_battgroupid " +
 				" where stationname1 like ? and stationname2 like ? and stationname3 like ?  and battgroupname like ?  and battgroupid=? ";
-		List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getBattGroupName()+"%",binf.getBattGroupId()}, new CallBack() {
+		//鐢ㄦ埛绠$悊
+		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;
+		List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getBattGroupName()+"%",binf.getBattGroupId(),binf.getNum()}, new CallBack() {
 			
 			public List getResults(ResultSet rs) {
 				List<BattInf> list=new ArrayList();
@@ -3769,11 +3779,12 @@
 		
 		BattInfImpl biml = new BattInfImpl();
 		BattInf binf = new BattInf();
+		binf.setNum(1002);
 		binf.setBattGroupId(1000001);
 		binf.setStationName("");
 		binf.setStationName1("");
 		binf.setStationName2("");
-		binf.setStationName3("姝︽眽婧愭殺瀹為獙瀹�1");
+		binf.setStationName3("");
 		binf.setBattGroupName("");
 		binf.setBattProducer("1");
 		User_inf uinf=new User_inf();
@@ -3800,8 +3811,8 @@
 		//List<BattInf> list = biml.serchByConditionNew(bmd);
 		//List<BattInf> list=biml.serchByTestType(bmd);
 		//List<BattInf> list=biml.serchGroupAssess(bmd);
-		//List<BattInf> list=biml.serchMakeGroup(binf);
-		List<BattInf> list=biml.serchGroupByInfor(binf);
+		List<BattInf> list=biml.serchMakeGroup(binf);
+		//List<BattInf> list=biml.serchGroupByInfor(binf);
 		for (BattInf b : list) {
 			System.out.println(b);
 		}
diff --git a/gx_tieta/src/com/fgkj/dao/impl/Batt_enduranceImpl.java b/gx_tieta/src/com/fgkj/dao/impl/Batt_enduranceImpl.java
index 0357c75..d2daeb3 100644
--- a/gx_tieta/src/com/fgkj/dao/impl/Batt_enduranceImpl.java
+++ b/gx_tieta/src/com/fgkj/dao/impl/Batt_enduranceImpl.java
@@ -50,7 +50,14 @@
 		String sql="select SQL_CALC_FOUND_ROWS distinct tb_batt_endurance.num,tb_batt_endurance.deviceid,tb_batt_endurance.stationid,real_cap,tb_batt_endurance.moncapstd,real_curr,endurance_theory_timelong,endurance_actual_timelong,is_out_stand " +
 				",db_battinf.tb_battinf.StationName,db_battinf.tb_battinf.StationName1,db_battinf.tb_battinf.StationName2 " +
 				" from web_site.tb_batt_endurance,db_battinf.tb_battinf " +
-				" where tb_batt_endurance.stationid=db_battinf.tb_battinf.stationid " ;
+				" where tb_batt_endurance.stationid=db_battinf.tb_battinf.stationid "+
+				"  and tb_batt_endurance.stationid 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=?  ) " ;
 		//鏈烘埧绛涢��
 		String stationSql=" and db_battinf.tb_battinf.StationName like ? and db_battinf.tb_battinf.StationName1 like ? and db_battinf.tb_battinf.StationName2 like ?";
 		sql+=stationSql;
@@ -79,7 +86,7 @@
 		
 		
 		//System.out.println(sql);
-		List<Batt_endurance> list=DAOHelper.executeQueryLimit(sql, conn, new Object[]{"%"+bendurance.getStationName()+"%","%"+bendurance.getStationName1()+"%","%"+bendurance.getStationName2()+"%",bendurance.getEndurance_actual_timelong(),bendurance.getIs_out_stand()
+		List<Batt_endurance> list=DAOHelper.executeQueryLimit(sql, conn, new Object[]{bendurance.getNum(),"%"+bendurance.getStationName()+"%","%"+bendurance.getStationName1()+"%","%"+bendurance.getStationName2()+"%",bendurance.getEndurance_actual_timelong(),bendurance.getIs_out_stand()
 			                            ,(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, new CallBack() {
 			
 			public List getResults(ResultSet rs) {
@@ -125,6 +132,7 @@
 	public static void main(String[] args) {
 		Batt_enduranceImpl bimpl=new Batt_enduranceImpl();
 		Batt_endurance ben=new Batt_endurance();
+		ben.setNum(1002);
 		ben.setStationName("");
 		ben.setStationName1("");
 		ben.setStationName2("");
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 cb3f729..288bc51 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
@@ -57,6 +57,13 @@
 		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 " +
 				" 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  record_datetime>=?  and  record_datetime<=?  " +
 				" and stationname1 like ? and stationname2 like  ? and stationname3 like ? and stationid like ? " ;
 		/*//浜嬩欢绛涢��
@@ -74,7 +81,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.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.getStationId()+"%"}, new CallBack() {
 			
 			public List getResults(ResultSet rs) {
 				List list=new ArrayList();
@@ -300,6 +307,13 @@
 		String sql="select  distinct station_id,dev_id,station_event_type,record_datetime,station_event_trig ,tb_battinf.StationName,tb_battinf.StationName1,tb_battinf.StationName2,tb_battinf.StationName3 " +
 				" 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 dev_id=?  " +
 				" and  record_datetime>=?  and  record_datetime<=? ";
 		//鍩虹珯鐘舵��
@@ -318,7 +332,7 @@
 		//sql+=limitSql;
 		//,(p.getPageCurr()-1)*p.getPageSize(),p.getPageSize()
 		//executeQueryLimit
-		List<Bts_station_event> list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{bevent.getDev_id(),bevent.getRecord_datetime(),bevent.getRecord_datetime_end(),bevent.getStation_event_type()}, new CallBack() {
+		List<Bts_station_event> list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{bevent.getNum(),bevent.getDev_id(),bevent.getRecord_datetime(),bevent.getRecord_datetime_end(),bevent.getStation_event_type()}, new CallBack() {
 			
 			public List getResults(ResultSet rs) {
 				List list=new ArrayList();
@@ -371,7 +385,7 @@
 		
 		
 		BattInf binf = new BattInf();
-		binf.setNum(0);
+		binf.setNum(1002);
 	    binf.setStationName("");
 		binf.setStationName1("");
 		binf.setStationName2("");
@@ -387,12 +401,13 @@
 		bmd.setPage(p);
 		bmd.setBinf(binf);
         bmd.setUinf(uinf);
-       /* List<Bts_station_event> list=bimpl.serchByCondition(binf);
+        List<Bts_station_event> list=bimpl.serchByCondition(binf);
         System.out.println(list.size());
         for (Bts_station_event b : list) {
 			System.out.println(b.getNote()+" "+b.getDev_id()+" "+b.getStation_event_type_poff()+" "+b.getStation_event_type_xuhang()+" "+b.getStation_event_type_fadian()+" "+b.getStation_event_type_diaozhan()+" "+b.getStation_event_type_dooropen()+" "+b.getStation_event_type_tempup()+" "+b.getStation_event_type_templow()+" "+b.getStation_event_type_dampup()+" "+b.getStation_event_type_damplow()+" "+b.getStationName());
-		}*/
+		}
         Bts_station_event b=new Bts_station_event();
+        b.setNum(1002);
         b.setDev_id(910000001);
         b.setRecord_datetime(ActionUtil.getSimpDate(date1));
         b.setRecord_datetime_end(ActionUtil.getSimpDate(date2));
@@ -401,8 +416,8 @@
         page.setPageCurr(1);
         page.setPageSize(10);
         b.setPage(page);
-        List list=bimpl.serchByInfo(b);
-        System.out.println(list.size());
+        /*List list=bimpl.serchByInfo(b);
+        System.out.println(list.size());*/
 	}
 
 }
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 008fde0..d1bd387 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
@@ -10,9 +10,11 @@
 import com.fgkj.dao.CallBack;
 import com.fgkj.dao.DAOHelper;
 import com.fgkj.dao.LimitNumberFactory;
+import com.fgkj.dao.UinfDaoFactory;
 import com.fgkj.db.DBUtil;
 import com.fgkj.dto.BattInf;
 import com.fgkj.dto.Page;
+import com.fgkj.dto.User_inf;
 import com.fgkj.dto.ram.Bts_station_state;
 
 public class Bts_station_stateImpl implements BaseDAO,CallBack{
@@ -52,10 +54,16 @@
 				   " ,tb_battinf.stationname,tb_battinf.stationname1,tb_battinf.stationname2,tb_battinf.stationname3 " +
 				   " 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=db_battinf.tb_battinf.StationId  " +
+				   "  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 ?  limit ? ,? ";
-		List<Bts_station_state> list=DAOHelper.executeQueryLimit(sql, conn, new Object[]{"%"+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.getNum(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationId()+"%",(p.getPageCurr()-1)*p.getPageSize(),p.getPageSize()},new CallBack() {
 			
 			public List getResults(ResultSet rs) {
 				List list=new ArrayList();
@@ -112,9 +120,17 @@
 		return list;
 	}
     //鏌ヨ褰撳墠鏈烘埧鍋滅數鏁�
-	public int serchByState() {
-		String sql=" select count(*) as nums from db_ram_db.tb_bts_station_state where station_stat&2>1  ";
-		List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), null, new CallBack() {
+	public int serchByState(Object obj) {
+		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_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=?  ) " ;
+		List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() {
 			
 			public List getResults(ResultSet rs) {
 				List list=new ArrayList();
@@ -142,21 +158,24 @@
 	public static void main(String[] args) {
 		Bts_station_stateImpl bimpl=new Bts_station_stateImpl();
 		BattInf binf=new BattInf();
+		binf.setNum(1002);
 		binf.setStationName1("");
 		binf.setStationName2("");
 		binf.setStationName3("");
 		binf.setStationId("");
+		User_inf uinf=new User_inf();
+		uinf.setUId(1002);
 		Page p=new Page();
 		p.setPageCurr(1);
 		p.setPageSize(1);
 		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);
-		}*/
-		int nums=bimpl.serchByState();
-		System.out.println(nums);
+		}
+		/*int nums=bimpl.serchByState(uinf);
+		System.out.println(nums);*/
 	}
 
 	
diff --git a/gx_tieta/src/com/fgkj/services/ram/Bts_station_stateService.java b/gx_tieta/src/com/fgkj/services/ram/Bts_station_stateService.java
index 31ed580..10eec0b 100644
--- a/gx_tieta/src/com/fgkj/services/ram/Bts_station_stateService.java
+++ b/gx_tieta/src/com/fgkj/services/ram/Bts_station_stateService.java
@@ -4,6 +4,7 @@
 
 import com.fgkj.dao.BaseDAO;
 import com.fgkj.dao.BaseDAOFactory;
+import com.fgkj.dao.impl.ram.Bts_station_stateImpl;
 import com.fgkj.dto.ServiceModel;
 
 public class Bts_station_stateService {
@@ -28,5 +29,11 @@
 		}
 		return model;	
 	}
+	//鏌ヨ褰撳墠鏈烘埧鍋滅數鏁�
+	public ServiceModel serchByState(Object obj) {
+		int nums=((Bts_station_stateImpl)dao).serchByState(obj);
+		model.setNewsum(nums);
+		return model;	
+	}
 
 }
diff --git a/gx_tieta/src/com/fgkj/servlets/ExportTableServlet.java b/gx_tieta/src/com/fgkj/servlets/ExportTableServlet.java
index c255d3b..93dcf64 100644
--- a/gx_tieta/src/com/fgkj/servlets/ExportTableServlet.java
+++ b/gx_tieta/src/com/fgkj/servlets/ExportTableServlet.java
@@ -136,8 +136,8 @@
 		String exp_thead_str = req.getParameter("exp_thead");
 		String exp_tbody_str = req.getParameter("exp_tbody");
 		
-		String exp_page_break = req.getParameter("exp_page_break");
-		String exp_data_break = req.getParameter("exp_data_break");
+		String exp_page_break = "\\"+req.getParameter("exp_page_break");
+		String exp_data_break = "\\"+req.getParameter("exp_data_break");
 		
 		String exp_page_names_str =  req.getParameter("exp_page_names");
 		
@@ -160,18 +160,20 @@
 				exp_page_names = exp_page_names_str.split(exp_page_break);			//鍒嗗壊宸ヤ綔绨跨殑鍚嶇О
 				
 				String[] exp_thead_sheets = exp_thead_str.split(exp_page_break);
-				String[] exp_tbody_sheets = exp_tbody_str.split(exp_page_break);		
+				String[] exp_tbody_sheets = exp_tbody_str.split(exp_page_break);	
+				
 				
 				for (int i = 0; i < exp_page_names.length && exp_page_names.length >= exp_thead_sheets.length; i++) {
-					HSSFSheet sheet = workbook.createSheet(excelTitle);
+					HSSFSheet sheet = workbook.createSheet(exp_page_names[i]);
 					String[] exp_thead = exp_thead_sheets[i].split(exp_data_break);
 					String[] exp_tbody = exp_tbody_sheets[i].split(exp_data_break);
 					
 					int maxColNum = exp_thead.length;			//鏈�澶у垪鏁�
 					int nowRowNum = 0;							//褰撳墠琛�
 					int nowColNum = 0;							//褰撳墠鍒�
+					HSSFRow row = null;
 					for(int j=0;j <= exp_tbody.length;j++){
-						HSSFRow row = null;
+						//System.out.println("j="+j+"\t nowRowNum="+nowRowNum);
 						if(j == 0){
 							row = sheet.createRow(nowRowNum++); 
 							for(int k=0;k<exp_thead.length;k++){	
@@ -187,6 +189,7 @@
 						}
 						HSSFCell cell = row.createCell(nowColNum++);
 						HSSFRichTextString text = new HSSFRichTextString(exp_tbody[j-1]);
+						//HSSFRichTextString text = new HSSFRichTextString("*****");
 						//System.out.print(text+"\t");
 						cell.setCellValue(text);						
 					}					
@@ -197,6 +200,8 @@
 					+ new String(excelName.getBytes("gb2312"), "ISO8859-1")
 					+ ".xls");
 			OutputStream out = resp.getOutputStream();
+			workbook.write(out);
+			out.close();
 		} catch (UnsupportedEncodingException e) {
 			e.printStackTrace();
 		} catch (IOException e) {
@@ -418,5 +423,10 @@
        
 	}
 	
-	
+	public static void main(String[] args) {
+		String ths = "h1&h2&h3&h4$xh1&xh2&xh3&xh4";
+		System.out.println(ths.indexOf("$"));
+		String[] sheets = ths.split("\\&");
+		System.out.println(sheets.length);
+	}
 }

--
Gitblit v1.9.1