From 880eaffb3557deb7da44b32a637b61125655115c Mon Sep 17 00:00:00 2001 From: 星伟 <星伟@192.168.10.24> Date: 星期五, 28 九月 2018 14:33:45 +0800 Subject: [PATCH] 电池续航时间查询后台修改 --- gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java index 80f497e..855d1e8 100644 --- a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java +++ b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java @@ -354,6 +354,14 @@ }else{ baseSql+=station1SqlF; } + //鐢ㄤ簬缁存姢鍖� + String station2SqlT=" and stationname2!=? ";//鍏ㄩ儴 + String station2SqlF=" and stationname2=? "; + if(binf.getStationName2().equals("")){ + baseSql+=station2SqlT; + }else{ + baseSql+=station2SqlF; + } //鐢ㄤ簬鏈烘埧绔欑偣 String stationSqlT=" and stationname!=? ";//鍏ㄩ儴 String stationSqlF=" and stationname=? "; @@ -373,7 +381,7 @@ String endSql=" order by stationid "; sql=baseSql+endSql; //System.out.println(sql); - List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getStationName1(),binf.getStationName(),binf.getBattGroupId()}, new CallBack() { + List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getStationName1(),binf.getStationName2(),binf.getStationName(),binf.getBattGroupId()}, new CallBack() { public List getResults(ResultSet rs) { List list=new ArrayList(); @@ -3317,7 +3325,7 @@ try { while(rs.next()){ BattInf batt = new BattInf(); - batt.setStationName1(rs.getString("stationName")); + batt.setStationName(rs.getString("stationName")); batt.setStationName1(rs.getString("stationName1")); batt.setStationName2(rs.getString("stationName2")); batt.setStationName3(rs.getString("stationName3")); @@ -3353,7 +3361,7 @@ //鎺掑簭 String orderSql=" ORDER BY StationName1,battgroupId "; //System.out.println(sql); - List list=DAOHelper.executeQuery(sql, DBUtil.getConn(),new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationId()+"%",binf.getNum()},new CallBack() { + List list=DAOHelper.executeQuery(sql, DBUtil.getConn(),new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName()+"%","%"+binf.getStationId()+"%",binf.getNum()},new CallBack() { public List getResults(ResultSet rs) { List list = new ArrayList(); -- Gitblit v1.9.1