| | |
| | | import com.fgkj.dao.CallBack;
|
| | | import com.fgkj.dao.DAOHelper;
|
| | | import com.fgkj.dao.LimitNumberFactory;
|
| | | import com.fgkj.dao.UinfDaoFactory;
|
| | | import com.fgkj.db.DBUtil;
|
| | | import com.fgkj.dto.BattInf;
|
| | | import com.fgkj.dto.Page;
|
| | | import com.fgkj.dto.User_inf;
|
| | | import com.fgkj.dto.ram.Bts_station_state;
|
| | |
|
| | | public class Bts_station_stateImpl implements BaseDAO,CallBack{
|
| | |
| | | " ,tb_battinf.stationname,tb_battinf.stationname1,tb_battinf.stationname2,tb_battinf.stationname3 " +
|
| | | " from db_ram_db.tb_bts_station_state,db_battinf.tb_battinf " +
|
| | | " where tb_bts_station_state.dev_id=db_battinf.tb_battinf.FBSDeviceId " +
|
| | | " and tb_bts_station_state.station_id=db_battinf.tb_battinf.StationId " +
|
| | | " and tb_bts_station_state.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 tb_battinf.stationname1 like ? and tb_battinf.stationname2 like ? and tb_battinf.stationname3 like ? " +
|
| | | " and stationid like ? limit ? ,? ";
|
| | | List<Bts_station_state> list=DAOHelper.executeQueryLimit(sql, conn, new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationId()+"%",(p.getPageCurr()-1)*p.getPageSize(),p.getPageSize()},new CallBack() {
|
| | | List<Bts_station_state> list=DAOHelper.executeQueryLimit(sql, conn, new Object[]{binf.getNum(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationId()+"%",(p.getPageCurr()-1)*p.getPageSize(),p.getPageSize()},new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | |
| | | return list;
|
| | | }
|
| | | //查询当前机房停电数
|
| | | public int serchByState() {
|
| | | String sql=" select count(*) as nums from db_ram_db.tb_bts_station_state where station_stat&2>1 ";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), null, new CallBack() {
|
| | | public int serchByState(Object obj) {
|
| | | User_inf uinf=(User_inf) obj;
|
| | | String sql=" select count(*) as nums from db_ram_db.tb_bts_station_state where station_stat&2>1 " +
|
| | | " and tb_bts_station_state.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=? ) " ;
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | |
| | | public static void main(String[] args) {
|
| | | Bts_station_stateImpl bimpl=new Bts_station_stateImpl();
|
| | | BattInf binf=new BattInf();
|
| | | binf.setNum(1002);
|
| | | binf.setStationName1("");
|
| | | binf.setStationName2("");
|
| | | binf.setStationName3("");
|
| | | binf.setStationId("");
|
| | | User_inf uinf=new User_inf();
|
| | | uinf.setUId(1002);
|
| | | Page p=new Page();
|
| | | p.setPageCurr(1);
|
| | | p.setPageSize(1);
|
| | | binf.setPage(p);
|
| | | /*List<Bts_station_state> list=bimpl.serchByCondition(binf);
|
| | | List<Bts_station_state> list=bimpl.serchByCondition(binf);
|
| | | for (Bts_station_state bs : list) {
|
| | | //System.out.println(bs.getStation_stat_diaozhan()+" "+bs.getStation_stat_dooropen()+" "+bs.getStation_stat_fadian()+" "+bs.getStation_stat_xuhang()+" "+bs.getStation_stat_poff());
|
| | | System.out.println(bs);
|
| | | }*/
|
| | | int nums=bimpl.serchByState();
|
| | | System.out.println(nums);
|
| | | }
|
| | | /*int nums=bimpl.serchByState(uinf);
|
| | | System.out.println(nums);*/
|
| | | }
|
| | |
|
| | |
|