From 3ea3e6ac0db260b46aa262bc2ab33d8ab8860b86 Mon Sep 17 00:00:00 2001 From: hdw <496960745@qq.com> Date: 星期一, 29 十月 2018 14:36:24 +0800 Subject: [PATCH] Merge branch 'dev_lxw' of https://whychdw@gitlab.com/whyclxw1/gx_tieta.git into dev_lxw --- gx_tieta/src/com/fgkj/dao/impl/Bts_station_eventImpl.java | 48 +++++++++++++++++++++++++++++++++--------------- 1 files changed, 33 insertions(+), 15 deletions(-) diff --git a/gx_tieta/src/com/fgkj/dao/impl/Bts_station_eventImpl.java b/gx_tieta/src/com/fgkj/dao/impl/Bts_station_eventImpl.java index a689c13..288bc51 100644 --- a/gx_tieta/src/com/fgkj/dao/impl/Bts_station_eventImpl.java +++ b/gx_tieta/src/com/fgkj/dao/impl/Bts_station_eventImpl.java @@ -57,6 +57,13 @@ String sql="select station_id,dev_id,station_event_type,record_datetime,station_event_trig ,tb_battinf.StationName,tb_battinf.StationName1,tb_battinf.StationName2,tb_battinf.StationName3 " + " from db_alarm.tb_bts_station_event,db_battinf.tb_battinf " + " where tb_bts_station_event.dev_id=tb_battinf.FBSDeviceId " + + " and tb_bts_station_event.station_id in (" + + " select distinct db_battinf.tb_battinf.stationid " + + " from db_battinf.tb_battinf " + + " left outer join db_user.tb_user_battgroup_baojigroup_battgroup on db_user.tb_user_battgroup_baojigroup_battgroup.stationid=db_battinf.tb_battinf.stationid " + + " left outer join db_user.tb_user_battgroup_baojigroup_usr on db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " + + " 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=? ) " + " and record_datetime>=? and record_datetime<=? " + " and stationname1 like ? and stationname2 like ? and stationname3 like ? and stationid like ? " ; /*//浜嬩欢绛涢�� @@ -73,8 +80,8 @@ //鎺掑簭 String orderSql=" order by station_id,record_datetime,station_event_type asc "; sql+=orderSql; - System.err.println(sql); - List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getBattInUseDate(),binf.getBattInUseDate1(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationId()+"%"}, new CallBack() { + //System.err.println(sql); + List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getNum(),binf.getBattInUseDate(),binf.getBattInUseDate1(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationId()+"%"}, new CallBack() { public List getResults(ResultSet rs) { List list=new ArrayList(); @@ -294,11 +301,19 @@ public List serchByInfo(Object obj) { Bts_station_event bevent=(Bts_station_event) obj; Page p=bevent.getPage(); - Connection conn=DBUtil.getConn(); - String numberSql=" SELECT FOUND_ROWS() number"; - String sql="select SQL_CALC_FOUND_ROWS distinct station_id,dev_id,station_event_type,record_datetime,station_event_trig ,tb_battinf.StationName,tb_battinf.StationName1,tb_battinf.StationName2,tb_battinf.StationName3 " + + //Connection conn=DBUtil.getConn(); + //String numberSql=" SELECT FOUND_ROWS() number"; + //SQL_CALC_FOUND_ROWS + String sql="select distinct station_id,dev_id,station_event_type,record_datetime,station_event_trig ,tb_battinf.StationName,tb_battinf.StationName1,tb_battinf.StationName2,tb_battinf.StationName3 " + " from db_alarm.tb_bts_station_event,db_battinf.tb_battinf " + " where tb_bts_station_event.dev_id=tb_battinf.FBSDeviceId " + + " and tb_bts_station_event.station_id in (" + + " select distinct db_battinf.tb_battinf.stationid " + + " from db_battinf.tb_battinf " + + " left outer join db_user.tb_user_battgroup_baojigroup_battgroup on db_user.tb_user_battgroup_baojigroup_battgroup.stationid=db_battinf.tb_battinf.stationid " + + " left outer join db_user.tb_user_battgroup_baojigroup_usr on db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " + + " 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=? ) " + " and dev_id=? " + " and record_datetime>=? and record_datetime<=? "; //鍩虹珯鐘舵�� @@ -313,9 +328,11 @@ String orderSql=" order by station_id,station_event_type,record_datetime,station_event_trig asc " ; sql+=orderSql; //鍒嗛〉 - String limitSql=" limit ?,? "; - sql+=limitSql; - List<Bts_station_event> list=DAOHelper.executeQueryLimit(sql, conn, new Object[]{bevent.getDev_id(),bevent.getRecord_datetime(),bevent.getRecord_datetime_end(),bevent.getStation_event_type(),(p.getPageCurr()-1)*p.getPageSize(),p.getPageSize()}, new CallBack() { + //String limitSql=" limit ?,? "; + //sql+=limitSql; + //,(p.getPageCurr()-1)*p.getPageSize(),p.getPageSize() + //executeQueryLimit + List<Bts_station_event> list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{bevent.getNum(),bevent.getDev_id(),bevent.getRecord_datetime(),bevent.getRecord_datetime_end(),bevent.getStation_event_type()}, new CallBack() { public List getResults(ResultSet rs) { List list=new ArrayList(); @@ -339,12 +356,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).getPage().setPageAll(number); - } + }*/ return list; } public static void main(String[] args) throws ParseException { @@ -368,7 +385,7 @@ BattInf binf = new BattInf(); - binf.setNum(0); + binf.setNum(1002); binf.setStationName(""); binf.setStationName1(""); binf.setStationName2(""); @@ -384,12 +401,13 @@ bmd.setPage(p); bmd.setBinf(binf); bmd.setUinf(uinf); - /* List<Bts_station_event> list=bimpl.serchByCondition(binf); + List<Bts_station_event> list=bimpl.serchByCondition(binf); System.out.println(list.size()); for (Bts_station_event b : list) { System.out.println(b.getNote()+" "+b.getDev_id()+" "+b.getStation_event_type_poff()+" "+b.getStation_event_type_xuhang()+" "+b.getStation_event_type_fadian()+" "+b.getStation_event_type_diaozhan()+" "+b.getStation_event_type_dooropen()+" "+b.getStation_event_type_tempup()+" "+b.getStation_event_type_templow()+" "+b.getStation_event_type_dampup()+" "+b.getStation_event_type_damplow()+" "+b.getStationName()); - }*/ + } Bts_station_event b=new Bts_station_event(); + b.setNum(1002); b.setDev_id(910000001); b.setRecord_datetime(ActionUtil.getSimpDate(date1)); b.setRecord_datetime_end(ActionUtil.getSimpDate(date2)); @@ -398,8 +416,8 @@ page.setPageCurr(1); page.setPageSize(10); b.setPage(page); - List list=bimpl.serchByInfo(b); - System.out.println(list.size()); + /*List list=bimpl.serchByInfo(b); + System.out.println(list.size());*/ } } -- Gitblit v1.9.1