| | |
| | | public List serchByDischarge(Object obj) {
|
| | | BattInf binf=(BattInf) obj;
|
| | | Page page=binf.getPage();
|
| | | Connection conn=DBUtil.getConn();
|
| | | String numberSql=" SELECT FOUND_ROWS() number";
|
| | | /*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 "
|
| | | + " limit ?,? ";
|
| | | List<BattInf> list=DAOHelper.executeQueryLimit(sql, conn, new Object[] {"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationName5()+"%",binf.getGroupIndexInFBSDevice(),binf.getMonVolStd(),(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, 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) {
|
| | |
| | | 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;
|
| | | }
|
| | |
|
| | |
| | |
|
| | | BattInfImpl biml = new BattInfImpl();
|
| | | BattInf binf = new BattInf();
|
| | | binf.setNum(1002);
|
| | | binf.setNum(2);
|
| | | binf.setBattGroupId(1000001);
|
| | | binf.setStationName("广西省-百色-GX百色乐业县立新小区WF-BTS设备");
|
| | | binf.setStationName("百色");
|
| | | binf.setStationName1("");
|
| | | binf.setStationName2("百色");
|
| | | binf.setStationName3("");
|