From 1b78706f50f0a1c50e087c2d7fc4aaa7dd246265 Mon Sep 17 00:00:00 2001 From: 81041 <81041@192.168.10.13> Date: 星期一, 10 十二月 2018 14:29:16 +0800 Subject: [PATCH] 设备连接继续修改 --- gx_tieta/src/com/fgkj/actions/App_bts_comm_taskAction.java | 4 ++-- gx_tieta/src/com/fgkj/dao/impl/App_bts_comm_taskImpl.java | 21 ++++++++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/gx_tieta/src/com/fgkj/actions/App_bts_comm_taskAction.java b/gx_tieta/src/com/fgkj/actions/App_bts_comm_taskAction.java index ea3e9d9..19c5fc4 100644 --- a/gx_tieta/src/com/fgkj/actions/App_bts_comm_taskAction.java +++ b/gx_tieta/src/com/fgkj/actions/App_bts_comm_taskAction.java @@ -17,10 +17,10 @@ //鏍规嵁鐪佸競鍖烘満鎴垮悕绉版煡璇� public String serchByCondition(){ - Page page=getGson("").fromJson(json, Page.class); + BattInf binf=getGson("").fromJson(json, BattInf.class); /*User_inf uinf=(User_inf) getUser(); binf.setNum(uinf.getUId());*/ - ServiceModel model=service.serchByCondition(page); + ServiceModel model=service.serchByCondition(binf); result=tojson(model); return SUCCESS; } diff --git a/gx_tieta/src/com/fgkj/dao/impl/App_bts_comm_taskImpl.java b/gx_tieta/src/com/fgkj/dao/impl/App_bts_comm_taskImpl.java index 97b3cd1..b16cab1 100644 --- a/gx_tieta/src/com/fgkj/dao/impl/App_bts_comm_taskImpl.java +++ b/gx_tieta/src/com/fgkj/dao/impl/App_bts_comm_taskImpl.java @@ -45,15 +45,16 @@ } //鏍规嵁鐪佸競鍖烘満鎴垮悕绉版煡璇�(uid鏀惧湪num涓�) public List serchByCondition(Object obj) { - //BattInf binf=(BattInf) obj; - Page page=(Page) obj; + BattInf binf=(BattInf) obj; + Page page=binf.getPage(); Connection conn=DBUtil.getConn(); String numberSql=" SELECT FOUND_ROWS() number"; String sql=" select SQL_CALC_FOUND_ROWS distinct dev_id,thread_id,battgroup_cnt,battgroup_id1,battgroup_index1,battgroup_id2,battgroup_index2,battgroup_id3,battgroup_index3,battgroup_id4,battgroup_index4,connet_time,dev_comm_runtime,break_type " + " ,stationName,stationName1,stationName2,stationName3,stationName5,StationId " + " from db_app_sys.tb_app_bts_comm_task " + " left outer join db_battinf.tb_battinf on db_app_sys.tb_app_bts_comm_task.dev_id=db_battinf.tb_battinf.fBSDeviceId " + - //" where stationName1 like ? and stationName2 like ? and stationId like ? and stationName5 like ? " + + " where "; + //stationName1 like ? and stationName2 like ? and stationId like ? and stationName5 like ? " + /*" and db_app_sys.tb_app_bts_comm_task.dev_id in (" + " select distinct db_battinf.tb_battinf.fBSDeviceId " + " from db_battinf.tb_battinf " + @@ -61,9 +62,18 @@ " 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 db_battinf.tb_battinf.station_install=1 ) "+*/ - " order by dev_id limit ?,? "; + //FBSDeviceId绛涢�� + String dev_idT=" db_app_sys.tb_app_bts_comm_task.dev_id=? "; + String dev_idF=" db_app_sys.tb_app_bts_comm_task.dev_id!=? "; + if(binf.getFBSDeviceId()==0){ + sql+=dev_idF; + }else{ + sql+=dev_idT; + } + String orderSql=" order by dev_id limit ?,? "; + sql+=orderSql; //System.out.println(sql); //"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationId()+"%","%"+binf.getStationName5()+"%",binf.getNum() - List<App_bts_comm_task> list=DAOHelper.executeQueryLimit(sql, conn,new Object[]{(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, new CallBack() { + List<App_bts_comm_task> list=DAOHelper.executeQueryLimit(sql, conn,new Object[]{binf.getFBSDeviceId(),(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, new CallBack() { public List getResults(ResultSet rs) { List list=new ArrayList(); @@ -118,6 +128,7 @@ binf.setStationName5(""); binf.setStationId(""); binf.setBattGroupNum(62); + binf.setFBSDeviceId(0); Page p=new Page(); p.setPageCurr(1); p.setPageSize(100); -- Gitblit v1.9.1