| | |
| | | Connection conn=DBUtil.getConn();
|
| | | String numberSql=" SELECT FOUND_ROWS() number";
|
| | | 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 " +
|
| | | ",db_battinf.tb_battinf.StationName,db_battinf.tb_battinf.StationName1,db_battinf.tb_battinf.StationName2,db_battinf.tb_battinf.StationName5 " +
|
| | | " from web_site.tb_batt_endurance,db_battinf.tb_battinf " +
|
| | | " where tb_batt_endurance.stationid=db_battinf.tb_battinf.stationid "+
|
| | | " and tb_batt_endurance.stationid in (" +
|
| | |
| | | " 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 ?";
|
| | | String stationSql=" and db_battinf.tb_battinf.StationName like ? and db_battinf.tb_battinf.StationName1 like ? and db_battinf.tb_battinf.StationName2 like ? and db_battinf.tb_battinf.StationName5 like ?";
|
| | | sql+=stationSql;
|
| | | //实际续航时间
|
| | | String timelongSqlT=" and endurance_actual_timelong<=? ";//小于某一时间
|
| | |
| | |
|
| | |
|
| | | //System.out.println(sql);
|
| | | 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()
|
| | | List<Batt_endurance> list=DAOHelper.executeQueryLimit(sql, conn, new Object[]{bendurance.getNum(),"%"+bendurance.getStationName()+"%","%"+bendurance.getStationName1()+"%","%"+bendurance.getStationName2()+"%","%"+bendurance.getStationName5()+"%",bendurance.getEndurance_actual_timelong(),bendurance.getIs_out_stand()
|
| | | ,(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | |
| | | b.setStationName(rs.getString("stationname"));
|
| | | b.setStationName1(rs.getString("stationname1"));
|
| | | b.setStationName2(rs.getString("stationname2"));
|
| | | b.setStationName5(rs.getString("stationname5"));
|
| | | Page p=new Page();
|
| | | b.setPage(p);
|
| | | list.add(b);
|
| | |
| | | private String stationName;
|
| | | private String stationName1;//省级
|
| | | private String stationName2;//市级
|
| | | |
| | | private String stationName5;//区县
|
| | | private Page page;//分页
|
| | | public int getNum() {
|
| | | return num;
|
| | |
| | | public void setPage(Page page) {
|
| | | this.page = page;
|
| | | }
|
| | | public String getStationName5() {
|
| | | return stationName5;
|
| | | }
|
| | | public void setStationName5(String stationName5) {
|
| | | this.stationName5 = stationName5;
|
| | | }
|
| | | @Override
|
| | | public String toString() {
|
| | | return "Batt_endurance [num=" + num + ", deviceId=" + deviceId
|
| | |
| | | + ", endurance_actual_timelong=" + endurance_actual_timelong
|
| | | + ", is_out_stand=" + is_out_stand + ", note=" + note
|
| | | + ", stationName=" + stationName + ", stationName1="
|
| | | + stationName1 + ", stationName2=" + stationName2 + ", page="
|
| | | + page + "]";
|
| | | + stationName1 + ", stationName2=" + stationName2
|
| | | + ", stationName5=" + stationName5 + ", page=" + page + "]";
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | }
|