| | |
| | | import com.fgkj.dto.App_bts_comm_task;
|
| | | import com.fgkj.dto.BattInf;
|
| | | import com.fgkj.dto.Page;
|
| | | import com.fgkj.dto.User_inf;
|
| | | import com.mysql.fabric.xmlrpc.base.Array;
|
| | |
|
| | | public class App_bts_comm_taskImpl implements BaseDAO,CallBack{
|
| | |
| | | // TODO Auto-generated method stub
|
| | | return null;
|
| | | }
|
| | | //根据省市区机房名称查询(uid放在num中)
|
| | | //根据设备id查询(uid放在num中)
|
| | | public List serchByCondition(Object 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,connect_time,dev_comm_runtime,break_type " +
|
| | | String sql=" select SQL_CALC_FOUND_ROWS distinct dev_id,thread_id,dev_mcu_uid,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,db_battinf.tb_battinf " +
|
| | | " where db_app_sys.tb_app_bts_comm_task.dev_id=db_battinf.tb_battinf.fBSDeviceId " +
|
| | | " and stationName1 like ? and stationName2 like ? and stationId like ? and stationName5 like ? " +
|
| | | " and db_app_sys.tb_app_bts_comm_task.dev_id in (" +
|
| | | " 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 ? " +
|
| | | /*" and db_app_sys.tb_app_bts_comm_task.dev_id in (" +
|
| | | " select distinct db_battinf.tb_battinf.fBSDeviceId " +
|
| | | " 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 db_battinf.tb_battinf.station_install=1 ) "+
|
| | | " limit ?,? ";
|
| | | List<App_bts_comm_task> list=DAOHelper.executeQueryLimit(sql, conn,new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationId()+"%","%"+binf.getStationName5()+"%",binf.getNum(),(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, new CallBack() {
|
| | | " where db_user.tb_user_inf.uid=? and db_battinf.tb_battinf.station_install=1 ) "+*/
|
| | | //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[]{binf.getFBSDeviceId(),(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | |
| | | atask.setDev_id(rs.getInt("dev_id"));
|
| | | atask.setThread_id(rs.getInt("thread_id"));
|
| | | atask.setBattgroup_cnt(rs.getInt("battgroup_cnt"));
|
| | | atask.setDev_mcu_uid(rs.getString("dev_mcu_uid"));
|
| | | atask.setBattgroup_id1(rs.getInt("battgroup_id1"));
|
| | | atask.setBattgroup_index1(rs.getInt("battgroup_index1"));
|
| | | atask.setBattgroup_id2(rs.getInt("battgroup_id2"));
|
| | |
| | | atask.setBattgroup_index3(rs.getInt("battgroup_index3"));
|
| | | atask.setBattgroup_id4(rs.getInt("battgroup_id4"));
|
| | | atask.setBattgroup_index4(rs.getInt("battgroup_index4"));
|
| | | atask.setConnect_time(rs.getTimestamp("connect_time"));
|
| | | atask.setConnet_time(rs.getTimestamp("connet_time"));
|
| | | atask.setDev_comm_runtime(rs.getTimestamp("dev_comm_runtime"));
|
| | | atask.setBreak_type(rs.getInt("break_type"));
|
| | | atask.setStationId(rs.getString("stationId"));
|
| | |
| | | }
|
| | | return list;
|
| | | }
|
| | |
|
| | | public static void main(String[] args) {
|
| | | App_bts_comm_taskImpl aimpl=new App_bts_comm_taskImpl();
|
| | | BattInf binf=new BattInf();
|
| | | binf.setNum(1002);
|
| | | binf.setStationName1("");
|
| | | binf.setStationName2("");
|
| | | binf.setStationName3("");
|
| | | binf.setStationName5("");
|
| | | binf.setStationId("");
|
| | | binf.setBattGroupNum(62);
|
| | | binf.setFBSDeviceId(0);
|
| | | Page p=new Page();
|
| | | p.setPageCurr(1);
|
| | | p.setPageSize(100);
|
| | | binf.setPage(p);
|
| | | List<App_bts_comm_task> list=aimpl.serchByCondition(binf);
|
| | | for (App_bts_comm_task task : list) {
|
| | | System.out.println(task);
|
| | | }
|
| | | System.out.println(list.size());
|
| | | }
|
| | | public List serchByInfo(Object obj) {
|
| | | // TODO Auto-generated method stub
|
| | | return null;
|