From dd9f51a22e389ea8b70d56d031972f4c54ff8bce Mon Sep 17 00:00:00 2001 From: 星伟 <星伟@192.168.10.27> Date: 星期日, 30 九月 2018 10:35:52 +0800 Subject: [PATCH] 电池组配组加电池组名称 --- gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 54 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..4c076cd 100644 --- a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java +++ b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java @@ -29,6 +29,7 @@ import com.fgkj.dto.Batt_Maint_Dealarm; import com.fgkj.dto.Batt_maint_inf; import com.fgkj.dto.Batt_maintenance_inf; +import com.fgkj.dto.Batttestdata; import com.fgkj.dto.Batttestdata_inf; import com.fgkj.dto.Batttestdatastop; import com.fgkj.dto.Limit; @@ -354,6 +355,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 +382,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 +3326,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 +3362,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(); @@ -3470,6 +3479,48 @@ return nums; } + + //鐢垫睜閰嶇粍绠$悊(閲嶈) + public List serchMakeGroup(Object obj){ + BattInf binf=(BattInf) obj; + String sql="SELECT distinct BattGroupId,battgroupname,stationid,stationname1,stationname2,stationname,stationname3,BattProducer,MonVolStd,MonCapStd,monCount from db_battinf.tb_battinf where stationname2 like ? "; + //閫変腑鍝佺墝涓�鑷� + String producerSqlT=" order by BattProducer,MonCapStd,MonVolStd ";//涓�鑷� + String producerSqlF=" order by MonCapStd,MonVolStd ";//涓嶄竴鑷� + if(binf.getBattProducer().equals("1")){ + sql+=producerSqlT; + }else{ + sql+=producerSqlF; + } + List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName2()+"%"}, new CallBack() { + + public List getResults(ResultSet rs) { + List list=new ArrayList(); + try { + while(rs.next()){ + BattInf binf=new BattInf(); + binf.setBattGroupId(rs.getInt("battGroupId")); + binf.setBattGroupName(rs.getString("battGroupName")); + binf.setStationId(rs.getString("stationId")); + binf.setStationName(rs.getString("stationName")); + binf.setStationName1(rs.getString("stationName1")); + binf.setStationName2(rs.getString("stationName2")); + binf.setStationName3(rs.getString("stationName3")); + binf.setBattProducer(rs.getString("battProducer")); + binf.setMonVolStd(rs.getFloat("monVolStd")); + binf.setMonCapStd(rs.getFloat("monCapStd")); + binf.setMonCount(rs.getInt("monCount")); + list.add(binf); + } + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return list; + } + }); + return list; + } public static void main(String[] args) throws ParseException { //new BattInfImpl().searchAll(); -- Gitblit v1.9.1