From ebde1dbead10b06ec0c1639d72be0f716adb2f7d Mon Sep 17 00:00:00 2001
From: CJJ <Administrator@USER-20180117QL>
Date: 星期三, 26 十二月 2018 19:32:35 +0800
Subject: [PATCH] 修改

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

diff --git a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
index b39a55b..2c1cfa9 100644
--- a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
+++ b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java
@@ -4377,13 +4377,38 @@
 	//鎵归噺璁剧疆鏀剧數鍙傛暟鏃讹紝鏍规嵁鐪佸競鍖猴紝鐢垫睜鍗曚綋鍨嬪彿锛堜紡鏁帮級锛岀粍鏁扮瓫閫夊嚭鐢垫睜缁�
 	public List serchByDischarge(Object obj) {
 		BattInf binf=(BattInf) obj;
-		Connection conn=DBUtil.getConn();
-		String numberSql=" SELECT FOUND_ROWS() number";
+		Page page=binf.getPage();
+		/*Connection conn=DBUtil.getConn();
+		String numberSql=" SELECT FOUND_ROWS() number";*/
 		String sql=" select SQL_CALC_FOUND_ROWS * from db_battinf.tb_battinf "
-				+ "  where StationName1 like ? and StationName2 like ? and StationName3 like ? and StationName5 like ? "
-				+ "  and GroupIndexInFBSDevice=?   and MonVolStd=? "
-				+ "  order by StationId asc,GroupIndexInFBSDevice asc ";
-		List<BattInf> list=DAOHelper.executeQueryLimit(sql, conn, new Object[] {"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationName5()+"%",binf.getGroupIndexInFBSDevice(),binf.getMonVolStd()}, new CallBack() {
+				+ "  where "
+				+ "  GroupIndexInFBSDevice=?   and MonVolStd=? ";
+				//+ "  limit ?,? ";StationName1 like ? and StationName2 like ? and StationName3 like ? and StationName5 like ? "
+		//,(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%",
+		//鏉′欢
+		String sql0=" and stationid=? "; //鍏蜂綋鏈烘埧
+		String sql1=" and stationname1=? ";//鐪�
+		String sql2=" and stationname2=? ";//甯�
+		String sql5=" and stationname5=? ";//鍖哄幙
+		switch (binf.getNum()) {
+		case 0:
+			sql+=sql0;
+			break;
+        case 1:
+        	sql+=sql1;
+			break;
+        case 2:
+        	sql+=sql2;
+			break;
+        case 5:
+        	sql+=sql5;
+ 			break;
+		default:
+			return null;
+		}
+		String orderSql="  order by StationId asc,GroupIndexInFBSDevice asc ";
+		sql+=orderSql;
+		List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[] {binf.getGroupIndexInFBSDevice(),binf.getMonVolStd(),binf.getStationName()}, new CallBack() {
 			
 			@Override
 			public List getResults(ResultSet rs) {
@@ -4436,12 +4461,12 @@
 				return list;
 			}
 		});
-		//鍘绘帀limit鏉′欢鍚庣殑鎬绘暟
+		/*//鍘绘帀limit鏉′欢鍚庣殑鎬绘暟
 		int number=LimitNumberFactory.GetLimtitNumber(conn, numberSql);
 		//System.out.println("number: "+number);
 		if(list!=null&&list.size()>0){
 			list.get(list.size()-1).setNum(number);
-		}
+		}*/
 		return list;
 	}
 
@@ -4450,9 +4475,9 @@
 		
 		BattInfImpl biml = new BattInfImpl();
 		BattInf binf = new BattInf();
-		binf.setNum(1002);
+		binf.setNum(2);
 		binf.setBattGroupId(1000001);
-		binf.setStationName("骞胯タ鐪�-鐧捐壊-GX鐧捐壊涔愪笟鍘跨珛鏂板皬鍖篧F-BTS璁惧");
+		binf.setStationName("鐧捐壊");
 		binf.setStationName1("");
 		binf.setStationName2("鐧捐壊");
 		binf.setStationName3("");

--
Gitblit v1.9.1