| | |
| | | import com.fgkj.db.DBUtil; |
| | | import com.fgkj.dto.BattInf; |
| | | import com.fgkj.dto.Page; |
| | | import com.fgkj.dto.User_inf; |
| | | |
| | | public class BattInfImpl implements BaseDAO,CallBack{ |
| | | |
| | |
| | | } |
| | | |
| | | //查询所有的设备 |
| | | public List serchDevice(){ |
| | | public List serchDevice(Object obj){ |
| | | User_inf uinf=(User_inf) obj; |
| | | String sql="select distinct db_battinf.tb_battinf.FBSDeviceId,stationName3,stationName,FbsDeviceIp,db_battinf.tb_battinf.FBSDeviceName" |
| | | + " ,battProducer,monCount,monVolStd,monResStd,monCapStd,battModel " |
| | | + " FROM db_battinf.tb_battinf " |
| | | + " order by FBSDeviceId asc "; |
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), null, new CallBack() { |
| | | + " FROM db_battinf.tb_battinf "; |
| | | |
| | | //用于用户管理的电池组的筛选 |
| | | String userSql=" where db_battinf.tb_battinf.BattGroupId in(select distinct db_battinf.tb_battinf.battgroupid " + |
| | | " from db_battinf.tb_battinf,db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr,db_user.tb_user_inf " + |
| | | " where db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId=db_battinf.tb_battinf.BattGroupId " + |
| | | " and db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " + |
| | | " and db_user.tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " + |
| | | " and db_user.tb_user_inf.uid=? )"; |
| | | sql+=userSql; |
| | | //排序 |
| | | String endSql=" order by FBSDeviceId asc "; |
| | | sql+=endSql; |
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() { |
| | | |
| | | @Override |
| | | public List getResults(ResultSet rs) { |
| | |
| | | p.setPageSize(6); |
| | | BattInf binf=new BattInf(); |
| | | binf.setFBSDeviceId(910000011); |
| | | User_inf uinf=new User_inf(); |
| | | uinf.setUId(1002); |
| | | //List<BattInf> list=bimpl.serchByCondition(binf); |
| | | List<BattInf> list=bimpl.serchDevice(); |
| | | List<BattInf> list=bimpl.serchDevice(uinf); |
| | | for (BattInf b : list) { |
| | | System.out.println(b); |
| | | } |