From c1cc2f63c90baadbd55689693e76404a9e6ed12e Mon Sep 17 00:00:00 2001
From: 81041 <81041@DESKTOP-025NVD9>
Date: 星期四, 20 十二月 2018 14:21:56 +0800
Subject: [PATCH] 修改
---
gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java | 56 ++++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 46 insertions(+), 10 deletions(-)
diff --git a/gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java b/gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java
index 26ef434..bf9c9c2 100644
--- a/gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java
+++ b/gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java
@@ -51,12 +51,12 @@
Connection conn=DBUtil.getConn();
String numberSql="SELECT FOUND_ROWS() number";//瀛樻斁鎬绘暟
String sql="select SQL_CALC_FOUND_ROWS distinct station_id,dev_id,record_datetime,station_stat,station_poff_start_time,station_fadian_start_time" +
- " ,station_diaozhan_start_time,station_temp,station_damp,station_dooropen_start_time,station_xuhang_start_time" +
+ " ,station_diaozhan_start_time,station_temp,station_damp,station_dooropen_start_time,station_xuhang_start_time,station_xuhang_end_time" +
" ,tb_battinf.stationname,tb_battinf.stationname1,tb_battinf.stationname2,tb_battinf.stationname3,tb_battinf.stationname5 " +
" 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_battinf.stationname1 like ? and tb_battinf.stationname2 like ? and tb_battinf.stationname3 like ? and tb_battinf.stationname5 like ? " +
- " and stationid like ? " ;
+ " and stationid like ? and Station_install=1 " ;
/*" and tb_bts_station_state.station_id in (" +
" select distinct db_battinf.tb_battinf.stationid " +
" from db_battinf.tb_battinf " +
@@ -154,6 +154,7 @@
b.setStation_damp(rs.getFloat("station_damp"));
b.setStation_dooropen_start_time(rs.getTimestamp("station_dooropen_start_time"));
b.setStation_xuhang_start_time(rs.getTimestamp("station_xuhang_start_time"));
+ b.setStation_xuhang_end_time(rs.getTimestamp("station_xuhang_end_time"));
b.setStationName(rs.getString("stationName"));
b.setStationName1(rs.getString("stationName1"));
b.setStationName2(rs.getString("stationName2"));
@@ -182,13 +183,13 @@
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 (" +
+ " 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=? ) " ;
+ " where db_user.tb_user_inf.uid=? and Station_install=1 ) ";
List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() {
public List getResults(ResultSet rs) {
@@ -220,7 +221,7 @@
" 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=? ) " ;
+ " where db_user.tb_user_inf.uid=? and Station_install=1 ) ";
List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() {
public List getResults(ResultSet rs) {
@@ -242,11 +243,40 @@
}
return nums;
}
- //鏌ヨ褰撳墠鏈烘埧鍋滅數鏁�(鏍规嵁station_id )
+ //鏌ヨ鍏蜂綋鏌愭満鎴垮仠鐢垫暟(鏍规嵁station_id )
public int serchByStationId(Object obj) {
BattMap_information binformation=(BattMap_information) obj;
String sql="select count(num) as nums from db_ram_db.tb_bts_station_state " +
" where station_stat&2>1 " +
+ " and station_id=? " +
+ " limit 1 ";
+ //System.out.println(sql);
+ List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binformation.getStationId()}, new CallBack() {
+
+ public List getResults(ResultSet rs) {
+ List list=new ArrayList();
+ try {
+ while(rs.next()){
+ int nums=rs.getInt("nums");
+ list.add(nums);
+ }
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ return list;
+ }
+ });
+ int nums=0;//鏈�鍚庣殑缁撴灉
+ if(list!=null&&list.size()>0){
+ nums=(Integer) list.get(list.size()-1);
+ }
+ return nums;
+ }
+ //鏌ヨ鍏蜂綋鏌愭満鎴挎帀绔欐暟(鏍规嵁station_id )
+ public int serchByStationId_diaozhan(Object obj) {
+ BattMap_information binformation=(BattMap_information) obj;
+ String sql="select count(num) as nums from db_ram_db.tb_bts_station_state " +
+ " where station_stat&32>1 " +
" and station_id=? " +
" limit 1 ";
//System.out.println(sql);
@@ -282,24 +312,30 @@
binf.setStationName1("");
binf.setStationName2("");
binf.setStationName3("");
+ binf.setStationName5("");
binf.setStationId("");
- binf.setBattGroupNum(36);
+ binf.setBattGroupNum(62);
User_inf uinf=new User_inf();
uinf.setUId(1002);
Page p=new Page();
p.setPageCurr(1);
p.setPageSize(10);
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(uinf);*/
+ }*/
+ //System.out.println(list.size());
+ //int nums=bimpl.serchByState(uinf);
/*BattMap_information bm=new BattMap_information();
bm.setStationId("42000570");
int nums=bimpl.serchByStationId(bm);*/
int nums=bimpl.serchByState_diaozhan(uinf);
+ /*BattMap_information bm=new BattMap_information();
+ bm.setStationId("42000366");
+ int nums=bimpl.serchByStationId_diaozhan(bm);*/
+
System.out.println(nums);
}
--
Gitblit v1.9.1